COM.FutureTense.Interfaces
Class FTValList

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byCOM.FutureTense.Interfaces.FTValList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class FTValList
extends java.util.Hashtable

ContentServer interfaces

Yes, this object isn't an interface but it helps.

$Revision: 41 $

See Also:
Serialized Form

Constructor Summary
FTValList()
           
FTValList(int sz)
           
 
Method Summary
 java.util.Enumeration alphaSortedKeys()
          Thread safe way to access items sorted keys().
 FTValList copy()
          Create a new FTValList which is a copy of this list.
 int count()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(java.lang.Object key)
          Return the data regardless of type
 FTVAL getVal(java.lang.String key)
          Get a FTVAL from a key name
 byte[] getValBLOB(java.lang.String key)
          Get byte[] from key
 int getValBLOBSize(java.lang.String key)
          Get the size of blob data - 0 returned if not a blob
 int getValInt(java.lang.String key)
          Get an int value from a key
 java.lang.String getValString(java.lang.String key)
          Get a string from a key
 java.util.Enumeration keys()
          Thread safe way to access items keys().
 java.util.Vector keysVector()
          Thread safe way to access items keys().
 int parse(java.lang.String inputParam)
          Convert a string of form "a=b&c=d&..." to an FTValList set of name/value pairs Note - will add new and/or replace existing data.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associates a value with a specified key.
 java.lang.Object remove(java.lang.Object key)
          Remove an object from the map and return the old object or null
 void removeAll()
          Remove all items in this list
 int removeVal(java.lang.String key)
          Remove a name/value pair
 int setVal(java.lang.String key, FTVAL val)
          Set a USERDATA typed object to a key name
 int setVal(java.lang.String key, int type, java.lang.Object data)
          Set a typed object to a key name
 int setValBLOB(java.lang.String key, byte[] b)
          Store binary data by key name
 int setValBLOB(java.lang.String key, byte[] b, int sz)
          Store binary data by key name
 int setValBLOBFile(java.lang.String key, java.lang.String fname)
          Store binary data by key name
 int setValInt(java.lang.String key, int i)
          Set an integer with a key
 int setValString(java.lang.String key, java.lang.String val)
          Set a string by key name
 java.util.Enumeration sortedKeys()
          Thread safe way to access items sorted keys().
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, hashCode, isEmpty, keySet, putAll, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FTValList

public FTValList()

FTValList

public FTValList(int sz)
Method Detail

equals

public boolean equals(java.lang.Object o)

count

public final int count()
Returns:
number of elements in list

keys

public java.util.Enumeration keys()
Thread safe way to access items keys(). Returns enumeration

Returns:
Enumeration of key names

sortedKeys

public java.util.Enumeration sortedKeys()
Thread safe way to access items sorted keys(). Returns enumeration

Returns:
Enumeration of key names, sorted longest to shortest

alphaSortedKeys

public java.util.Enumeration alphaSortedKeys()
Thread safe way to access items sorted keys(). Returns enumeration

Returns:
Enumeration of key names, sorted alphanumerically

keysVector

public java.util.Vector keysVector()
Thread safe way to access items keys().

Returns:
Vector of key names

getVal

public FTVAL getVal(java.lang.String key)
Get a FTVAL from a key name

Parameters:
key -
Returns:
FTVAL object

put

public final java.lang.Object put(java.lang.Object key,
                                  java.lang.Object value)
Associates a value with a specified key.

Parameters:
key - key with which the value is to be associated.
value - value to be associated with the key.
Returns:
previous value associated with key or null
Since:
4.0

setVal

public int setVal(java.lang.String key,
                  FTVAL val)
Set a USERDATA typed object to a key name

Parameters:
key - keyname
val - value to set
Returns:
0 on success

Useful when the type is unknown


setVal

public int setVal(java.lang.String key,
                  int type,
                  java.lang.Object data)
Set a typed object to a key name

Parameters:
key - keyname
type - (one of the FTVAL enums)
data -
Returns:
0 on success

removeAll

public void removeAll()
Remove all items in this list


removeVal

public int removeVal(java.lang.String key)
Remove a name/value pair

Parameters:
key - keyname
Returns:
0 on success

getValInt

public int getValInt(java.lang.String key)
Get an int value from a key

Parameters:
key - keyname
Returns:
0 if not found (NAS compatability!)

setValInt

public int setValInt(java.lang.String key,
                     int i)
Set an integer with a key

Parameters:
key - keyname
i - value
Returns:
0 on success

get

public java.lang.Object get(java.lang.Object key)
Return the data regardless of type

Parameters:
key -
Returns:
value
Since:
4.0

remove

public java.lang.Object remove(java.lang.Object key)
Remove an object from the map and return the old object or null

Parameters:
key - to remove
Returns:
previous value
Since:
4.0

getValString

public java.lang.String getValString(java.lang.String key)
Get a string from a key

Parameters:
key -
Returns:
string value or null

setValString

public int setValString(java.lang.String key,
                        java.lang.String val)
Set a string by key name

Parameters:
key - keyname
val - value
Returns:
0 on success

getValBLOB

public byte[] getValBLOB(java.lang.String key)
Get byte[] from key

Parameters:
key - keyname
Returns:
byte[] or null

getValBLOBSize

public int getValBLOBSize(java.lang.String key)
Get the size of blob data - 0 returned if not a blob

Parameters:
key - key
Returns:
size - might be 0 if wrong type

setValBLOBFile

public final int setValBLOBFile(java.lang.String key,
                                java.lang.String fname)
Store binary data by key name

Parameters:
key - keyname
fname - current disk file name
Returns:
0 on success

setValBLOB

public final int setValBLOB(java.lang.String key,
                            byte[] b)
Store binary data by key name

Parameters:
key - keyname
b - array of bytes
Returns:
0 on success
Since:
5.0

setValBLOB

public final int setValBLOB(java.lang.String key,
                            byte[] b,
                            int sz)
Store binary data by key name

Parameters:
key - keyname
b - array of bytes
sz - size
Returns:
0 on success

copy

public final FTValList copy()
Create a new FTValList which is a copy of this list. The copy is shallow, the items themselves remain used by the original vallist

Returns:
FTVaList

parse

public int parse(java.lang.String inputParam)
Convert a string of form "a=b&c=d&..." to an FTValList set of name/value pairs Note - will add new and/or replace existing data.