planetj.database.field
Class FieldSetCollection

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--planetj.database.field.FieldSetCollection
All Implemented Interfaces:
Cloneable, Comparable, Map, Serializable

public class FieldSetCollection
extends HashMap
implements Comparable, Cloneable

Contains any number of related FieldSet objects. Subclasses must provide a default constructor.

See Also:
Serialized Form

Constructor Summary
FieldSetCollection()
           
FieldSetCollection(int initialCapacity)
           
FieldSetCollection(List pFS)
          Creates a FielsSetCollection using a list of fields sets.
FieldSetCollection(List pFieldNameSets, Row pRow)
          Gets a List containing FieldSet objects.
FieldSetCollection(Row pRow)
           
FieldSetCollection(String pName)
           
 
Method Summary
 FieldSet addFieldSet(FieldSet pFS)
          Adds a new FieldSet to this FieldSetCollection, replacing any previous FieldSet with the same name
 Object clone()
          Clone of FieldSetCollection.
 int compareTo(FieldSetCollection pFS)
          Compares this FieldSetCollection with another by examining their names.
 int compareTo(Object o)
          Compares this FieldSetCollection with another by examining their names, or compares this FieldSetCollection to a String (in this case this FieldSetCollection's name is compared with the String).
 int compareTo(String pName)
          Compares the name of this FieldSetCollection with a String.
 boolean containsFieldSet(String pName)
           
 boolean displayHeaderRow()
          True if header should be displayed.
 boolean displayHeaderRowAsLegend()
          True if header should be displayed.
 Object get(Object pKey)
           
 Set getAllFields()
          Gets a List containing the names of all the fields in all of the field sets that have been set on this FieldSetCollection.
 List getAllFieldSetNames()
          Gets a List containing the names of all the field sets that have been set on this FieldSetCollection.
 FieldSet getFieldSet(String pName)
          Gets the FieldSet with the specified name
 FieldSetCollection getFieldSetCollectionForGivenFields(List pFieldNames, boolean pShowEmpty)
          Get a FieldSetCollection that contains only fields sets that contain the given fields.
 List getFieldSets()
          Gets a List containing all of the field sets.
 String getName()
          Gets the name of this FieldSetCollection.
 Iterator iterator()
          Gets an Iterator for this FieldSetCollection.
 Object put(Object pKey, Object pValue)
           
 Object remove(Object pKey)
          Removes a FieldSet object to this FieldSetCollection
 Object remove(String pName)
          Removes a FieldSet object to this FieldSetCollection
 FieldSet removeFieldSet(FieldSet pFS)
          Removes a FieldSet object to this FieldSetCollection
 void setDisplayHeaderRow(boolean display)
          Set header to display.
 void setDisplayHeaderRowAsLegend(boolean isLegend)
          Set header to display.
 void setName(String newName)
          Sets the name of this FieldSetCollection.
 String toString()
           
 
Methods inherited from class java.util.HashMap
clear, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

FieldSetCollection

public FieldSetCollection()

FieldSetCollection

public FieldSetCollection(int initialCapacity)
Parameters:
initialCapacity - int

FieldSetCollection

public FieldSetCollection(String pName)

FieldSetCollection

public FieldSetCollection(List pFS)
Creates a FielsSetCollection using a list of fields sets.


FieldSetCollection

public FieldSetCollection(List pFieldNameSets,
                          Row pRow)
                   throws CMException
Gets a List containing FieldSet objects. Each FieldSet object contains the Field objects corresponding to the fields which are in the Row, and whose names are in the FieldSet passed in to this method.


FieldSetCollection

public FieldSetCollection(Row pRow)
                   throws CMException
Method Detail

addFieldSet

public FieldSet addFieldSet(FieldSet pFS)
Adds a new FieldSet to this FieldSetCollection, replacing any previous FieldSet with the same name

Returns:
The FieldSet that was replaced, or null if there was no such FieldSet

clone

public Object clone()
Clone of FieldSetCollection.

Overrides:
clone in class HashMap

compareTo

public int compareTo(Object o)
Compares this FieldSetCollection with another by examining their names, or compares this FieldSetCollection to a String (in this case this FieldSetCollection's name is compared with the String).

Specified by:
compareTo in interface Comparable

compareTo

public int compareTo(String pName)
Compares the name of this FieldSetCollection with a String. Do not delete this method.


compareTo

public int compareTo(FieldSetCollection pFS)
Compares this FieldSetCollection with another by examining their names.


containsFieldSet

public boolean containsFieldSet(String pName)

displayHeaderRow

public boolean displayHeaderRow()
True if header should be displayed.


displayHeaderRowAsLegend

public boolean displayHeaderRowAsLegend()
True if header should be displayed.


get

public Object get(Object pKey)
Specified by:
get in interface Map
Overrides:
get in class HashMap

getAllFields

public Set getAllFields()
Gets a List containing the names of all the fields in all of the field sets that have been set on this FieldSetCollection.


getAllFieldSetNames

public List getAllFieldSetNames()
Gets a List containing the names of all the field sets that have been set on this FieldSetCollection.


getFieldSet

public FieldSet getFieldSet(String pName)
Gets the FieldSet with the specified name

Returns:
The FieldSet with the specified name, or null if there was no such FieldSet

getFieldSetCollectionForGivenFields

public FieldSetCollection getFieldSetCollectionForGivenFields(List pFieldNames,
                                                              boolean pShowEmpty)
                                                       throws CMException
Get a FieldSetCollection that contains only fields sets that contain the given fields.

CMException

getFieldSets

public List getFieldSets()
Gets a List containing all of the field sets.


getName

public String getName()
Gets the name of this FieldSetCollection.


iterator

public Iterator iterator()
Gets an Iterator for this FieldSetCollection. Uses the list of field sets to maintain order.


put

public Object put(Object pKey,
                  Object pValue)
Specified by:
put in interface Map
Overrides:
put in class HashMap

remove

public Object remove(Object pKey)
Removes a FieldSet object to this FieldSetCollection

Specified by:
remove in interface Map
Overrides:
remove in class HashMap

remove

public Object remove(String pName)
Removes a FieldSet object to this FieldSetCollection


removeFieldSet

public FieldSet removeFieldSet(FieldSet pFS)
Removes a FieldSet object to this FieldSetCollection


setDisplayHeaderRow

public void setDisplayHeaderRow(boolean display)
Set header to display.


setDisplayHeaderRowAsLegend

public void setDisplayHeaderRowAsLegend(boolean isLegend)
Set header to display.


setName

public void setName(String newName)
Sets the name of this FieldSetCollection.


toString

public String toString()
Overrides:
toString in class AbstractMap