|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.generationjava.lang.Constant
Used to signify a constant value. Most commonly expected to be used in an interface, passed to a method that takes type: Constant and tests by equality and not the .equals() method. The constant wraps an Object value, thus allowing the Constant to contain actual information and not just a new Object. It also adds typing information, so users of your code are forced to use your constant and not push their own magic number in. It is extendable, so the cosntant can contain more than just the one value. It's not an interface, allowing people to provide their own classes which are 'Constantable' as this does not fit the use of ==.
| Constructor Summary | |
Constant()
Deprecated. Empty constructor. |
|
Constant(boolean b)
Deprecated. |
|
Constant(byte b)
Deprecated. |
|
Constant(char c)
Deprecated. |
|
Constant(double d)
Deprecated. |
|
Constant(float f)
Deprecated. |
|
Constant(int i)
Deprecated. |
|
Constant(long l)
Deprecated. |
|
Constant(Object obj)
Deprecated. Pass the value to be wrapped by this Constant. |
|
Constant(short s)
Deprecated. |
|
| Method Summary | |
boolean |
booleanValue()
Deprecated. |
byte |
byteValue()
Deprecated. |
char |
charValue()
Deprecated. |
boolean |
equals(Object obj)
Deprecated. This runs equals on the underlying Object. |
float |
floatValue()
Deprecated. |
Object |
getValue()
Deprecated. Get the value that this Constant contains. |
int |
hashCode()
Deprecated. Runs hashCode on the underlying Object. |
int |
intValue()
Deprecated. |
long |
longValue()
Deprecated. |
short |
shortValue()
Deprecated. |
String |
toString()
Deprecated. The toString of the wrapped object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Constant()
public Constant(Object obj)
public Constant(boolean b)
public Constant(byte b)
public Constant(short s)
public Constant(int i)
public Constant(char c)
public Constant(long l)
public Constant(float f)
public Constant(double d)
| Method Detail |
public Object getValue()
public char charValue()
public int intValue()
public float floatValue()
public long longValue()
public byte byteValue()
public short shortValue()
public boolean booleanValue()
public String toString()
public boolean equals(Object obj)
public int hashCode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||