org.jplate.tabular.impl.defaults
Class DefaultRecord

java.lang.Object
  extended by org.jplate.tabular.impl.defaults.DefaultRecord
All Implemented Interfaces:
RecordIfc

public class DefaultRecord
extends java.lang.Object
implements RecordIfc

Default implementation of RecordIfc.

Modifications:
    $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $
    $Revision: 479 $
    $Author: sfloess $
    $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/tabular/impl/defaults/DefaultRecord.java $
    


Field Summary
private  FieldFactoryIfc _fieldFactory
          Used to create fields.
private  java.util.List<FieldIfc> _fieldList
          Holds all fields that belong to a record.
private  org.apache.commons.logging.Log _log
          Used for logging.
 
Constructor Summary
DefaultRecord()
          Default constructor that uses a UnsynchronizedLinkedListFactory as the list factory.
DefaultRecord(FieldFactoryIfc fieldFactory)
          This constructor sets the listFactory to create a List to hold fields that are logically part of a record.
DefaultRecord(FieldFactoryIfc fieldFactory, ListFactoryIfc<FieldIfc> listFactory)
          This constructor sets the listFactory to create a List to hold fields that are logically part of a record.
DefaultRecord(ListFactoryIfc<FieldIfc> listFactory)
          This constructor sets the listFactory to create a List to hold fields that are logically part of a record.
 
Method Summary
 void addField(FieldIfc field)
          Create a field.
 FieldIfc createField()
           
 java.util.List<FieldIfc> getFields()
          Return the collection of fields.
 boolean removeField(FieldIfc field)
          Remove field.
 void removeFields()
          Removes all fields from the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

private final transient org.apache.commons.logging.Log _log
Used for logging.


_fieldFactory

private final FieldFactoryIfc _fieldFactory
Used to create fields.


_fieldList

private final java.util.List<FieldIfc> _fieldList
Holds all fields that belong to a record.

Constructor Detail

DefaultRecord

public DefaultRecord(FieldFactoryIfc fieldFactory,
                     ListFactoryIfc<FieldIfc> listFactory)
This constructor sets the listFactory to create a List to hold fields that are logically part of a record.

Parameters:
listFactory - Used to create a list to hold associated fields.

DefaultRecord

public DefaultRecord(FieldFactoryIfc fieldFactory)
This constructor sets the listFactory to create a List to hold fields that are logically part of a record.

Parameters:
fieldFactory - Used to create fields.

DefaultRecord

public DefaultRecord(ListFactoryIfc<FieldIfc> listFactory)
This constructor sets the listFactory to create a List to hold fields that are logically part of a record.

Parameters:
listFactory - Used to create a list to hold associated fields.

DefaultRecord

public DefaultRecord()
Default constructor that uses a UnsynchronizedLinkedListFactory as the list factory.

Method Detail

createField

public FieldIfc createField()
Specified by:
createField in interface RecordIfc

removeFields

public void removeFields()
                  throws RemoveException
Removes all fields from the record.

Specified by:
removeFields in interface RecordIfc
Throws:
RemoveException - if any issues arise removing field.

removeField

public boolean removeField(FieldIfc field)
                    throws RemoveException
Remove field.

Specified by:
removeField in interface RecordIfc
Parameters:
field - The field to remove.
Returns:
true if field was removed or false if not.
Throws:
RemoveException - if any issues arise removing field.

addField

public void addField(FieldIfc field)
              throws AddException
Create a field.

Specified by:
addField in interface RecordIfc
Parameters:
field - tThe field to add.
Throws:
AddException - if any issues arise adding a field.

getFields

public java.util.List<FieldIfc> getFields()
Return the collection of fields.

Specified by:
getFields in interface RecordIfc
Returns:
the collection of fields.