Fido Alpha 3.2

fido.db
Class ObjectTable

java.lang.Object
  |
  +--fido.db.ObjectTable

public class ObjectTable
extends java.lang.Object


Constructor Summary
ObjectTable()
           
 
Method Summary
 java.lang.String buildInList(int objectId)
           
 boolean contains(int id)
           
 void deleteClass(int objectId, boolean tree)
          Removes the Class name objectId from the Hierarchy.
 void deleteInstance(int instanceId)
          Deletes an InstanceObject.
 java.util.Collection findInstance(int subtreeRoot, BooleanTree attrTree, BooleanTree prepTree)
           
 java.util.Collection findObject(int objectId)
           
 int hashCode(int id)
           
 int hashCode(java.lang.String id)
           
 int instantiate(int objectId, java.lang.String description)
          Creates a new InstanceObject from the ClassObject objectId The new object will duplicate all of the links of the parent ClassObject.
 boolean isSubclassOf(int objectId, int parent)
          Looks for a class named parent as any parent class of objectId, until the root class Object is reached.
 void modify(int id, java.lang.String description)
           
 java.util.Collection pathToObject(int objectId)
          Deletes an InstanceObject.
 int subclass(int objectId, java.lang.String description)
          Creates a new ClassObject cloning objectId with a LinkName Isa pointing to the parent class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectTable

public ObjectTable()
Method Detail

isSubclassOf

public boolean isSubclassOf(int objectId,
                            int parent)
                     throws FidoDatabaseException,
                            ObjectNotFoundException
Looks for a class named parent as any parent class of objectId, until the root class Object is reached.

Parameters:
objectId - starting class name
parent - name of the class to look for as a parent
Throws:
ObjectNotFoundException - thrown if objectId is not the name of a valid ClassObject.
java.sql.SQLException - thrown if any IO Exception occurs while reading classes.
FidoDatabaseException

contains

public boolean contains(int id)
                 throws FidoDatabaseException
FidoDatabaseException

subclass

public int subclass(int objectId,
                    java.lang.String description)
             throws FidoDatabaseException,
                    ObjectNotFoundException
Creates a new ClassObject cloning objectId with a LinkName Isa pointing to the parent class. Also, the reverse link field of Isa will be added to the parent class objectId adding the new class as a child. The name of the new object will be a unique generated name, which will be returned as a String from the call.

Parameters:
objectId - name of the parent class to clone
Returns:
name of the new ClassObject
Throws:
ObjectNotFoundException - thrown if the class object objectId is not found
java.sql.SQLException - thrown if any IO Exception occurs while reading parent class or writting the new class.
FidoDatabaseException

deleteClass

public void deleteClass(int objectId,
                        boolean tree)
                 throws ObjectNotFoundException,
                        FidoDatabaseException,
                        CannotDeleteRootObjectException,
                        ClassLinkTypeNotFoundException
Removes the Class name objectId from the Hierarchy. To maintain hierarchial integrity, the parameter tree specifies what should happen to the children ClassObjects of the object: Any InstanceObject of the object will be removed.

Parameters:
objectId - name of the class to remove
tree - true if all subclasses should be removed, false if all children should become children of the parent
Throws:
ObjectNotFoundException - thrown if the class object objectId is not found
java.sql.SQLException - thrown if any IO Exception occurs while reading parent class or deleting the class.
CannotDeleteRootObjectException - thrown when attempting to remove the root object named Object
LinkTypeNotFoundException - System LinkType named Isa was not found
FidoDatabaseException
ClassLinkTypeNotFoundException

instantiate

public int instantiate(int objectId,
                       java.lang.String description)
                throws FidoDatabaseException,
                       ObjectNotFoundException,
                       ClassLinkTypeNotFoundException
Creates a new InstanceObject from the ClassObject objectId The new object will duplicate all of the links of the parent ClassObject. The LinkType Instance will be used to link the new Instance with the parent ClassObject. The name of the new object will be a unique generated name, which will be returned as a String from the call.

Parameters:
objectId - name of the class to create an instance from
Returns:
name of the new InstanceObject
Throws:
ObjectNotFoundException - thrown if the class object objectId is not found
LinkTypeNotFoundException - thrown if the link type Instance is not found
java.sql.SQLException - thrown if any IO Exception occurs while reading parent class or writting the new class.
FidoDatabaseException
ClassLinkTypeNotFoundException

deleteInstance

public void deleteInstance(int instanceId)
                    throws FidoDatabaseException,
                           ObjectNotFoundException
Deletes an InstanceObject.

Throws:
ObjectNotFoundException - thrown if the class object instanceName is not found
java.sql.SQLException - thrown if any IO Exception occurs while removing the object
FidoDatabaseException

buildInList

public java.lang.String buildInList(int objectId)
                             throws FidoDatabaseException,
                                    ObjectNotFoundException
FidoDatabaseException
ObjectNotFoundException

pathToObject

public java.util.Collection pathToObject(int objectId)
                                  throws FidoDatabaseException,
                                         ObjectNotFoundException
Deletes an InstanceObject.

Throws:
ObjectNotFoundException - thrown if the class object instanceName is not found
java.sql.SQLException - thrown if any IO Exception occurs while removing the object
FidoDatabaseException

modify

public void modify(int id,
                   java.lang.String description)
            throws FidoDatabaseException,
                   ObjectNotFoundException
FidoDatabaseException
ObjectNotFoundException

findObject

public java.util.Collection findObject(int objectId)
                                throws FidoDatabaseException,
                                       ObjectNotFoundException
FidoDatabaseException
ObjectNotFoundException

findInstance

public java.util.Collection findInstance(int subtreeRoot,
                                         BooleanTree attrTree,
                                         BooleanTree prepTree)
                                  throws FidoDatabaseException,
                                         BooleanSyntaxException,
                                         ObjectNotFoundException,
                                         ClassLinkTypeNotFoundException
FidoDatabaseException
BooleanSyntaxException
ObjectNotFoundException
ClassLinkTypeNotFoundException

hashCode

public int hashCode(java.lang.String id)
             throws FidoDatabaseException,
                    ObjectNotFoundException
FidoDatabaseException
ObjectNotFoundException

hashCode

public int hashCode(int id)
             throws FidoDatabaseException,
                    ObjectNotFoundException
FidoDatabaseException
ObjectNotFoundException

Fido Alpha 3.2