|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cdev.data.Data
A container class for storing DataEntry objects accessed via either String or int keys.
Field Summary | |
static short |
BYTE
|
static short |
DOUBLE
|
static short |
FLOAT
|
static short |
INT
|
static short |
INVALID
|
static short |
LONG
|
static int |
MAXTYPE
|
static short |
SHORT
|
static short |
STRING
|
static int |
VALUE_KEY
|
Constructor Summary | |
Data()
Construct an empty Data object. |
|
Data(Data original)
Shallow Copy Constructor. |
|
Data(xdrReader in)
Construct a Data object given the byte stream in an xdrReader object. |
Method Summary | |
void |
addDataEntry(DataEntry entry)
Add a data entry to this container. |
void |
changeKey(int oldkey,
int newkey)
Change the key for an existing data entry. |
java.lang.Object |
clone()
clone(): performs a deep copy of a Data Object |
boolean |
containsKey(int key)
Test to see if the specified key is in the Data object. |
boolean |
containsKey(java.lang.String key)
Test to see if the specified key is in the Data object. |
static java.lang.String |
convertKey(int key)
Get the string equivalent of an integer key. |
static int |
convertKey(java.lang.String key)
Get the integer equivalent of a string key. |
void |
copyInto(Data dst)
Performs a copy of this Data into another destination Data. |
java.util.Enumeration |
elements()
Get an Enumeration of all contained DataEntry objects. |
boolean |
equals(Data other)
Perform a deep compare of 2 Data object to determine if they have the same data. |
static java.lang.Class |
getClass(int dataType)
Returns a Class from an integer data type |
DataEntry |
getDataEntry(int key)
Return the DataEntry with the specified key, or null if not found. |
DataEntry |
getDataEntry(java.lang.String key)
Return the DataEntry with the specified key, or null if not found. |
int |
getSize()
Return the number of DataEntry objects in this Data object. |
java.lang.Object |
getValue(int key)
Retrieves a data object specified by key from the specified DataEntry. |
java.lang.Object |
getValue(java.lang.String key)
Retrieves a data object specified by key from the specified DataEntry. |
void |
insert(int tag,
byte data)
Insert a scalar value into a Data object as a tagged data item. |
void |
insert(int tag,
double data)
Insert a scalar value of type double into the Data object and give it the specified integer tag. |
void |
insert(int tag,
float data)
Insert a scalar value of type float into a Data object and give it the specified integer tag. |
void |
insert(int tag,
int data)
Insert a scalar value of type int into a Data object and give it the specified integer tag. |
void |
insert(int tag,
long data)
Insert a scalar value of type long into a Data object and give it the specified integer tag. |
void |
insert(int tag,
java.lang.Object data)
Insert an object into the Data object and give it the specified integer tag. |
void |
insert(int tag,
short data)
Insert a scalar value into a Data object as a tagged data item. |
void |
insert(java.lang.String tag,
byte data)
Insert "data" into the this cdev.Data object associated with "tag". |
void |
insert(java.lang.String tag,
double data)
|
void |
insert(java.lang.String tag,
float data)
|
void |
insert(java.lang.String tag,
int data)
Insert "data" into the this cdev.Data object associated with "tag". |
void |
insert(java.lang.String tag,
long data)
|
void |
insert(java.lang.String tag,
java.lang.Object data)
|
void |
insert(java.lang.String tag,
short data)
Insert "data" into the this cdev.Data object associated with "tag". |
static void |
insertKeyPair(int key,
java.lang.String skey)
Insert a key pair into the table. |
void |
remove()
Remove all DataEntry objects from this Data object. |
void |
remove(int key)
Remove the data entry corresponding to a given key. |
void |
remove(java.lang.String key)
Remove the data entry corresponding to a given key. |
java.lang.String |
toString()
Convert the Data object to a formatted string. |
java.lang.String |
toString(java.lang.String title)
Convert the Data object to a string with a given title preceeding the object. |
byte[] |
xdrExport()
|
void |
xdrImport(xdrReader bin)
Populate this Data object from a byte buffer which was written in XDR format. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final short INVALID
public static final short BYTE
public static final short SHORT
public static final short INT
public static final short LONG
public static final short FLOAT
public static final short DOUBLE
public static final short STRING
public static final int MAXTYPE
public static final int VALUE_KEY
Constructor Detail |
public Data()
public Data(xdrReader in) throws java.io.IOException
in
- - An xdrReader object that contains the byte stream.public Data(Data original)
original
- The original Data object to replicate.Method Detail |
public static int convertKey(java.lang.String key)
key
- The String key.public static java.lang.String convertKey(int key)
key
- The integer key.public static void insertKeyPair(int key, java.lang.String skey)
key
- The integer key.skey
- The string key.public static java.lang.Class getClass(int dataType)
public DataEntry getDataEntry(int key) throws java.lang.IllegalArgumentException
key
- The integer key.getDataEntry(int key)
public DataEntry getDataEntry(java.lang.String key)
tag
- The String key.getDataEntry(String key)
public boolean containsKey(int key)
public boolean containsKey(java.lang.String key)
public java.lang.String toString()
public java.lang.String toString(java.lang.String title)
public void addDataEntry(DataEntry entry)
public void remove()
public void remove(int key)
key
- Integer key.public void remove(java.lang.String key)
key
- String key.public void insert(int tag, byte data)
tag
- The tag to associate with the data item.data
- A byte data item.public void insert(int tag, short data)
tag
- The tag to associate with the data item.data
- A short data item.public void insert(int tag, int data)
tag
- The tag to associate with the data item.data
- An int data item to insert.public void insert(int tag, long data)
tag
- The tag to associate with the data item.data
- the data item to insert.public void insert(int tag, float data)
tag
- The tag to associate with the data item.data
- the data item to insert.public void insert(int tag, double data)
tag
- The tag to associate with the data item.data
- the data item to insert.public void insert(int tag, java.lang.Object data)
tag
- The tag to associate with the data item.data
- the data item to insert.public void insert(java.lang.String tag, byte data)
tag
- The string tag name to give the datadata
- The byte datapublic void insert(java.lang.String tag, short data)
tag
- The string tag name to give the datadata
- The short datapublic void insert(java.lang.String tag, int data)
tag
- The string tag name to give the datadata
- The int datapublic void insert(java.lang.String tag, long data)
public void insert(java.lang.String tag, float data)
public void insert(java.lang.String tag, double data)
public void insert(java.lang.String tag, java.lang.Object data)
public void changeKey(int oldkey, int newkey) throws java.lang.IllegalArgumentException
oldtag
- The old tag number.newtag
- The new tag number.public java.lang.Object getValue(int key)
key
- The key of the selected entry.public java.lang.Object getValue(java.lang.String key)
key
- The key of the selected entry.public java.util.Enumeration elements()
public void xdrImport(xdrReader bin) throws java.io.IOException
public byte[] xdrExport()
public int getSize()
public boolean equals(Data other)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public void copyInto(Data dst) throws java.lang.CloneNotSupportedException
dst
- The destination Data. Cannot be null.DataEntry.smartCompareCopy(DataEntry dst)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |