uk.ac.man.cs.rainbow.datamodel
Class StringData
java.lang.Object
|
+--uk.ac.man.cs.rainbow.rapa.data.Expression
|
+--uk.ac.man.cs.rainbow.datamodel.Data
|
+--uk.ac.man.cs.rainbow.datamodel.Data.Untyped
|
+--uk.ac.man.cs.rainbow.datamodel.StringData
- All Implemented Interfaces:
- Argument, Data.Comparable, Serializable, Value, VariableContainer
- public final class StringData
- extends Data.Untyped
- implements Serializable, Data.Comparable
Strings as data values.
- See Also:
Data
,
Data.Untyped
, Serialized Form
Methods inherited from class uk.ac.man.cs.rainbow.datamodel.Data |
apply, equals, equals, getResultType, getType, hashCode, hasVariable, main, occurs, parse, parse, subst, typedString, unify |
StringData
public StringData(String contents)
getValue
public String getValue()
toString
public String toString()
- Description copied from class:
Data
- Print the data value.
- Overrides:
toString
in class Data
equals
public boolean equals(Data d)
- Description copied from class:
Data.Untyped
- Standardised equality defined over untyped data values.
Must be implemented by concrete subclasses.
- Overrides:
equals
in class Data.Untyped
compare
public int compare(Data.Comparable d)
throws TypeException
- Description copied from interface:
Data.Comparable
- Check for relative ordering with respect to this object.
- Specified by:
compare
in interface Data.Comparable
- Following copied from interface:
uk.ac.man.cs.rainbow.datamodel.Data.Comparable
- Parameters:
otherComparable
- Comparable object to compare with.- Returns:
- Negative if this object is less, positive if this
object is more, and zero if this object is the same.
Zero should only be returned if
equals
would return
true. - Throws:
TypeException
- If the objects are not of a similar-enough type to compare.