wt.fc
Class WTStringSet

java.lang.Object
  extended bywt.fc.WTStringSet
All Implemented Interfaces:
Externalizable, Serializable

public class WTStringSet
extends Object
implements Externalizable

This class represents sets of strings that are represented in the database as a comma separated list of the strings it contains.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  boolean dirty
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private)  Hashtable stringTable
           
private  String value
           
 
Constructor Summary
WTStringSet()
          No arg constructor.
WTStringSet(String value)
          Constructor that takes a comma separated string as argument.
 
Method Summary
 void add(String element)
          Adds a new element to set.
 boolean contains(String element)
          Determines if element belongs to set.
 Enumeration elements()
          Returns an enumeration with the elements of the set.
 boolean equals(Object obj)
          Determines whether the set is equal to the one passed as parameter.
protected  String getValue()
          Gets the value of the attribute: value; Comma separated list that represents the set internally.
 int hashCode()
          Returns hash code.
 boolean includes(WTStringSet set)
          Determines if the set includes the set passed as argument.
 WTStringSet intersection(WTStringSet set)
          Subtracts from the set all elements that don't belong to the set passed as argument.
 boolean isEmpty()
          Determines whether set is empty.
 WTStringSet minus(WTStringSet set)
          Subtracts from the set all elements of the set passed as argument.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(WTStringSet thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void remove(String element)
          Adds a new element to set.
private  void setStringValue()
           
protected  void setTable()
           
protected  void setValue(String a_Value)
          Sets the value of the attribute: value; Comma separated list that represents the set internally.
 int size()
          Returns the number of elements in the set.
 String toString()
          Returns internal representation of the set.
 WTStringSet union(WTStringSet set)
          Adds to the set all elements of the set passed as argument.
private  void valueValidate(String a_Value)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

value

private String value

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

stringTable

Hashtable stringTable

dirty

private boolean dirty
Constructor Detail

WTStringSet

public WTStringSet()
No arg constructor.

Supported API: false


WTStringSet

public WTStringSet(String value)
            throws DatastoreException
Constructor that takes a comma separated string as argument.

Supported API: false

Parameters:
value -
Throws:
DatastoreException
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WTStringSet thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getValue

protected String getValue()
Gets the value of the attribute: value; Comma separated list that represents the set internally.

Supported API: false

Returns:
String

setValue

protected void setValue(String a_Value)
                 throws WTPropertyVetoException
Sets the value of the attribute: value; Comma separated list that represents the set internally.

Supported API: false

Parameters:
a_Value -
Throws:
WTPropertyVetoException

valueValidate

private void valueValidate(String a_Value)
                    throws WTPropertyVetoException
Parameters:
a_Value -
Throws:
WTPropertyVetoException

add

public void add(String element)
         throws WTException
Adds a new element to set. Nothing happens is element already belongs to set. May throw exception if total length of internal string is greater than what can be stored in the database.

Supported API: false

Parameters:
element -
Throws:
WTException

remove

public void remove(String element)
            throws WTException
Adds a new element to set. Nothing happens is element already doesn't belong to set.

Supported API: false

Parameters:
element -
Throws:
WTException

contains

public boolean contains(String element)
Determines if element belongs to set. Returns 'true' if it belongs and 'false' otherwise.

Supported API: false

Parameters:
element -
Returns:
boolean

isEmpty

public boolean isEmpty()
Determines whether set is empty. Returns 'true' if set is empty; false otherwise.

Supported API: false

Returns:
boolean

size

public int size()
Returns the number of elements in the set.

Supported API: false

Returns:
int

elements

public Enumeration elements()
Returns an enumeration with the elements of the set.

Supported API: false

Returns:
Enumeration

toString

public String toString()
Returns internal representation of the set.

Supported API: false

Returns:
String

equals

public boolean equals(Object obj)
Determines whether the set is equal to the one passed as parameter. Returns true if this is the case and false otherwise. Two sets are equal if they have the same elements.

Supported API: false

Parameters:
obj -
Returns:
boolean

includes

public boolean includes(WTStringSet set)
Determines if the set includes the set passed as argument. Returns true if this is the case and false otherwise.

Supported API: false

Parameters:
set -
Returns:
boolean

union

public WTStringSet union(WTStringSet set)
                  throws WTException
Adds to the set all elements of the set passed as argument. Returns itself.

Supported API: false

Parameters:
set -
Returns:
WTStringSet
Throws:
WTException

minus

public WTStringSet minus(WTStringSet set)
                  throws WTException
Subtracts from the set all elements of the set passed as argument. Returns itself.

Supported API: false

Parameters:
set -
Returns:
WTStringSet
Throws:
WTException

intersection

public WTStringSet intersection(WTStringSet set)
                         throws WTException
Subtracts from the set all elements that don't belong to the set passed as argument. Returns itself.

Supported API: false

Parameters:
set -
Returns:
WTStringSet
Throws:
WTException

hashCode

public int hashCode()
Returns hash code.

Supported API: false

Returns:
int

setTable

protected void setTable()

setStringValue

private void setStringValue()