public abstract class Result extends AnnotatedEntity
Parameter
classes, the Result
classes provide
the possibility to return the results of a computation together with some
annotation in a standardized way.comment, datatype, name
Modifier | Constructor and Description |
---|---|
protected |
Result(StringBuffer rep)
The standard constructor for the interface
Storable . |
protected |
Result(String name,
String comment,
DataType datatype)
The main constructor which takes the main information of a result.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendFurtherInfos(StringBuffer buf)
This method can be used in the method
Storable.toXML() to extract
further information (name, comment, datatype). |
static boolean |
checkDatatype(DataType datatype,
Object value)
|
static Result |
createResult(String name,
String comment,
DataType datatype,
Object value)
Factory method to create a new
Result . |
protected void |
extractFurtherInfos(StringBuffer buf)
This method can be used in the constructor with parameter
StringBuffer to
extract the further information. |
String |
getOriginalName()
Returns the original name (i.e., the name upon object creation) of this
Result ,
which may be just the name if rename(String) has not been called on this object, yet. |
boolean |
isCastableResult(Result test)
|
boolean |
isComparableResult(Result test)
Returns
true if the Result test and the
current object have the same data type, name and comment for the result. |
void |
rename(String newName)
Renames this Result.
|
getComment, getDatatype, getName, getValue, getXMLTag, toXML
protected Result(String name, String comment, DataType datatype)
name
- the name of the resultcomment
- the comment for the resultdatatype
- the data type of the resultprotected Result(StringBuffer rep) throws NonParsableException
Storable
. Creates a
new Result
out of its XML representation.rep
- the XML representation as StringBuffer
NonParsableException
- if the XML representation is not parsableStorable
public boolean isComparableResult(Result test)
true
if the Result
test
and the
current object have the same data type, name and comment for the result.
AnnotatedEntity.getValue()
returns an instance of Comparable
.public boolean isCastableResult(Result test)
true
if the data type of the Result
test
can be casted to that of this instance and both have
the same name and comment for the Result
.
AnnotatedEntity.getValue()
returns an instance of Comparable
.public static Result createResult(String name, String comment, DataType datatype, Object value) throws SimpleParameter.IllegalValueException
Result
.name
- the name of the Result
as chosen by the usercomment
- the comment on the Result
as chosen by the userdatatype
- the data type of value
value
- the value of the Result
Result
instanceSimpleParameter.IllegalValueException
- if datatype
is DataType.HTML
,
DataType.LIST
or another DataType
not
implemented, yetpublic void rename(String newName)
getOriginalName()
.newName
- the new namepublic String getOriginalName()
Result
,
which may be just the name if rename(String)
has not been called on this object, yet.protected void appendFurtherInfos(StringBuffer buf)
AnnotatedEntity
Storable.toXML()
to extract
further information (name, comment, datatype).appendFurtherInfos
in class AnnotatedEntity
buf
- a XML representation of the main information as
StringBuffer
Storable.toXML()
protected void extractFurtherInfos(StringBuffer buf) throws NonParsableException
AnnotatedEntity
StringBuffer
to
extract the further information.extractFurtherInfos
in class AnnotatedEntity
buf
- a XML represenation of the main information as
StringBuffer
NonParsableException
- if the XML representation is not parsableAnnotatedEntity.AnnotatedEntity(StringBuffer)