public class PSTObject extends Object implements objects.ConfigurableObject, TimestampedObject, UpdatableObject, com.gemstone.gemfire.cache.util.ObjectSizer, com.gemstone.gemfire.DataSerializable
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
byteArray |
protected int |
field1 |
protected char |
field2 |
protected long |
timestamp |
| Constructor and Description |
|---|
PSTObject() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Two
PSTObjects are considered to be equal if they have
the same values for field1, field2 and timestamp. |
void |
fromData(DataInput in) |
int |
getIndex()
Returns the index encoded in the PSTObject's byte array.
|
long |
getTimestamp()
Returns the object creation timestamp encoded in the object.
|
int |
hashCode() |
void |
incrementField1() |
void |
init(int index)
Initializes a PSTObject.
|
void |
resetTimestamp()
Resets the timestamp encoded in the object to the current time.
|
int |
sizeof(Object o) |
void |
toData(DataOutput out) |
String |
toString() |
void |
update()
Updates one or more object fields.
|
void |
validate(int index)
Validates that the given index is encoded in the PSTObject's
byte array.
|
protected long timestamp
protected int field1
protected char field2
protected byte[] byteArray
public void init(int index)
init in interface objects.ConfigurableObjectindex - the value to encode into the PSTObject.ObjectCreationException - index cannot be encodedpublic int getIndex()
getIndex in interface objects.ConfigurableObjectObjectAccessExceptionpublic void validate(int index)
validate in interface objects.ConfigurableObjectindex - the expected encoded valueObjectValidationException - If index is not encoded in bytespublic void incrementField1()
public void update()
UpdatableObjectupdate in interface UpdatableObjectpublic long getTimestamp()
TimestampedObjectgetTimestamp in interface TimestampedObjectpublic void resetTimestamp()
TimestampedObjectresetTimestamp in interface TimestampedObjectpublic boolean equals(Object o)
PSTObjects are considered to be equal if they have
the same values for field1, field2 and timestamp.
This provides stronger validation than the validate(int)
method that only considers the index.public int sizeof(Object o)
sizeof in interface com.gemstone.gemfire.cache.util.ObjectSizerpublic void toData(DataOutput out) throws IOException
toData in interface com.gemstone.gemfire.DataSerializableIOExceptionpublic void fromData(DataInput in) throws IOException, ClassNotFoundException
fromData in interface com.gemstone.gemfire.DataSerializableIOExceptionClassNotFoundExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.