Fido Alpha 3.2

fido.db
Class AttributeTable

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

public class AttributeTable
extends java.lang.Object


Constructor Summary
AttributeTable()
          Constructs a new AttributeList with no entries in the list.
 
Method Summary
 void add(java.lang.String name, java.lang.String category)
          Adds or modifies a AttributeList.
 void delete(java.lang.String name)
          Removes the Attribute referenced by the parameters name.
 void deleteAllForType(java.sql.Statement stmt, java.lang.String type)
          This method accepts a Statement object from the caller to participate in a transaction.
 java.lang.String get(java.lang.String name)
          Returns the Attribute type referrenced by the parameter name.
 int hashCode(java.lang.String attribute)
           
 java.util.Collection list()
          Returns the names of all Attribute names in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeTable

public AttributeTable()
Constructs a new AttributeList with no entries in the list. The database reference is stored so any updates will store in the database. Upon creation, this class will write itself to the database. If an entry with the name AttributeList already exists in the database, the object it points to is replaced.

Throws:
FidoIOException - Input / Output error on creating the AttributeList object
Method Detail

add

public void add(java.lang.String name,
                java.lang.String category)
         throws FidoDatabaseException,
                AttributeCategoryNotFoundException
Adds or modifies a AttributeList. The name parameter is the string used to reference the object in the list. If an entry with this name already is in the list, the object replaced with the type parameter.

Parameters:
name - name of the adjective to add to the list
Throws:
java.sql.SQLException - Input / Output error saving Attributes
FidoDatabaseException
AttributeCategoryNotFoundException

delete

public void delete(java.lang.String name)
            throws FidoDatabaseException
Removes the Attribute referenced by the parameters name. If the list contains no entery with that name, this call does nothing. The list is only updated in the database file if the link type was acutally removed.

Parameters:
name - Name of the Attribute to remove
Throws:
FidoIOException - Input / Output error saving GrammarLinkList
FidoDatabaseException

deleteAllForType

public void deleteAllForType(java.sql.Statement stmt,
                             java.lang.String type)
                      throws java.sql.SQLException
This method accepts a Statement object from the caller to participate in a transaction. If this call fails, an SQLException is thrown back to the caller, which rollsback the transaction. If the caller fails a statement, this call will be rolledback.

java.sql.SQLException

get

public java.lang.String get(java.lang.String name)
                     throws FidoDatabaseException,
                            AttributeNotFoundException
Returns the Attribute type referrenced by the parameter name.

Returns:
type of link
Throws:
GrammarLinkNotFoundException - thrown when the name does not exist in the list
FidoDatabaseException
AttributeNotFoundException

list

public java.util.Collection list()
                          throws FidoDatabaseException
Returns the names of all Attribute names in the list. The names of the links are in alphabetical order.

Returns:
list of link names
FidoDatabaseException

hashCode

public int hashCode(java.lang.String attribute)
             throws FidoDatabaseException,
                    AttributeNotFoundException
FidoDatabaseException
AttributeNotFoundException

Fido Alpha 3.2