Package adams.data.report
Class SuffixField
- java.lang.Object
-
- adams.data.report.AbstractField
-
- adams.data.report.Field
-
- adams.data.report.SuffixField
-
- All Implemented Interfaces:
CloneHandler<AbstractField>
,RegularField
,SuffixOnlyField
,Serializable
,Comparable
public class SuffixField extends Field implements SuffixOnlyField
A compound filed that only displays the second half of the name.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DUMMY_PREFIX
the dummy prefix.-
Fields inherited from class adams.data.report.AbstractField
m_DataType, m_Name, m_Prefix, m_Suffix, SEPARATOR, SEPARATOR_DISPLAY, SEPARATOR_ESCAPED
-
-
Constructor Summary
Constructors Constructor Description SuffixField()
Constructor.SuffixField(AbstractField field)
Uses the values from the given field.SuffixField(String name, DataType dt)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Compares this object with the specified object for order.AbstractField
newField(String name, DataType dtype)
Returns a new field.static SuffixField
parseField(String s)
Parses the given string and returns the field.String
toDisplayString()
Returns the suffix of the field.String
toString()
Returns the prefix of the field.-
Methods inherited from class adams.data.report.Field
isValid, main, replacePrefix, replaceSuffix
-
Methods inherited from class adams.data.report.AbstractField
equals, escape, fixString, getClone, getDataType, getName, getPrefix, getSuffix, hashCode, isCompound, replacePrefix, replaceSuffix, split, toParseableString, toString, unescape, valueOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.data.report.SuffixOnlyField
getSuffix, isCompound
-
-
-
-
Field Detail
-
DUMMY_PREFIX
public static final String DUMMY_PREFIX
the dummy prefix.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SuffixField
public SuffixField()
Constructor. Sets the name to null and the type to UNKNOWN.
-
SuffixField
public SuffixField(AbstractField field)
Uses the values from the given field.- Parameters:
field
- the field to use as basis
-
-
Method Detail
-
compareTo
public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classAbstractField
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
toString
public String toString()
Returns the prefix of the field.- Overrides:
toString
in classAbstractField
- Returns:
- the prefix
-
toDisplayString
public String toDisplayString()
Returns the suffix of the field.- Overrides:
toDisplayString
in classAbstractField
- Returns:
- the suffix
-
newField
public AbstractField newField(String name, DataType dtype)
Returns a new field.
-
parseField
public static SuffixField parseField(String s)
Parses the given string and returns the field. The type of the field can be append with parentheses: name[type]. Otherwise, UNKNOWN is used as type.- Parameters:
s
- the string to parse- Returns:
- the parsed field
-
-