|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amx.duet.tools.lang.ObjectRef
An object reference class used to convert objects from one value or data type to another. This class was created to handle parameter pass by reference values.
Constructor Summary | |
ObjectRef(boolean b)
Creates an object representation of the boolean argument. |
|
ObjectRef(byte b)
Creates an object representation of the byte argument. |
|
ObjectRef(char c)
Creates an object representation of the char argument. |
|
ObjectRef(double d)
Creates an object representation of the double argument. |
|
ObjectRef(float f)
Creates an object representation of the float argument. |
|
ObjectRef(int i)
Creates an object representation of the int argument. |
|
ObjectRef(long l)
Creates an object representation of the long argument. |
|
ObjectRef(java.lang.Object o)
Stores a copy of the Object argument. |
|
ObjectRef(java.lang.Object o,
ObjectType refType)
Stores a copy of the Object argument as the ObjectType
passed in. |
|
ObjectRef(ObjectType refType)
Creates an empty object representation of the type of ObjectType
passed in. |
|
ObjectRef(short s)
Creates an object representation of the short argument. |
|
ObjectRef(java.lang.String str)
Creates an object representation of the String argument. |
Method Summary | |
boolean |
booleanValue()
Returns the boolean value stored within this object. |
byte |
byteValue()
Returns the byte value stored within this object. |
char |
charValue()
Returns the char value stored within this object. |
double |
doubleValue()
Returns the double value stored within this object. |
boolean |
equals(java.lang.Object obj)
|
float |
floatValue()
Returns the float value stored within this object. |
ObjectType |
getType()
Returns the object type for the currently stored object. |
java.lang.Object |
getValue()
Returns the object representation of the value stored in this object. |
int |
intValue()
Returns the int value stored within this object. |
long |
longValue()
Returns the long value stored within this object. |
short |
shortValue()
Returns the short value stored within this object. |
java.lang.String |
stringValue()
Returns the String value stored within this object. |
boolean |
toBoolean()
Converts the stored value to a boolean representation and returns
the new value. |
byte |
toByte()
Converts the stored value to a byte representation and returns
the new value. |
char |
toChar()
Converts the stored value to a char representation and returns
the new value. |
double |
toDouble()
Converts the stored value to a double representation and returns
the new value. |
float |
toFloat()
Converts the stored value to a float representation and returns
the new value. |
int |
toInt()
Converts the stored value to a int representation and returns
the new value. |
long |
toLong()
Converts the stored value to a long representation and returns
the new value. |
short |
toShort()
Converts the stored value to a short representation and returns
the new value. |
java.lang.String |
toString()
|
java.lang.Object |
valueOf(boolean b)
Stores and returns the object representation of the boolean argument. |
java.lang.Object |
valueOf(byte b)
Stores and returns the object representation of the byte argument. |
java.lang.Object |
valueOf(char c)
Stores and returns the object representation of the char argument. |
java.lang.Object |
valueOf(double d)
Stores and returns the object representation of the double argument. |
java.lang.Object |
valueOf(float f)
Stores and returns the object representation of the floag argument. |
java.lang.Object |
valueOf(int i)
Stores and returns the object representation of the int argument. |
java.lang.Object |
valueOf(long l)
Stores and returns the object representation of the long argument. |
java.lang.Object |
valueOf(java.lang.Object o)
Stores and returns the Object argument. |
java.lang.Object |
valueOf(java.lang.Object o,
ObjectType refType)
Stores and returns the Object argument as the ObjectType
passed in. |
java.lang.Object |
valueOf(short s)
Stores and returns the object representation of the short argument. |
java.lang.Object |
valueOf(java.lang.String str)
Stores and returns the object representation of the String argument. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ObjectRef(boolean b)
boolean
argument.
b
- a boolean
.public ObjectRef(byte b)
byte
argument.
b
- a byte
.public ObjectRef(char c)
char
argument.
c
- a char
.public ObjectRef(short s)
short
argument.
s
- a short
.public ObjectRef(int i)
int
argument.
i
- a int
.public ObjectRef(long l)
long
argument.
l
- a long
.public ObjectRef(float f)
float
argument.
f
- a float
.public ObjectRef(double d)
double
argument.
d
- a double
.public ObjectRef(java.lang.String str)
String
argument.
str
- a String
.public ObjectRef(java.lang.Object o)
Object
argument.
o
- an Object
.public ObjectRef(java.lang.Object o, ObjectType refType)
Object
argument as the ObjectType
passed in.
o
- an Object
.refType
- the ObjectType
that the object is assigned as.public ObjectRef(ObjectType refType)
ObjectType
passed in.
refType
- the ObjectType
that the object is assigned as.
java.lang.UnsupportedOperationException
- if the object type passed in is not
supported.Method Detail |
public java.lang.Object valueOf(boolean b)
boolean
argument.
b
- a boolean
.
boolean
value created as a Boolean
object and cast to an Object
.public java.lang.Object valueOf(byte b)
byte
argument.
b
- a byte
.
byte
value created as a Byte
object
and cast to an Object
.public java.lang.Object valueOf(char c)
char
argument.
c
- a char
.
char
value created as a Character
object and cast to an Object
.public java.lang.Object valueOf(short s)
short
argument.
s
- a short
.
short
value created as a Short
object and cast to an Object
.public java.lang.Object valueOf(int i)
int
argument.
i
- an int
.
int
value created as a Integer
object and cast to an Object
.public java.lang.Object valueOf(long l)
long
argument.
l
- a long
.
long
value created as a Long
object and cast to an Object
.public java.lang.Object valueOf(float f)
floag
argument.
f
- a float
.
float
value created as a Float
object and cast to an Object
.public java.lang.Object valueOf(double d)
double
argument.
d
- a double
.
double
value created as a Double
object and cast to an Object
.public java.lang.Object valueOf(java.lang.String str)
String
argument.
str
- a String
.
String
value cast to an Object
.public java.lang.Object valueOf(java.lang.Object o)
Object
argument.
o
- an Object
.
Object
argument passed it.public java.lang.Object valueOf(java.lang.Object o, ObjectType refType)
Object
argument as the ObjectType
passed in.
o
- an Object
.refType
-
Object
argument passed it.
java.lang.UnsupportedOperationException
- if the object type passed in is not
supported.public boolean booleanValue()
boolean
value stored within this object.
boolean
value, then
that value will be returned. Otherwise, false
will be returned.public byte byteValue()
byte
value stored within this object.
byte
value, then
that value will be returned. Otherwise, 0
will be returned.public char charValue()
char
value stored within this object.
char
value, then
that value will be returned. Otherwise, 0
will be returned.public short shortValue()
short
value stored within this object.
short
value, then
that value will be returned. Otherwise, 0
will be returned.public int intValue()
int
value stored within this object.
int
value, then
that value will be returned. Otherwise, 0
will be returned.public long longValue()
long
value stored within this object.
long
value, then
that value will be returned. Otherwise, 0
will be returned.public float floatValue()
float
value stored within this object.
float
value, then
that value will be returned. Otherwise, 0
will be returned.public double doubleValue()
double
value stored within this object.
double
value, then
that value will be returned. Otherwise, 0
will be returned.public java.lang.String stringValue()
String
value stored within this object.
String
value, then
that value will be returned. Otherwise, an empty string will be returned.public java.lang.Object getValue()
Object
stored in this object.public ObjectType getType()
ObjectType
representing the type of object stored.public boolean equals(java.lang.Object obj)
public java.lang.String toString()
public boolean toBoolean()
boolean
representation and returns
the new value.
boolean
value. If the stored value is equal to
"true" or a value other than 0, the return value will be true
.
Otherwise, the return value should be false.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public byte toByte()
byte
representation and returns
the new value.
byte
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Byte.MIN_VALUE
and
Byte.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public char toChar()
char
representation and returns
the new value.
char
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Character.MIN_VALUE
and
Character.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public short toShort()
short
representation and returns
the new value.
short
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Short.MIN_VALUE
and
Short.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public int toInt()
int
representation and returns
the new value.
int
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Integer.MIN_VALUE
and
Integer.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public long toLong()
long
representation and returns
the new value.
long
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Long.MIN_VALUE
and
Long.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public float toFloat()
float
representation and returns
the new value.
float
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Float.MIN_VALUE
and
Float.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.public double toDouble()
double
representation and returns
the new value.
double
value. If the stored value is equal to
"true", the return value will be 1
. If the value could not be
converted the return value will be 0
. Otherwise, the return value
should be a value between Double.MIN_VALUE
and
Double.MAX_VALUE
.
java.lang.ClassCastException
- if the stored value could not be converted to a known type.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |