|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hecl.NumberThing
org.hecl.FractionalThing
org.hecl.LongThing
public class LongThing
The LongThing class represents a 'long' Thing.
| Constructor Summary | |
|---|---|
LongThing()
Creates a new LongThing instance equal to 0. |
|
LongThing(boolean b)
Creates a new LongThing instance from boolean b
where true is 1 and false is 0. |
|
LongThing(long l)
Creates a new LongThing instance with value l. |
|
LongThing(java.lang.String s)
Creates a new LongThing instance from string s. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
byteValue returns the number as a byte. |
static Thing |
create(boolean b)
The create method creates and returns a newly
allocated Thing with an LongThing internal representation. |
static Thing |
create(int i)
The create method creates and returns a newly allocated
Thing with an LongThing internal representation. |
static Thing |
create(long l)
The create method creates and returns a newly allocated
Thing with an LongThing internal representation. |
RealThing |
deepcopy()
deepcopy makes a copy. |
double |
doubleValue()
doubleValue returns the value as a double. |
float |
floatValue()
floatValue returns the value as a float. |
static long |
get(Thing thing)
get attempts to fetch an integer value from a
Thing. |
java.lang.String |
getStringRep()
getStringRep creates a string representation of the
LongThing. |
int |
intValue()
intValue returns the number as an int. |
boolean |
isLong()
|
long |
longValue()
longValue returns the value as a long. |
void |
set(long l)
set sets the internal value of an LongThing to l. |
short |
shortValue()
shortValue returns the number as a short. |
java.lang.String |
thingclass()
|
| Methods inherited from class org.hecl.FractionalThing |
|---|
isFractional, isIntegral |
| Methods inherited from class org.hecl.NumberThing |
|---|
asNumber, create, isFractional, isIntegral, isNumber, isNumber |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LongThing()
LongThing instance equal to 0.
public LongThing(long l)
LongThing instance with value l.
l - a long valuepublic LongThing(boolean b)
LongThing instance from boolean b
where true is 1 and false is 0.
b - a boolean value
public LongThing(java.lang.String s)
throws java.lang.NumberFormatException
LongThing instance from string s.
s - a String value
java.lang.NumberFormatException - when argum,ent does not adhere to
integral number syntax.| Method Detail |
|---|
public java.lang.String thingclass()
public static Thing create(int i)
create method creates and returns a newly allocated
Thing with an LongThing internal representation.
i - an int value
Thing valuepublic static Thing create(long l)
create method creates and returns a newly allocated
Thing with an LongThing internal representation.
l - an long value
Thing valuepublic static Thing create(boolean b)
create method creates and returns a newly
allocated Thing with an LongThing internal representation.
b - an boolean value
Thing value
public static long get(Thing thing)
throws HeclException
get attempts to fetch an integer value from a
Thing.
thing - a Thing value
int value
HeclException - if an error occurspublic byte byteValue()
NumberThingbyteValue returns the number as a byte.
byteValue in class NumberThingbyte valuepublic short shortValue()
NumberThingshortValue returns the number as a short.
shortValue in class NumberThingshort valuepublic int intValue()
NumberThingintValue returns the number as an int.
intValue in class NumberThingint valuepublic long longValue()
NumberThinglongValue returns the value as a long.
longValue in class NumberThinglong valuepublic float floatValue()
NumberThingfloatValue returns the value as a float. Not
available in CLDC 1.0
floatValue in class NumberThingfloat valuepublic double doubleValue()
NumberThingdoubleValue returns the value as a double. Not
available in CLDC 1.0
doubleValue in class NumberThingdouble valuepublic boolean isLong()
public void set(long l)
set sets the internal value of an LongThing to l.
l - a long valuepublic RealThing deepcopy()
deepcopy makes a copy.
deepcopy in interface RealThingdeepcopy in class NumberThingRealThing valuepublic java.lang.String getStringRep()
getStringRep creates a string representation of the
LongThing.
getStringRep in interface RealThinggetStringRep in class NumberThingString value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||