org.opentox.toxotis.core.component
Class Parameter<T>

java.lang.Object
  extended by org.opentox.toxotis.core.OTComponent<Parameter<T>>
      extended by org.opentox.toxotis.core.component.Parameter<T>
Type Parameters:
T - Datatype of the parameter's value.
All Implemented Interfaces:
Serializable, IHTMLSupport, IOTComponent, IStAXWritable

public class Parameter<T>
extends OTComponent<Parameter<T>>
implements IHTMLSupport

A parameter of an Algorithm characterized by its name, value and scope. Being an OpenTox component it is also described by a set of meta information.

Author:
Pantelis Sopasakis, Charalampos Chomenides
See Also:
Serialized Form

Nested Class Summary
static class Parameter.ParameterScope
          The scope of the parameter of an Algorithm that can either be Mandatory or Optional.
 
Field Summary
 
Fields inherited from class org.opentox.toxotis.core.OTComponent
meta, RDF_ABOUT, RDF_RDF, RDF_RESOURCE, RDF_TYPE
 
Constructor Summary
Parameter()
           
Parameter(String name, LiteralValue value)
           
Parameter(VRI uri)
           
Parameter(VRI uri, String name, LiteralValue value)
           
 
Method Summary
 com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
          The OpenTox component as an individual.
 void endowUri(VRI baseUri)
           
 boolean equals(Object obj)
           
 LiteralValue getName()
          Is a proxy method for getting the dc:title of the Parameter (if any).
 Parameter.ParameterScope getScope()
           
 com.hp.hpl.jena.datatypes.xsd.XSDDatatype getType()
           
 LiteralValue<T> getTypedValue()
           
 T getValue()
           
 int hashCode()
           
 HTMLContainer inHtml()
          Create an HTML container for the online resource.
 Parameter setName(String name)
           
 Parameter<T> setScope(Parameter.ParameterScope scope)
           
 void setTypedValue(LiteralValue<T> value)
           
 String toString()
           
 void writeRdf(XMLStreamWriter writer)
          Due to the large size of some objects like datasets, it is advisable to use this method for serializing large objects to RDF/XML rather than the method OntModel#write(OutputStream).
 
Methods inherited from class org.opentox.toxotis.core.OTComponent
addOntologicalClasses, asOntModel, endRdfWriter, getMeta, getOntologicalClasses, getUri, initRdfWriter, isEnabled, setEnabled, setMeta, setOntologicalClasses, setUri, writeAnnotationProperty, writeClass, writeDatatypeProperty, writeMetaDataProperties, writeObjectProperty, writeRdf, writeRdf, writeSuperClassRelationships
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter()

Parameter

public Parameter(VRI uri)

Parameter

public Parameter(String name,
                 LiteralValue value)

Parameter

public Parameter(VRI uri,
                 String name,
                 LiteralValue value)
Method Detail

endowUri

public void endowUri(VRI baseUri)

writeRdf

public void writeRdf(XMLStreamWriter writer)
              throws XMLStreamException
Description copied from interface: IStAXWritable
Due to the large size of some objects like datasets, it is advisable to use this method for serializing large objects to RDF/XML rather than the method OntModel#write(OutputStream). In the case of Datasets, it has been shown that this method performs much faster (about 7,5 times faster on a dataset of 21 features and 1000 compounds).

Specified by:
writeRdf in interface IStAXWritable
Parameters:
writer - XML Stream Writer used for the serialization of the dataset object.
Throws:
XMLStreamException - In case the serialization is not possible due to syntax errors.

inHtml

public HTMLContainer inHtml()
Description copied from interface: IHTMLSupport
Create an HTML container for the online resource.

Specified by:
inHtml in interface IHTMLSupport
Returns:
HTMLContainer which can be used to create an HTML representation for the component.

getScope

public Parameter.ParameterScope getScope()

setScope

public Parameter<T> setScope(Parameter.ParameterScope scope)

getType

public com.hp.hpl.jena.datatypes.xsd.XSDDatatype getType()

getValue

public T getValue()

setTypedValue

public void setTypedValue(LiteralValue<T> value)

getTypedValue

public LiteralValue<T> getTypedValue()

getName

public LiteralValue getName()
Is a proxy method for getting the dc:title of the Parameter (if any).

Returns:
Returns the title (name) of this parameter or null if not any.

setName

public Parameter setName(String name)

asIndividual

public com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
Description copied from interface: IOTComponent
The OpenTox component as an individual.

Specified by:
asIndividual in interface IOTComponent
Parameters:
model - The ontological model to which the individual belongs.
Returns:
The OpenTox component as an individual of a data model.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class OTComponent<Parameter<T>>

hashCode

public int hashCode()
Overrides:
hashCode in class OTComponent<Parameter<T>>


Copyright © 2011-2012 OpenTox. All Rights Reserved.