|
|||||||||
Home >> All >> [ Memory overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
Memory
Class Address

java.lang.ObjectMemory.Address
- Direct Known Subclasses:
- CodeAddress, HeapAddress, StackAddress
- public abstract class Address
- extends java.lang.Object
- Version:
- $Id: Address.java,v 1.5 2003/03/05 08:35:33 joewhaley Exp $
Field Summary | |
static Clazz.jq_Class |
_class
|
Constructor Summary | |
Address()
|
Method Summary | |
abstract Address |
align(int shift)
|
static int |
align(int val,
int shift)
|
protected java.lang.Object |
clone()
This method may be called to create a new copy of the Object. |
abstract int |
difference(Address v)
|
boolean |
equals(java.lang.Object arg0)
Determine whether this Object is semantically equal to another Object. |
int |
hashCode()
Get a value that represents this Object, as uniquely as possible within the confines of an int. |
abstract boolean |
isNull()
|
abstract Address |
offset(int offset)
|
abstract Address |
peek()
|
abstract byte |
peek1()
|
abstract short |
peek2()
|
abstract int |
peek4()
|
abstract long |
peek8()
|
abstract void |
poke(Address v)
|
abstract void |
poke1(byte v)
|
abstract void |
poke2(short v)
|
abstract void |
poke4(int v)
|
abstract void |
poke8(long v)
|
abstract java.lang.String |
stringRep()
|
abstract int |
to32BitValue()
|
java.lang.String |
toString()
Convert this Object to a human-readable String. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
_class
public static final Clazz.jq_Class _class
Constructor Detail |
Address
public Address()
Method Detail |
peek
public abstract Address peek()
peek1
public abstract byte peek1()
peek2
public abstract short peek2()
peek4
public abstract int peek4()
peek8
public abstract long peek8()
poke
public abstract void poke(Address v)
poke1
public abstract void poke1(byte v)
poke2
public abstract void poke2(short v)
poke4
public abstract void poke4(int v)
poke8
public abstract void poke8(long v)
offset
public abstract Address offset(int offset)
align
public abstract Address align(int shift)
difference
public abstract int difference(Address v)
isNull
public abstract boolean isNull()
to32BitValue
public abstract int to32BitValue()
stringRep
public abstract java.lang.String stringRep()
align
public static final int align(int val, int shift)
clone
protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Description copied from class:
java.lang.Object
- This method may be called to create a new copy of the
Object. The typical behavior is as follows:
o == o.clone()
is falseo.getClass() == o.clone().getClass()
is trueo.equals(o)
is true
However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>
Object.equals(Object)
55 .If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.
Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override this method as follows (it should never fail):
public Object clone() { try { super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.getMessage()); } }
equals
public final boolean equals(java.lang.Object arg0)
- Description copied from class:
java.lang.Object
- Determine whether this Object is semantically equal
to another Object.
There are some fairly strict requirements on this method which subclasses must follow:
- It must be transitive. If
a.equals(b)
andb.equals(c)
, thena.equals(c)
must be true as well. - It must be symmetric.
a.equals(b)
andb.equals(a)
must have the same value. - It must be reflexive.
a.equals(a)
must always be true. - It must be consistent. Whichever value a.equals(b) returns on the first invocation must be the value returned on all later invocations.
a.equals(null)
must be false.- It must be consistent with hashCode(). That is,
a.equals(b)
must implya.hashCode() == b.hashCode()
. The reverse is not true; two objects that are not equal may have the same hashcode, but that has the potential to harm hashing performance.
This is typically overridden to throw a java.lang.ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for
a.equals(b)
to be true even thougha.getClass() != b.getClass()
. Also, it is typical to never cause a java.lang.NullPointerException.In general, the Collections API (
java.util
) use theequals
method rather than the==
operator to compare objects. However, java.util.IdentityHashMap is an exception to this rule, for its own good reasons.The default implementation returns
this == o
. - It must be transitive. If
hashCode
public final int hashCode()
- Description copied from class:
java.lang.Object
- Get a value that represents this Object, as uniquely as
possible within the confines of an int.
There are some requirements on this method which subclasses must follow:
- Semantic equality implies identical hashcodes. In other
words, if
a.equals(b)
is true, thena.hashCode() == b.hashCode()
must be as well. However, the reverse is not necessarily true, and two objects may have the same hashcode without being equal. - It must be consistent. Whichever value o.hashCode() returns on the first invocation must be the value returned on all later invocations as long as the object exists. Notice, however, that the result of hashCode may change between separate executions of a Virtual Machine, because it is not invoked on the same object.
Notice that since
hashCode
is used in java.util.Hashtable and other hashing classes, a poor implementation will degrade the performance of hashing (so don't blindly implement it as returning a constant!). Also, if calculating the hash is time-consuming, a class may consider caching the results.The default implementation returns
System.identityHashCode(this)
- Semantic equality implies identical hashcodes. In other
words, if
toString
public final java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null
, string concatenation will instead use"null"
.The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode())
.
|
|||||||||
Home >> All >> [ Memory overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |