com.ontotext.wsmo4j.ontology
Class InstanceImpl

java.lang.Object
  extended by com.ontotext.wsmo4j.common.EntityImpl
      extended by com.ontotext.wsmo4j.ontology.OntologyElementImpl
          extended by com.ontotext.wsmo4j.ontology.InstanceImpl
All Implemented Interfaces:
org.omwg.ontology.Instance, org.omwg.ontology.OntologyElement, org.omwg.ontology.Value, org.wsmo.common.Entity

public class InstanceImpl
extends OntologyElementImpl
implements org.omwg.ontology.Instance


Constructor Summary
InstanceImpl(org.wsmo.common.Identifier thisID)
           
 
Method Summary
 void addAttributeValue(org.wsmo.common.Identifier id, org.omwg.ontology.Value value)
          Adds a new attribute value to the list of values associated with the specified attribute of this instance.
 void addConcept(org.omwg.ontology.Concept memberOf)
          Sets the concept this instance is an instance of.
 boolean equals(Object object)
           
 Set<org.omwg.ontology.Attribute> findAttributeDefinitions(org.wsmo.common.Identifier id)
           
 Map<org.wsmo.common.Identifier,Set<org.omwg.ontology.Value>> listAttributeValues()
          Returns a list of values of a specified attribute.
 Set<org.omwg.ontology.Value> listAttributeValues(org.wsmo.common.Identifier id)
          Adds a new attribute value to the list of values associated with the specified attribute of this instance.
 Set<org.omwg.ontology.Concept> listConcepts()
          Lists the axioms defined by this ontology.
 void removeAttributeValue(org.wsmo.common.Identifier id, org.omwg.ontology.Value attrVal)
          Removes a particular value associated with an attribute within this instance.
 void removeAttributeValues(org.wsmo.common.Identifier id)
          clears all the values associated with a particular attribute of this instance.
 void removeConcept(org.omwg.ontology.Concept memberOf)
          Removes an axiom from the set of axioms defined by this ontology.
 
Methods inherited from class com.ontotext.wsmo4j.ontology.OntologyElementImpl
getOntology, setOntology
 
Methods inherited from class com.ontotext.wsmo4j.common.EntityImpl
addNFPValue, addNFPValue, getIdentifier, hashCode, listNFPValues, listNFPValues, removeNFP, removeNFPValue, removeNFPValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omwg.ontology.OntologyElement
getOntology, setOntology
 
Methods inherited from interface org.wsmo.common.Entity
addNFPValue, addNFPValue, getIdentifier, listNFPValues, listNFPValues, removeNFP, removeNFPValue, removeNFPValue
 

Constructor Detail

InstanceImpl

public InstanceImpl(org.wsmo.common.Identifier thisID)
Method Detail

addConcept

public void addConcept(org.omwg.ontology.Concept memberOf)
                throws org.wsmo.common.exception.InvalidModelException
Sets the concept this instance is an instance of.

Specified by:
addConcept in interface org.omwg.ontology.Instance
Parameters:
concept - The concept that this instance is an instance of.
Throws:
org.wsmo.common.exception.SynchronisationException
org.wsmo.common.exception.InvalidModelException

removeConcept

public void removeConcept(org.omwg.ontology.Concept memberOf)
                   throws org.wsmo.common.exception.InvalidModelException
Removes an axiom from the set of axioms defined by this ontology.

Specified by:
removeConcept in interface org.omwg.ontology.Instance
Parameters:
axiom - The axiom to be removed.
Throws:
org.wsmo.common.exception.SynchronisationException
org.wsmo.common.exception.InvalidModelException

listConcepts

public Set<org.omwg.ontology.Concept> listConcepts()
                                            throws org.wsmo.common.exception.SynchronisationException
Lists the axioms defined by this ontology.

Specified by:
listConcepts in interface org.omwg.ontology.Instance
Returns:
The set of axioms defined by this ontology.
Throws:
org.wsmo.common.exception.SynchronisationException

listAttributeValues

public Set<org.omwg.ontology.Value> listAttributeValues(org.wsmo.common.Identifier id)
                                                 throws org.wsmo.common.exception.SynchronisationException
Adds a new attribute value to the list of values associated with the specified attribute of this instance.

Specified by:
listAttributeValues in interface org.omwg.ontology.Instance
Parameters:
value - The value to be added.
id - The attribute's identifier of interest.
Throws:
org.wsmo.common.exception.SynchronisationException
org.wsmo.common.exception.InvalidModelException

listAttributeValues

public Map<org.wsmo.common.Identifier,Set<org.omwg.ontology.Value>> listAttributeValues()
                                                                                 throws org.wsmo.common.exception.SynchronisationException
Returns a list of values of a specified attribute.

Specified by:
listAttributeValues in interface org.omwg.ontology.Instance
Returns:
A Map of [Attribute, Set] pairs.
Throws:
org.wsmo.common.exception.SynchronisationException

addAttributeValue

public void addAttributeValue(org.wsmo.common.Identifier id,
                              org.omwg.ontology.Value value)
                       throws org.wsmo.common.exception.SynchronisationException,
                              org.wsmo.common.exception.InvalidModelException
Adds a new attribute value to the list of values associated with the specified attribute of this instance.

Specified by:
addAttributeValue in interface org.omwg.ontology.Instance
Parameters:
value - The value to be added.
id - The attribute's identifier of interest.
Throws:
org.wsmo.common.exception.SynchronisationException
org.wsmo.common.exception.InvalidModelException

removeAttributeValue

public void removeAttributeValue(org.wsmo.common.Identifier id,
                                 org.omwg.ontology.Value attrVal)
                          throws org.wsmo.common.exception.SynchronisationException,
                                 org.wsmo.common.exception.InvalidModelException
Removes a particular value associated with an attribute within this instance.

Specified by:
removeAttributeValue in interface org.omwg.ontology.Instance
Parameters:
id - The attribute's identifier of interest.
value - the attribute value to be removed.
Throws:
org.wsmo.common.exception.SynchronisationException
org.wsmo.common.exception.InvalidModelException
See Also:
#removeAttributeValues(Attribute key)

removeAttributeValues

public void removeAttributeValues(org.wsmo.common.Identifier id)
                           throws org.wsmo.common.exception.SynchronisationException,
                                  org.wsmo.common.exception.InvalidModelException
clears all the values associated with a particular attribute of this instance.

Specified by:
removeAttributeValues in interface org.omwg.ontology.Instance
Parameters:
attribute - The attribute of interest.
Throws:
org.wsmo.common.exception.SynchronisationException
org.wsmo.common.exception.InvalidModelException
See Also:
removeAttributeValue(Attribute key, Object value)

findAttributeDefinitions

public Set<org.omwg.ontology.Attribute> findAttributeDefinitions(org.wsmo.common.Identifier id)
Specified by:
findAttributeDefinitions in interface org.omwg.ontology.Instance

equals

public boolean equals(Object object)
Overrides:
equals in class EntityImpl


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.