maito.datacollecting
Class Record

java.lang.Object
  extended by maito.datacollecting.Record

public class Record
extends java.lang.Object


Field Summary
static int IDLENGTH
           
static int STMTKEYLEN
           
static int STMTVALLEN
           
 
Constructor Summary
Record(java.lang.String newID)
          Class constructor
 
Method Summary
 void deleteField(java.lang.String fieldKey)
          Deletes the field and all its values.
 boolean equals(Record record)
          Two records are considered the same only if they have the same id.
 java.util.Vector getField(java.lang.String fieldName)
          Gets the value(s) of the field with the specified key.
 java.util.HashSet getFieldNames()
          Returns a list of keys in this record
 java.lang.String getID()
          Gets the ID of this record
 java.lang.String getIntegratedTo()
           
 boolean setField(java.lang.String fieldKey, java.lang.String fieldValue)
          Adds a value to a field.
 void setIntegratedTo(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDLENGTH

public static final int IDLENGTH
See Also:
Constant Field Values

STMTKEYLEN

public static final int STMTKEYLEN
See Also:
Constant Field Values

STMTVALLEN

public static final int STMTVALLEN
See Also:
Constant Field Values
Constructor Detail

Record

public Record(java.lang.String newID)
Class constructor

Parameters:
newID - The ID to be set for the new record, must not be null (In case of null value, ID is assumed to be an empty String)
Method Detail

getFieldNames

public java.util.HashSet getFieldNames()
Returns a list of keys in this record

Returns:
a HashSet of all keys in this Record

getField

public java.util.Vector getField(java.lang.String fieldName)
Gets the value(s) of the field with the specified key. Record keys are Strings and values are Vectors containing Strings

Parameters:
fieldName - The key of the required field
Returns:
The required value, null if field not found

getID

public java.lang.String getID()
Gets the ID of this record

Returns:
The ID of this record

setField

public boolean setField(java.lang.String fieldKey,
                        java.lang.String fieldValue)
Adds a value to a field. If specified key already exists, adds a new String value to the existing Vector, otherwise creates a new one

Parameters:
fieldKey - A key to be inserted or modified, must not be null
fieldValue - A value to be inserted
Returns:
true if value stored, false if there was an error

deleteField

public void deleteField(java.lang.String fieldKey)
Deletes the field and all its values. Use with caution.

Parameters:
fieldKey - the field to be deleted

equals

public boolean equals(Record record)
Two records are considered the same only if they have the same id.

Returns:
true if two records are equal, false if not

setIntegratedTo

public void setIntegratedTo(java.lang.String s)

getIntegratedTo

public java.lang.String getIntegratedTo()
Returns:
empty string if integratedTo is null