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.
-
Instance(SGML_Tag)
- Constructs an instance and initializes it using the information
provided in the specified SGML tag.
-
Instance(SGML_Tag, SHOE_Doc)
- Special constructor to identify the containing document of this
instance.
-
Instance(String, String[])
- Constructs an instance and assigns it the given key and set of
instances that have been delegated to.
-
addDeclaration(SHOE_Obj, OntManager)
- Adds a new category or relation claim to the instance and
validates it.
-
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.
-
addSubInst(Instance)
- Add a new instance that is contained within the current instance.
-
addUseOnt(Use_Ontology)
- Adds a new use ontology to the instance.
-
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.
-
deleteDeclaration(Declaration)
- Removes the specified category or relation claim from the instance.
-
deleteUseOnt(Use_Ontology)
- Removes the specified Use-Ontology from the instance.
-
getDeclarations()
- Returns an enumeration of the category and relation claims made
by this instance.
-
getDelegates()
- Returns an array of the keys of instances to which this instance
has delegated authority.
-
getDelegateStr()
- Returns a string that is a white-space delimited concatenation
of all of the delegate to elements.
-
getKey()
- Returns the unique identifier for the instance.
-
getUseOnt(String)
- Returns the Use-Ontology object in which the specified prefix
was assigned to a referenced ontology.
-
getUseOnts()
- Returns an enumeration of the Use-Ontologies included in this
instance.
-
getUseOntTreeList(OntManager)
- Returns the set of use ontologies that occur within the instance.
-
printSGML(PrintStream)
- Writes the instance and its components to the given print
stream in SGML format.
-
readSubTags(HTML_Tokenizer)
- Reads and processes the tokens from an HTML_Tokenizer until
the instance closing tag is encountered.
-
toString()
- Returns a string consisting of the corresponding open tag for
the instance.
-
update(String, Vector)
- Set the key and delegation vector to the specified values.
-
validate(SHOE_Obj, OntManager)
- Checks the instance for reference errors.
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.
Instance
public Instance(SGML_Tag sgmltag)
- Constructs an instance and initializes it using the information
provided in the specified SGML tag.
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.
getKey
public String getKey()
- Returns the unique identifier for the instance.
- Overrides:
- getKey in class SHOE_Obj
getDelegates
public String[] getDelegates()
- Returns an array of the keys of instances to which this instance
has delegated authority.
getDelegateStr
public String getDelegateStr()
- Returns a string that is a white-space delimited concatenation
of all of the delegate to elements.
getUseOnts
public Enumeration getUseOnts()
- Returns an enumeration of the Use-Ontologies included in this
instance.
getDeclarations
public Enumeration getDeclarations()
- Returns an enumeration of the category and relation claims made
by this instance.
getUseOnt
public Use_Ontology getUseOnt(String prefix)
- Returns the Use-Ontology object in which the specified prefix
was assigned to a referenced ontology.
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.
update
public void update(String key,
Vector delegateto)
- Set the key and delegation vector to the specified values.
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.
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.
addDeclaration
public void addDeclaration(SHOE_Obj dec,
OntManager ontman)
- Adds a new category or relation claim to the instance and
validates it.
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.
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.
deleteUseOnt
public void deleteUseOnt(Use_Ontology uont)
- Removes the specified Use-Ontology from the instance.
deleteDeclaration
public void deleteDeclaration(Declaration dec)
- Removes the specified category or relation claim from the instance.
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
validate
public Vector validate(SHOE_Obj parent,
OntManager ontman)
- Checks the instance for reference errors. These are permanently stored
in the parseErrs vector.
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
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