GATE
Version 3.1-2270

gate.creole.ontology
Class OntologyResourceImpl

java.lang.Object
  extended by gate.creole.ontology.OntologyResourceImpl
All Implemented Interfaces:
OntologyResource
Direct Known Subclasses:
OInstanceImpl, PropertyImpl, TClassImpl

public class OntologyResourceImpl
extends Object
implements OntologyResource

This is an implementation for ontology resource. It provides implementations for the methods on the OntologyResource interface and is intended to be used as a base class for other classes implementing that interface or its sub-interfaces.


Field Summary
protected  String comment
           
protected  HashMap instanceProperties
           
protected  String name
           
protected  Ontology ontology
           
protected  Taxonomy taxonomy
           
protected  String uri
           
 
Constructor Summary
OntologyResourceImpl(String uri, String name, String comment, Taxonomy taxonomy)
           
OntologyResourceImpl(String name, String comment, Taxonomy taxonomy)
          Constructor variant using the name as the local URI.
 
Method Summary
 boolean addPropertyValue(String propertyName, Object theValue)
          Adds a new property with the given name and value.
 String getComment()
          Gets the comment of the resource.
 String getName()
          Gets resource name.
 Ontology getOntology()
          Gets the ontology to which the resource belongs.
 Object getPropertyValue(String propertyName)
           
 List getPropertyValues(String propertyName)
          Gets the list of values for a given property name.
 Set getSetPropertiesNames()
          Gets the names of the properties that have set values for this instance.
 Taxonomy getTaxonomy()
          Gets the taxonomy to which the resource belongs.
 String getURI()
          Gets the URI of the resource.
 boolean removePropertyValue(String propertyName, Object theValue)
          Removes one of the values for a given property.
 void removePropertyValues(String propertyName)
          Removes all values for a named property.
 void setComment(String comment)
          Sets the resource comment.
 void setName(String name)
          Sets the resource name.
 void setOntology(Taxonomy ontology)
           
 void setURI(String uri)
          Sets the URI of the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uri

protected String uri

comment

protected String comment

name

protected String name

taxonomy

protected Taxonomy taxonomy

ontology

protected Ontology ontology

instanceProperties

protected HashMap instanceProperties
Constructor Detail

OntologyResourceImpl

public OntologyResourceImpl(String uri,
                            String name,
                            String comment,
                            Taxonomy taxonomy)

OntologyResourceImpl

public OntologyResourceImpl(String name,
                            String comment,
                            Taxonomy taxonomy)
Constructor variant using the name as the local URI.

Parameters:
name -
comment -
ontology -
Method Detail

addPropertyValue

public boolean addPropertyValue(String propertyName,
                                Object theValue)
Description copied from interface: OntologyResource
Adds a new property with the given name and value.

Specified by:
addPropertyValue in interface OntologyResource
Parameters:
propertyName - the name of the property
theValue - the value for the property
Returns:
true if the property name is valid for this type of instance and the new value has been added, false otherwise.

getSetPropertiesNames

public Set getSetPropertiesNames()
Description copied from interface: OntologyResource
Gets the names of the properties that have set values for this instance.

Specified by:
getSetPropertiesNames in interface OntologyResource
Returns:
a set of String values.

getPropertyValues

public List getPropertyValues(String propertyName)
Description copied from interface: OntologyResource
Gets the list of values for a given property name.

Specified by:
getPropertyValues in interface OntologyResource
Parameters:
propertyName - the name of the property
Returns:
a List of values.

removePropertyValue

public boolean removePropertyValue(String propertyName,
                                   Object theValue)
Description copied from interface: OntologyResource
Removes one of the values for a given property.

Specified by:
removePropertyValue in interface OntologyResource
Parameters:
propertyName - the name of the property
theValue - the value to be removed.
Returns:
true if the value was found and removed, false otherwise.

removePropertyValues

public void removePropertyValues(String propertyName)
Description copied from interface: OntologyResource
Removes all values for a named property.

Specified by:
removePropertyValues in interface OntologyResource
Parameters:
propertyName - the property name.

getPropertyValue

public Object getPropertyValue(String propertyName)

getComment

public String getComment()
Description copied from interface: OntologyResource
Gets the comment of the resource.

Specified by:
getComment in interface OntologyResource
Returns:
Returns the comment.

setComment

public void setComment(String comment)
Description copied from interface: OntologyResource
Sets the resource comment.

Specified by:
setComment in interface OntologyResource
Parameters:
comment - The comment to set.

getName

public String getName()
Description copied from interface: OntologyResource
Gets resource name.

Specified by:
getName in interface OntologyResource
Returns:
Returns the name.

setName

public void setName(String name)
Description copied from interface: OntologyResource
Sets the resource name.

Specified by:
setName in interface OntologyResource
Parameters:
name - The name to set.

getTaxonomy

public Taxonomy getTaxonomy()
Description copied from interface: OntologyResource
Gets the taxonomy to which the resource belongs.

Specified by:
getTaxonomy in interface OntologyResource
Returns:
Returns the taxonomy.

getOntology

public Ontology getOntology()
Description copied from interface: OntologyResource
Gets the ontology to which the resource belongs.

Specified by:
getOntology in interface OntologyResource
Returns:
Returns the ontology.

setOntology

public void setOntology(Taxonomy ontology)
Parameters:
ontology - The ontology to set.

getURI

public String getURI()
Description copied from interface: OntologyResource
Gets the URI of the resource.

Specified by:
getURI in interface OntologyResource
Returns:
Returns the URI.

setURI

public void setURI(String uri)
Description copied from interface: OntologyResource
Sets the URI of the resource.

Specified by:
setURI in interface OntologyResource
Parameters:
uri - The URI to set.

GATE
Version 3.1-2270