|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bankframe.bo.DataPacket
public class DataPacket
The DataPacket class. This class is used to store data. Each element in the DataPacket is held and located through a string key. The DataPacket can hold any object instance.
Field Summary | |
---|---|
static String |
DATA_PACKET_NAME
An ease-of-use constant for specifing the DataPacket's string name. |
static String |
OWNER
An ease-of-use constant for specifing the DataPacket's owner. |
static String |
REQUEST_ID
An ease-of-use constant for specifing the DataPacket's request_id. |
Constructor Summary | |
---|---|
DataPacket()
The default class constructor. |
|
DataPacket(String name)
The class constructor. |
Method Summary | |
---|---|
static DataPacket |
append(DataPacket data,
DataPacket dataToAppend)
This method adds a datapacket's contents to another datapacket. |
void |
clear()
This method clears this datapacket so that it contains no keys. |
boolean |
contains(Object value)
This method tests if some key maps into the specified value in the datapacket. |
boolean |
containsKey(Object key)
This method tests if the specified object is a key in this datapacket. |
Enumeration |
elements()
This method returns an enumeration of the values in this datapacket. |
boolean |
equals(Object o)
This method tests if the DataPacket is equal to another DataPacket |
Object |
get(Object key)
This method returns the value to which the specified key is mapped in this datapacket. |
String |
getName()
This method returns the string name of the data packet. |
String |
getString(Object key)
This method returns the value to which the specified key is mapped in this datapacket. |
int |
hashCode()
This method calculates the hash-code for the DataPacket |
boolean |
isEmpty()
This method tests if this datapacket maps no keys to values. |
Enumeration |
keys()
This method returns an enumeration of the keys in this datapacket. |
Object |
put(String key,
Object value)
This method provides a put that requires data keys to be strings. |
Object |
remove(Object key)
This method removes the key and its corresponding value from this datapacket. |
void |
setName(String name)
This method sets the name of the data packet. |
int |
size()
This method returns the number of keys in this datapacket. |
Vector |
toList(boolean print)
This method returns the contents of this instance of the DataPacket class in a vector, where each element in the vector is a string in the format: 'key=value'. |
void |
toListInOrder(String[] order)
This method prints the contents of this instance to the system console. |
String |
toString()
Represents the object as a string. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DATA_PACKET_NAME
public static final String REQUEST_ID
public static final String OWNER
Constructor Detail |
---|
public DataPacket()
public DataPacket(String name)
name
- the string name of this instance.Method Detail |
---|
public boolean equals(Object o)
equals
in class Object
o
- is the other DataPacket to compare
public int hashCode()
hashCode
in class Object
public static DataPacket append(DataPacket data, DataPacket dataToAppend)
data
- com.bankframe.bo.DataPacketdataToAppend
- com.bankframe.bo.DataPacket
public void clear()
public boolean contains(Object value)
value
- java.lang.Object the value to search for in the datapacket
public boolean containsKey(Object key)
key
- java.lang.Object the key to search for in the datapacket
public Enumeration elements()
public Object get(Object key)
key
- java.lang.Object the key to retrieve from the datapacket
public String getName()
public String getString(Object key)
key
- java.lang.String
public boolean isEmpty()
public Enumeration keys()
public Object put(String key, Object value)
key
- the string key.value
- the object to be stored.
public Object remove(Object key)
key
- the key that needs to be removed.
public void setName(String name)
name
- the string name of this instance.public int size()
public Vector toList(boolean print)
print
- the contents of this instance to the system out console.
public void toListInOrder(String[] order)
order
- the string array order for printing this instance's contents.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |