All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class SHOE.Instance

java.lang.Object
   |
   +----SHOE.SHOE_Obj
           |
           +----SHOE.Instance

public class Instance
extends SHOE_Obj
A class for representing a SHOE instance. Methods are provided to read the instance from a SHOE document, to write it back out, and to manipulate an intermediate data structure.


Constructor Index

 o Instance(SGML_Tag)
Constructs an instance and initializes it using the information provided in the specified SGML tag.
 o Instance(SGML_Tag, SHOE_Doc)
Special constructor to identify the containing document of this instance.
 o Instance(String, String[])
Constructs an instance and assigns it the given key and set of instances that have been delegated to.

Method Index

 o addDeclaration(SHOE_Obj, OntManager)
Adds a new category or relation claim to the instance and validates it.
 o addDeclaration(SHOE_Obj, OntManager, boolean)
Adds a new category or relation claim to the instance, validates it, and if the boolean parameter is true, also updates the content vector of the instance.
 o addSubInst(Instance)
Add a new instance that is contained within the current instance.
 o addUseOnt(Use_Ontology)
Adds a new use ontology to the instance.
 o addUseOnt(Use_Ontology, boolean)
Adds a new use ontology to the instance and if the boolean is true, also updates the content vector of the instance.
 o deleteDeclaration(Declaration)
Removes the specified category or relation claim from the instance.
 o deleteUseOnt(Use_Ontology)
Removes the specified Use-Ontology from the instance.
 o getDeclarations()
Returns an enumeration of the category and relation claims made by this instance.
 o getDelegates()
Returns an array of the keys of instances to which this instance has delegated authority.
 o getDelegateStr()
Returns a string that is a white-space delimited concatenation of all of the delegate to elements.
 o getKey()
Returns the unique identifier for the instance.
 o getUseOnt(String)
Returns the Use-Ontology object in which the specified prefix was assigned to a referenced ontology.
 o getUseOnts()
Returns an enumeration of the Use-Ontologies included in this instance.
 o getUseOntTreeList(OntManager)
Returns the set of use ontologies that occur within the instance.
 o printSGML(PrintStream)
Writes the instance and its components to the given print stream in SGML format.
 o readSubTags(HTML_Tokenizer)
Reads and processes the tokens from an HTML_Tokenizer until the instance closing tag is encountered.
 o toString()
Returns a string consisting of the corresponding open tag for the instance.
 o update(String, Vector)
Set the key and delegation vector to the specified values.
 o validate(SHOE_Obj, OntManager)
Checks the instance for reference errors.

Constructors

 o Instance
 public Instance(String key,
                 String delegates[])
Constructs an instance and assigns it the given key and set of instances that have been delegated to.

 o Instance
 public Instance(SGML_Tag sgmltag)
Constructs an instance and initializes it using the information provided in the specified SGML tag.

 o Instance
 public Instance(SGML_Tag sgmltag,
                 SHOE_Doc parentDoc)
Special constructor to identify the containing document of this instance. It is only needed so that the instance can add its nested instances as top-level instances in the document (part of a kludge to handle nested instances.

Methods

 o getKey
 public String getKey()
Returns the unique identifier for the instance.

Overrides:
getKey in class SHOE_Obj
 o getDelegates
 public String[] getDelegates()
Returns an array of the keys of instances to which this instance has delegated authority.

 o getDelegateStr
 public String getDelegateStr()
Returns a string that is a white-space delimited concatenation of all of the delegate to elements.

 o getUseOnts
 public Enumeration getUseOnts()
Returns an enumeration of the Use-Ontologies included in this instance.

 o getDeclarations
 public Enumeration getDeclarations()
Returns an enumeration of the category and relation claims made by this instance.

 o getUseOnt
 public Use_Ontology getUseOnt(String prefix)
Returns the Use-Ontology object in which the specified prefix was assigned to a referenced ontology.

 o getUseOntTreeList
 public Vector getUseOntTreeList(OntManager ontman)
Returns the set of use ontologies that occur within the instance. Each use ontology is the root of a tree where children in the tree represent use ontologies that occur in the ontology referenced by the parent use ontology. Each node consists of a Use-Ontology object and a label that is the prefix chain to reach that object.

 o update
 public void update(String key,
                    Vector delegateto)
Set the key and delegation vector to the specified values.

 o addUseOnt
 public void addUseOnt(Use_Ontology uont) throws DupeKeyException
Adds a new use ontology to the instance. Throws an exception if the prefix used has already been assigned to another ontology.

 o addUseOnt
 public void addUseOnt(Use_Ontology uont,
                       boolean addToContent) throws DupeKeyException
Adds a new use ontology to the instance and if the boolean is true, also updates the content vector of the instance. Throws an exception if the prefix used has already been assigned to another ontology.

 o addDeclaration
 public void addDeclaration(SHOE_Obj dec,
                            OntManager ontman)
Adds a new category or relation claim to the instance and validates it.

 o addDeclaration
 public void addDeclaration(SHOE_Obj dec,
                            OntManager ontman,
                            boolean addToContent)
Adds a new category or relation claim to the instance, validates it, and if the boolean parameter is true, also updates the content vector of the instance.

 o addSubInst
 public void addSubInst(Instance inst) throws DupeKeyException
Add a new instance that is contained within the current instance. Note: Nested instances may go away in future versions of SHOE. This code does not allow subinstances to be accessed; they are actually treated as new top-level instances in the document.

 o deleteUseOnt
 public void deleteUseOnt(Use_Ontology uont)
Removes the specified Use-Ontology from the instance.

 o deleteDeclaration
 public void deleteDeclaration(Declaration dec)
Removes the specified category or relation claim from the instance.

 o readSubTags
 public Vector readSubTags(HTML_Tokenizer intokens)
Reads and processes the tokens from an HTML_Tokenizer until the instance closing tag is encountered. Parse errors are permanently stored with the ontology in parseErrs.

Overrides:
readSubTags in class SHOE_Obj
 o validate
 public Vector validate(SHOE_Obj parent,
                        OntManager ontman)
Checks the instance for reference errors. These are permanently stored in the parseErrs vector.

 o printSGML
 public void printSGML(PrintStream out)
Writes the instance and its components to the given print stream in SGML format.

Overrides:
printSGML in class SHOE_Obj
 o toString
 public String toString()
Returns a string consisting of the corresponding open tag for the instance.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index