Package com.tailf.proto
Class ConfELong
Object
com.tailf.proto.ConfEObject
com.tailf.proto.ConfELong
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
ConfEByte
,ConfEChar
,ConfEInt
,ConfEShort
,ConfEUInt
,ConfEUShort
Provides a Java representation of E integral types. E does not distinguish
between different integral types, however this class and its subclasses
ConfEByte
, ConfEChar
, ConfEInt
, and
ConfEShort
attempt to map the E types onto the various Java integral
types. Two additional classes, ConfEUInt
and ConfEUShort
are
provided for Corba compatibility. See the documentation for IC for more
information.- See Also:
-
Constructor Summary
ConstructorDescriptionConfELong
(long l) Create an E integer from the given value.ConfELong
(ConfInputStream buf) Create an E integer from a stream containing an integer encoded in E external format. -
Method Summary
Modifier and TypeMethodDescriptionbyte
Get this number as a byte.char
Get this number as a char.void
encode
(ConfOutputStream buf) Convert this number to the equivalent E external representation.boolean
Determine if two numbers are equal.int
intValue()
Get this number as an int.long
Get this number as a long.short
Get this number as a short.toString()
Get the string representation of this number.int
Get this number as a non-negative int.short
Get this number as a non-negative short.Methods inherited from class com.tailf.proto.ConfEObject
clone, decode
-
Constructor Details
-
ConfELong
public ConfELong(long l) Create an E integer from the given value.- Parameters:
l
- the long value to use.
-
ConfELong
Create an E integer from a stream containing an integer encoded in E external format.- Parameters:
buf
- the stream containing the encoded value.- Throws:
ConfEDecodeException
- if the buffer does not contain a valid external representation of an E integer.
-
-
Method Details
-
longValue
public long longValue()Get this number as a long.- Returns:
- the value of this number, as a long.
-
intValue
Get this number as an int.- Returns:
- the value of this number, as an int.
- Throws:
ConfERangeException
- if the value is too large to be represented as an int.
-
uIntValue
Get this number as a non-negative int.- Returns:
- the value of this number, as an int.
- Throws:
ConfERangeException
- if the value is too large to be represented as an int, or if the value is negative.
-
shortValue
Get this number as a short.- Returns:
- the value of this number, as a short.
- Throws:
ConfERangeException
- if the value is too large to be represented as a short.
-
uShortValue
Get this number as a non-negative short.- Returns:
- the value of this number, as a short.
- Throws:
ConfERangeException
- if the value is too large to be represented as a short, or if the value is negative.
-
charValue
Get this number as a char.- Returns:
- the char value of this number.
- Throws:
ConfERangeException
- if the value is too large to be represented as a char.
-
byteValue
Get this number as a byte.- Returns:
- the byte value of this number.
- Throws:
ConfERangeException
- if the value is too large to be represented as a byte.
-
toString
Get the string representation of this number.- Specified by:
toString
in classConfEObject
- Returns:
- the string representation of this number.
-
encode
Convert this number to the equivalent E external representation.- Specified by:
encode
in classConfEObject
- Parameters:
buf
- an output stream to which the encoded number should be written.
-
equals
Determine if two numbers are equal. Numbers are equal if they contain the same value.- Specified by:
equals
in classConfEObject
- Parameters:
o
- the number to compare to.- Returns:
- true if the numbers have the same value.
-