public abstract class EncodedInteger extends Number implements DataObject, Immutable
Modifier | Constructor and Description |
---|---|
protected |
EncodedInteger(DataInput input) |
protected |
EncodedInteger(IntegerCodec codec,
byte[] data) |
protected |
EncodedInteger(IntegerCodec codec,
byte[] data,
int start,
int len) |
protected |
EncodedInteger(IntegerCodec codec,
int value) |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue() |
Object |
clone()
Perform a deep copy of this object.
|
double |
doubleValue() |
boolean |
equals(Object o) |
float |
floatValue() |
int |
hashCode() |
int |
intValue() |
boolean |
isReadOnly()
Check if this object has been set read-only.
|
long |
longValue() |
void |
setReadOnly()
Set this object to be "read-only".
|
short |
shortValue() |
void |
toStream(DataOutput out) |
String |
toString() |
protected EncodedInteger(DataInput input) throws IOException
IOException
protected EncodedInteger(IntegerCodec codec, int value) throws EncodeException
EncodeException
protected EncodedInteger(IntegerCodec codec, byte[] data)
protected EncodedInteger(IntegerCodec codec, byte[] data, int start, int len)
public void toStream(DataOutput out) throws IOException
IOException
public final short shortValue()
shortValue
in class Number
public final float floatValue()
floatValue
in class Number
public final double doubleValue()
doubleValue
in class Number
public Object clone()
DataObject
Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.
clone
in interface DataObject
clone
in class Object
public void setReadOnly()
DataObject
Note that a read-only object is not necessarily immutable; if reference types are returned from accessors, then callers could theoretically mutate those objects even if the top-level object is marked as read-only. The ability to make objects read-only is intended to catch programming errors (e.g. attempting to modify a data object passed as part of a SLEE event), not to provide an absolute guarantee of immutability.
Calling setReadOnly() on an object that is already read-only is a no-op.
Some DataObject implementations may be inherently immutable. In those cases, they are considered always read-only.
setReadOnly
in interface DataObject
public boolean isReadOnly()
DataObject
isReadOnly
in interface DataObject
DataObject.setReadOnly()