|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.msd.lang.Reference<T>
public class Reference<T>
Represents a discriminable reference to an object.
| Constructor Summary | |
|---|---|
Reference(T obj)
Creates a new discriminable reference belonging to its own EquivalenceClass. |
|
Reference(T obj,
EquivalenceClass eqCls)
Creates a new discriminable reference belonging to the specified EquivalenceClass. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Returns true if and only if the specified object is also
an EquivalenceClassDiscriminable and that
EquivalenceClassDiscriminable points to the
same EquivalenceClass object as this Reference. |
T |
get()
Returns the Object pointed to by this Reference. |
EquivalenceClass |
getEquivalenceClass()
Returns the EquivalenceClass that this object belongs to. |
int |
hashCode()
Returns the result of invoking hashCode on the
EquivalenceClass of this Reference. |
void |
setEquivalenceClass(EquivalenceClass eqCls)
Changes the EquivalenceClass of this object to the
specified EquivalenceClass (optional operation). |
String |
toString()
Returns the result of invoking the toString method on the
object pointed to by this Reference. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Reference(T obj)
EquivalenceClass. Other references can later by
added to this EquivalenceClass by using the
Reference(Object, EquivalenceClass) constructor
and getting this reference's EquivalenceClass
using the getEquivalenceClass method.
public Reference(T obj,
EquivalenceClass eqCls)
EquivalenceClass. If eqCls is null
a new EquivalenceClass will be created and this
Reference will be the only member. Other references can
later be added to this EquivalenceClass.
| Method Detail |
|---|
public T get()
Object pointed to by this Reference.
public EquivalenceClass getEquivalenceClass()
EquivalenceClassDiscriminableEquivalenceClass that this object belongs to.
getEquivalenceClass in interface EquivalenceClassDiscriminablepublic void setEquivalenceClass(EquivalenceClass eqCls)
EquivalenceClassDiscriminableEquivalenceClass of this object to the
specified EquivalenceClass (optional operation).
If this operation is not supported an
UnsupportedOperationException will be thrown.
setEquivalenceClass in interface EquivalenceClassDiscriminablepublic boolean equals(Object o)
true if and only if the specified object is also
an EquivalenceClassDiscriminable and that
EquivalenceClassDiscriminable points to the
same EquivalenceClass object as this Reference.
equals in class Objectpublic int hashCode()
hashCode on the
EquivalenceClass of this Reference. The reason
for this is that if two objects are equal according to the
equals(Object) method, then calling the hashCode
method on each of the two objects must produce the same integer result.
hashCode in class Objectpublic String toString()
toString method on the
object pointed to by this Reference.
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||