|
||||||||||
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
valuepublic 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
valuepublic 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()
NumberThing
byteValue
returns the number as a byte.
byteValue
in class NumberThing
byte
valuepublic short shortValue()
NumberThing
shortValue
returns the number as a short.
shortValue
in class NumberThing
short
valuepublic int intValue()
NumberThing
intValue
returns the number as an int.
intValue
in class NumberThing
int
valuepublic long longValue()
NumberThing
longValue
returns the value as a long.
longValue
in class NumberThing
long
valuepublic float floatValue()
NumberThing
floatValue
returns the value as a float. Not
available in CLDC 1.0
floatValue
in class NumberThing
float
valuepublic double doubleValue()
NumberThing
doubleValue
returns the value as a double. Not
available in CLDC 1.0
doubleValue
in class NumberThing
double
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 RealThing
deepcopy
in class NumberThing
RealThing
valuepublic java.lang.String getStringRep()
getStringRep
creates a string representation of the
LongThing.
getStringRep
in interface RealThing
getStringRep
in class NumberThing
String
value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |