COM.hugin.HAPI
Class ClassCollection

java.lang.Object
  extended byCOM.hugin.HAPI.ClassCollection

public class ClassCollection
extends java.lang.Object

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 influence diagrams). That is, each Class may contain instances of other Classes of the ClassCollection, but not of Classes of other ClassCollections.

Different operations are supported for ClassCollections:

  • Creation and deletion
  • Addition of Class objects specified in NET files
  • Saving to a NET file
  • Retrieval of the list of Class objects
  • Retrieval of a Class object by its name

  • Constructor Summary
    ClassCollection()
              Constructs a new (empty) ClassCollection.
     
    Method Summary
     void delete()
              Deletes this ClassCollection and all its Classs.
     Class getClassByName(java.lang.String name)
              Returns the Class of this ClassCollection that has a given name.
     ClassList getMembers()
              Returns a ClassList containing the Class members of this ClassCollection.
     void parseClasses(java.lang.String fileName)
              Constructs one or more classes from a NET file.
     void parseClasses(java.lang.String fileName, ClassParseListener pl)
              Constructs one or more classes from a NET file.
     void saveAsNet(java.lang.String fileName)
              Writes a NET description of the ClassCollection to a file.
     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

    ClassCollection

    public ClassCollection()
                    throws ExceptionHugin
    Constructs a new (empty) ClassCollection.

    Method Detail

    parseClasses

    public void parseClasses(java.lang.String fileName,
                             ClassParseListener pl)
                      throws ExceptionHugin
    Constructs one or more classes from a NET file.

    Parameters:
    fileName - A String containing the name of the NET file.
    pl - a ClassParseListener.
    Throws:
    ExceptionHugin

    parseClasses

    public void parseClasses(java.lang.String fileName)
                      throws ExceptionHugin
    Constructs one or more classes from a NET file. This method uses a DefaultClassParseListener.

    Parameters:
    fileName - A string containing the name of the NET file.
    Throws:
    ExceptionHugin

    delete

    public void delete()
                throws ExceptionHugin
    Deletes this ClassCollection and all its Classs.

    Throws:
    ExceptionHugin

    getMembers

    public ClassList getMembers()
                         throws ExceptionHugin
    Returns a ClassList containing the Class members of this ClassCollection.

    Throws:
    ExceptionHugin

    getClassByName

    public Class getClassByName(java.lang.String name)
                         throws ExceptionHugin
    Returns the Class of this ClassCollection that has a given name.

    Parameters:
    name - A string representing the name of a Class.
    Throws:
    ExceptionHugin

    saveAsNet

    public void saveAsNet(java.lang.String fileName)
                   throws ExceptionHugin
    Writes a NET description of the ClassCollection to a file.

    Parameters:
    fileName - a string containing the name of the file.
    Throws:
    ExceptionHugin

    toString

    public java.lang.String toString()
    Returns a String of names of the member Classes of this ClassCollection.

    Returns:
    A String like e.g., "{ ClassA, ClassB }".