planetj.database.field
Class FieldSetCollection

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byplanetj.database.field.FieldSetCollection
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.util.Map, java.io.Serializable

public class FieldSetCollection
extends java.util.HashMap
implements java.lang.Comparable, java.lang.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(java.util.List pFS)
          Creates a FielsSetCollection using a list of fields sets.
FieldSetCollection(java.util.List pFieldNameSets, Row pRow)
          Gets a List containing FieldSet objects.
FieldSetCollection(Row pRow)
           
FieldSetCollection(java.lang.String pName)
           
 
Method Summary
 FieldSet addFieldSet(FieldSet pFS)
          Adds a new FieldSet to this FieldSetCollection, replacing any previous FieldSet with the same name
 java.lang.Object clone()
          Clone of FieldSetCollection.
 int compareTo(FieldSetCollection pFS)
          Compares this FieldSetCollection with another by examining their names.
 int compareTo(java.lang.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(java.lang.String pName)
          Compares the name of this FieldSetCollection with a String.
 boolean containsFieldSet(java.lang.String pName)
           
 boolean displayHeaderRow()
          True if header should be displayed.
 boolean displayHeaderRowAsLegend()
          True if header should be displayed.
 java.lang.Object get(java.lang.Object pKey)
           
 java.util.Set getAllFields()
          Gets a Set containing all the fields in all of the field sets that have been set on this FieldSetCollection.
 java.util.List getAllFieldSetNames()
          Gets a List containing the names of all the field sets that have been set on this FieldSetCollection.
 FieldSet getFieldSet(java.lang.String pName)
          Gets the FieldSet with the specified name
 FieldSetCollection getFieldSetCollectionForGivenFields(java.util.List pFieldNames, boolean pShowEmpty)
          Get a FieldSetCollection that contains only fields sets that contain the given fields.
 java.util.List getFieldSets()
          Gets a List containing all of the field sets.
 java.lang.String getName()
          Gets the name of this FieldSetCollection.
 java.util.Iterator iterator()
          Gets an Iterator for this FieldSetCollection.
 java.lang.Object put(java.lang.Object pKey, java.lang.Object pValue)
           
 java.lang.Object remove(java.lang.Object pKey)
          Removes a FieldSet object to this FieldSetCollection
 java.lang.Object remove(java.lang.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(java.lang.String newName)
          Sets the name of this FieldSetCollection.
 java.lang.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
finalize, 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(java.lang.String pName)

FieldSetCollection

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


FieldSetCollection

public FieldSetCollection(java.util.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 java.lang.Object clone()
Clone of FieldSetCollection.


compareTo

public int compareTo(java.lang.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 java.lang.Comparable

compareTo

public int compareTo(java.lang.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(java.lang.String pName)

displayHeaderRow

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


displayHeaderRowAsLegend

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


get

public java.lang.Object get(java.lang.Object pKey)
Specified by:
get in interface java.util.Map

getAllFields

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


getAllFieldSetNames

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


getFieldSet

public FieldSet getFieldSet(java.lang.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(java.util.List pFieldNames,
                                                              boolean pShowEmpty)
                                                       throws CMException
Get a FieldSetCollection that contains only fields sets that contain the given fields.

Throws:
CMException

getFieldSets

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


getName

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


iterator

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


put

public java.lang.Object put(java.lang.Object pKey,
                            java.lang.Object pValue)
Specified by:
put in interface java.util.Map

remove

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

Specified by:
remove in interface java.util.Map

remove

public java.lang.Object remove(java.lang.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(java.lang.String newName)
Sets the name of this FieldSetCollection.


toString

public java.lang.String toString()