|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.AnnotatedEntity
de.jstacs.results.Result
public abstract class Result
The abstract class for any result. Each result should be immutable. In
analogy to the Parameter classes, the Result classes provide
the possibility to return the results of a computation together with some
annotation in a standardized way.
| Field Summary |
|---|
| Fields inherited from class de.jstacs.AnnotatedEntity |
|---|
comment, datatype, name |
| Constructor Summary | |
|---|---|
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. |
| Method Summary | |
|---|---|
static boolean |
checkDatatype(DataType datatype,
Object value)
This method provides the possibility to check the compliance of some result value with one of the pre-defined DataTypes
before creating a new Result and possibly running into an
Exception. |
static Result |
createResult(String name,
String comment,
DataType datatype,
Object value)
Factory method to create a new Result. |
boolean |
isCastableResult(Result test)
Returns 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. |
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. |
| Methods inherited from class de.jstacs.AnnotatedEntity |
|---|
appendFurtherInfos, extractFurtherInfos, getComment, getDatatype, getName, getValue, getXMLTag, toXML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Result(String name,
String comment,
DataType datatype)
name - the name of the resultcomment - the comment for the resultdatatype - the data type of the result
protected 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| Method Detail |
|---|
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.
test - the Result to be tested
true if the Result test and the
current object have the same data type, name and comment for the
resultpublic 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.
test - the Result to be tested
true if the Result test and the
current object have a castable data type, name and comment for
the result
public static boolean checkDatatype(DataType datatype,
Object value)
value with one of the pre-defined DataTypes
before creating a new Result and possibly running into an
Exception.
datatype - the data type the value should comply tovalue - the value
value can be stored in a Result of
DataType datatype
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 valuevalue - the value of the Result
Result instance
SimpleParameter.IllegalValueException - if datatype is DataType.HTML,
DataType.LIST or another DataType not
implemented, yet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||