|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.ClassCollection
Classes are grouped into ClassCollections. Each class must belong to exactly one ClassCollection. A ClassCollection can be considered a closed world of interdependent Classes (i.e., Bayesian networks and LIMIDs). That is, each Class may contain instances of other Classes of the ClassCollection, but not of Classes of other ClassCollections.
Several operations are supported for ClassCollections:
Constructor Summary | |
ClassCollection()
Constructs a new (empty) ClassCollection. |
|
ClassCollection(java.lang.String hkbFileName)
Constructs a class collection by loading the corresponding Hugin Knowledge Base (HKB) file. |
|
ClassCollection(java.lang.String hkbFileName,
java.lang.String password)
Constructs a class collection by loading the corresponding Hugin Knowledge Base (HKB) file. |
Method Summary | |
void |
delete()
Deletes this ClassCollection and all its member Classes. |
Class |
getClassByName(java.lang.String name)
Returns the Class of this ClassCollection that has the given name. |
ClassList |
getMembers()
Returns a ClassList containing the members of this ClassCollection. |
java.lang.Object |
getUserData()
Returns the value stored within the user data slot of this ClassCollection. |
boolean |
isAlive()
Is this ClassCollection object alive? |
void |
parseClasses(java.lang.String netStringOrFileName)
Constructs one or more classes from a NET file or a NET description given as a string. |
void |
parseClasses(java.lang.String netStringOrFileName,
ClassParseListener pl)
Constructs one or more classes from a NET file or a NET description given as a string. |
void |
saveAsKB(java.lang.String fileName)
Saves this ClassCollection as a Hugin Knowledge Base (HKB) file. |
void |
saveAsKB(java.lang.String fileName,
java.lang.String password)
Saves this ClassCollection as a password-protected Hugin Knowledge Base (HKB) file. |
void |
saveAsNet(java.lang.String netName)
Writes a NET description of this ClassCollection to a file. |
void |
setUserData(java.lang.Object data)
Sets the user data field of this ClassCollection. |
java.lang.String |
toNetString()
Creates a NET description of this ClassCollection. |
java.lang.String |
toString()
Returns a String of names of the member Classes of this ClassCollection. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClassCollection() throws ExceptionHugin
public ClassCollection(java.lang.String hkbFileName, java.lang.String password) throws ExceptionHugin
hkbFileName
- the name of the HKB filepassword
- a password needed to load the file.public ClassCollection(java.lang.String hkbFileName) throws ExceptionHugin
hkbFileName
- the name of the HKB file.Method Detail |
public void parseClasses(java.lang.String netStringOrFileName, ClassParseListener pl) throws ExceptionHugin
netStringOrFileName
- a string containing a NET
description or the name of a NET filepl
- a ClassParseListener.
ExceptionHugin
public void parseClasses(java.lang.String netStringOrFileName) throws ExceptionHugin
DefaultClassParseListener
.
netStringOrFileName
- a string containing a NET
description or the name of a NET file.
ExceptionHugin
public void delete() throws ExceptionHugin
ExceptionHugin
public ClassList getMembers() throws ExceptionHugin
ExceptionHugin
public Class getClassByName(java.lang.String name) throws ExceptionHugin
null
is returned.
name
- A string representing the name of a Class.
ExceptionHugin
public void saveAsKB(java.lang.String fileName, java.lang.String password) throws ExceptionHugin
password
is
non-null, the file will be password protected. This password
must be used in order to load the file.
fileName
- the name of the file to which the HKB is saved.password
- if non-null, this must be used in order to load
the file.
ExceptionHugin
public void saveAsNet(java.lang.String netName) throws ExceptionHugin
netName
- the name of the NET file.
ExceptionHugin
public java.lang.String toNetString() throws ExceptionHugin
ExceptionHugin
public void saveAsKB(java.lang.String fileName) throws ExceptionHugin
fileName
- the name of the HKB file.
ExceptionHugin
public boolean isAlive()
public java.lang.String toString()
public java.lang.Object getUserData()
public void setUserData(java.lang.Object data)
data
- User-defined data associated with this ClassCollection.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |