|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--kom.gateway.KomData
Base class for KOM objects
Field Summary | |
private static int |
ADDKEYANY
|
private static int |
ADDKEYFIRST
|
private static int |
ADDKEYLAST
|
Fields inherited from class java.util.Hashtable |
count,
ENTRIES,
entrySet,
KEYS,
keySet,
loadFactor,
modCount,
serialVersionUID,
table,
threshold,
values,
VALUES |
Constructor Summary | |
KomData()
Basic constructor. |
|
KomData(KomData kd)
Constructor for a copy |
|
KomData(java.lang.String data)
Constructs KomData from String representation |
Method Summary | |
void |
add(java.lang.String key,
java.lang.String value)
Stores a value as a String or as a Vector element, but only if the key and the value are non-null. |
static KomData |
create(java.lang.Object o)
Creates a KomData object from an Object (String or KomData instance) |
private void |
debugLog(java.lang.String s)
|
void |
display()
|
void |
disppriv()
|
private void |
errorLog(java.lang.String s)
|
java.lang.String |
get(java.lang.String key)
Gets a String value |
private void |
getAllData(java.lang.String data)
Parses a String as a KomData representation |
private int |
getBDATA(java.lang.String key,
java.lang.String data,
int beg)
Parses a counted data field |
private int |
getCDATA(java.lang.String key,
java.lang.String data,
int beg)
Parses a LF-delimited data field |
static KomData |
getData(java.lang.String data)
Constructs a KomData object from a String |
static KomData |
getElem(java.util.Vector vec,
int i)
Constructs a KomData object from a String Vector element |
StringList |
getKeyList()
Generator for key names. |
java.lang.String[] |
getKeys()
Gets the key names. |
java.lang.String |
getName()
Gets value of "Cname" |
private int |
getPDATA(java.lang.String key,
java.lang.String data,
int beg)
Parses a space-delimited data field |
(package private) java.lang.String[] |
getStringValues(java.lang.String key)
Gets a String array for a Vector value |
static java.util.Vector |
getStringVector(java.lang.String key,
java.lang.String data)
Constructs a Vector from a String. |
java.util.Vector |
getValues(java.lang.String key)
Gets a (String) Vector value |
void |
init(KomData kd)
Copies another KomData object contents to this |
static boolean |
isEmpty(java.lang.String data)
Is the string empty or null? |
private boolean |
mayput(java.lang.String key,
java.lang.Object value,
int place)
Checks if the key/value pair may be put into the hashtable, and updates "keys" if so. |
void |
normal()
|
void |
publish(java.lang.String orig)
|
void |
put(java.lang.String key,
java.lang.String value)
Stores a String value if both key and value are non-null |
void |
put(java.lang.String key,
java.util.Vector values)
Stores a Vector of (String) values if both key and value are non-null |
private static java.lang.String |
putBDATA(java.lang.String key,
java.lang.String value)
|
private static java.lang.String |
putCDATA(java.lang.String key,
java.lang.String value)
|
static java.lang.String |
putData(java.lang.String key,
java.lang.String value)
Constructs a data field representing the key and value |
void |
putfirst(java.lang.String key,
java.lang.String value)
Stores a value, placing its key first in the "keys" array. |
void |
putid(java.lang.String id)
|
void |
putlast(java.lang.String key,
java.lang.String value)
Stores a value, placing its key last in the "keys" array. |
private static java.lang.String |
putPDATA(java.lang.String key,
java.lang.String value)
|
void |
putValue(KomData kd,
java.lang.String key)
Copies a value from another object |
void |
qput(java.lang.String key,
java.lang.String value)
Stores a value if not null or "" |
java.lang.Object |
remove(java.lang.String key)
Removes a key and its value |
void |
setName(java.lang.String name)
Sets the "Cname" value |
void |
setValue(java.lang.String key,
java.lang.String value)
Sets the value for a non-null key |
java.lang.String |
toString()
Constructs a String representation of this object |
Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsKey,
containsValue,
elements,
entrySet,
equals,
get,
hashCode,
isEmpty,
keys,
keySet,
put,
putAll,
readObject,
rehash,
remove,
size,
values,
writeObject |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final int ADDKEYANY
private static final int ADDKEYFIRST
private static final int ADDKEYLAST
Constructor Detail |
public KomData()
public KomData(KomData kd)
kd
- Object whose contents will be copied into this objectpublic KomData(java.lang.String data)
data
- toString() representation of objectMethod Detail |
public void init(KomData kd)
kd
- KomData objectpublic java.lang.String[] getKeys()
public StringList getKeyList()
private void getAllData(java.lang.String data)
data
- String representing objectpublic static KomData getData(java.lang.String data)
data
- String representationpublic static KomData create(java.lang.Object o)
public static java.util.Vector getStringVector(java.lang.String key, java.lang.String data)
key
- Key value, e g "info*", "cont*".data
- String representationprivate int getBDATA(java.lang.String key, java.lang.String data, int beg)
key
- Field keydata
- Data Stringbeg
- Pos of count (in "key: count value...")private int getCDATA(java.lang.String key, java.lang.String data, int beg)
key
- Field keydata
- Data Stringbeg
- Pos of value (in "key: value\n...")private int getPDATA(java.lang.String key, java.lang.String data, int beg)
key
- Field keydata
- Data Stringbeg
- Pos of value (in "key: value ...")public java.lang.String getName()
public java.lang.String get(java.lang.String key)
key
- Field keypublic java.util.Vector getValues(java.lang.String key)
key
- Field key (ends with a '*' character)java.lang.String[] getStringValues(java.lang.String key)
key
- Field key (ends with a '*' character)public void setName(java.lang.String name)
name
- New valuepublic void setValue(java.lang.String key, java.lang.String value)
key
- Key, ignored if nullvalue
- Stored under key if key != nullpublic void putValue(KomData kd, java.lang.String key)
kd
- Copy value for key from this objectkey
- Key, no effect if nullpublic void qput(java.lang.String key, java.lang.String value)
key
- Field keyvalue
- Value, stored if != null && != ""public java.lang.Object remove(java.lang.String key)
key
- Keypublic void put(java.lang.String key, java.lang.String value)
key
- Field keyvalue
- Stored under key if non-null (and key is non-null)private boolean mayput(java.lang.String key, java.lang.Object value, int place)
key
- Key for valuevalue
- Value (String or Vector)place
- 0 if no order is imposed, -1 if the key should be
put first, +1 if the key should be put last. If necessary, an
existing key is moved.public void put(java.lang.String key, java.util.Vector values)
key
- Field keyvalues
- Stored under key if non-null (and key is non-null)public void putfirst(java.lang.String key, java.lang.String value)
key
- Field key.value
- Value of field, stored if non-null and key != nullpublic void putlast(java.lang.String key, java.lang.String value)
key
- Field key.value
- Value of field, stored if non-null and key != nullpublic void add(java.lang.String key, java.lang.String value)
key
- Field key. If it ends with '*', the value should be placed
in a Vector, otherwise store it as a simple Stringvalue
- String valuepublic java.lang.String toString()
public static KomData getElem(java.util.Vector vec, int i)
vec
- Vector of String representations of KomData objectsi
- Index in vecpublic static java.lang.String putData(java.lang.String key, java.lang.String value)
key
- Field keyvalue
- Value String
Represents the value according to the initial character of the key String:
C: LF-delimited "key: value\n"
P: Space-delimited "key: value "
other: Counted. "key: nn value"private static java.lang.String putBDATA(java.lang.String key, java.lang.String value)
private static java.lang.String putCDATA(java.lang.String key, java.lang.String value)
private static java.lang.String putPDATA(java.lang.String key, java.lang.String value)
public static boolean isEmpty(java.lang.String data)
data
- Stringpublic void publish(java.lang.String orig)
public void putid(java.lang.String id)
public void display()
public void normal()
public void disppriv()
private void debugLog(java.lang.String s)
private void errorLog(java.lang.String s)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |