gov.sandia.cognition.text.document
Class DefaultTextField

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.util.AbstractNamed
          extended by gov.sandia.cognition.text.document.AbstractField
              extended by gov.sandia.cognition.text.document.DefaultTextField
All Implemented Interfaces:
Field, Textual, CloneableSerializable, Named, Serializable, Cloneable

public class DefaultTextField
extends AbstractField

A default implementation of the Field interface. It stores the text of the field as a String.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
static String DEFAULT_NAME
          The default name for the field is the empty string.
protected  String text
          The text content of the field.
 
Fields inherited from class gov.sandia.cognition.util.AbstractNamed
name
 
Constructor Summary
DefaultTextField()
          Creates a new DefaultTextField with default name and text, both of which are the empty string.
DefaultTextField(String name, String text)
          Creates a new DefaultTextField with the given name and text.
 
Method Summary
 String getText()
          Gets the full text of the field.
 void setText(String text)
          Sets the text content for the field.
 
Methods inherited from class gov.sandia.cognition.text.document.AbstractField
readText, toString
 
Methods inherited from class gov.sandia.cognition.util.AbstractNamed
clone, getName, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.text.document.Field
getName
 

Field Detail

DEFAULT_NAME

public static final String DEFAULT_NAME
The default name for the field is the empty string.

See Also:
Constant Field Values

text

protected String text
The text content of the field.

Constructor Detail

DefaultTextField

public DefaultTextField()
Creates a new DefaultTextField with default name and text, both of which are the empty string.


DefaultTextField

public DefaultTextField(String name,
                        String text)
Creates a new DefaultTextField with the given name and text.

Parameters:
name - The name of the field.
text - The text content for the field.
Method Detail

getText

public String getText()
Description copied from interface: Field
Gets the full text of the field.

Returns:
The full text of the field.

setText

public void setText(String text)
Sets the text content for the field.

Parameters:
text - The text content for the field.