Save This Page
Home » openjdk-7 » net.sourceforge » jbird » chklst » [javadoc | source]
net.sourceforge.jbird.chklst
public final class: ChecklistDB [javadoc | source]
java.lang.Object
   net.sourceforge.jbird.chklst.ChecklistDB
A query class that provides JbirdDB functionality for checklist methods that are not called generally enough to warrant being in JbirdDB. The idea is to keep the size of JbirdDB reasonable by removing from it methods that are used under restricted cirmcumstances.
Field Summary
public static final  int BAD_NAME    Returned by approveChecklistName. 
public static final  int EXISTS_ALREADY    Returned by addChecklist and approveChecklistName if checklist already exists. 
public static final  int APPROVED    Returned by approveChecklistName. 
public static final  int LIST_NAME     
public static final  int LIST_DESCRIPTION     
public static final  int LIST_SOURCE     
public static final  int LIST_CONTRIBUTOR     
public static final  int LIST_VERSION     
public static final  int LIST_PARENT     
public static final  int LIST_LENGTH     
protected  PreparedStatement paddtochecklist    PreparedStatement for adding species to checklists. 
protected  PreparedStatement pchecklistcontains    PreparedStatement for testing whether a species is in a checklist. Used heavily by tables. 
protected  PreparedStatement pnewchecklist    PreparedStatement used to add new checklists. 
protected  PreparedStatement pchildcount    PreparedStatement used for getChildCount. 
protected  PreparedStatement pchildnumbers    PreparedStatement used for getChildNumbers. 
protected  PreparedStatement pinfo    PreparedStatement used for getChecklistInfo. 
protected static final  String CHILDCOUNT_QUERY    Query to count children of a checklist. 
protected static final  String CHILD_NUMBERS_QUERY    Query to return children of this node in alphabetical order by short list name. 
protected static final  String INFO_QUERY    Query to obtain checklist metadata. 
protected  String add_clist_msg     
protected  String add_clist_failedmsg     
protected  String add_clist_already     
protected  String add_species_msg     
protected  String add_species_failedmsg     
protected  String del_species_msg     
protected  Object[] add_species_oba     
protected  Object[] del_species_oba     
Constructor:
 public ChecklistDB(JbirdDB db,
    ResourceBundle pr) 
Method from net.sourceforge.jbird.chklst.ChecklistDB Summary:
addChecklist,   addSpecies,   addSpeciesLog,   approveChecklistName,   changeChecklistParents,   checklistContains,   checklistDelete,   checklistDeleteAll,   checklistDeleteLog,   close,   getChecklistInfo,   getChecklistNames,   getChildCount,   getChildNumbers,   getLogListener,   getParentListNum,   getParentListNums,   getTreeName,   nullify,   removeChecklist,   removeChecklist,   removeChecklists,   updateChecklist
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.sourceforge.jbird.chklst.ChecklistDB Detail:
 public final int addChecklist(String[] listinfo,
    int parent) throws SQLException 
    Add a new checklist to checklistinfo. Returns the number of the checklist if successful and -1 if not if not successful. Throws SQLException for most problems.
 public final int addSpecies(int checklist,
    int species) 
    Add a species to the checklist.

    Does not log.

 public final int addSpeciesLog(int checklist,
    int species,
    String listname,
    String speciesname) 
 public final int approveChecklistName(String name) throws SQLException 
    Returns APPROVED, ALREADY_EXISTS, BAD_NAME. BAD_NAME is returned if name is null, length zero, or whitespace .
 public final int changeChecklistParents(int oldparent,
    int newparent) throws SQLException 
    Change parent of checklists that have old checklist as their parent to newparent. This method does not log changnes. It is up to the calling method to log the transaction.
 public final boolean checklistContains(int checklist,
    int species) 
    Return true if the checklist contains the species.
 public final int checklistDelete(int checklist,
    int species) throws SQLException 
    Delete a species from a checklist.
 public final int checklistDeleteAll(int listno) throws SQLException 
    Remove all species from the checklist named. Return the number of species removed.
 public final int checklistDeleteLog(int checklist,
    int species,
    String listname,
    String speciesname) throws SQLException 
    Delete species from checklist and log deletion. No log entry is made if nothing is deleted.
 public final  void close() 
    Closes prepared statements in object. Required. Call before abandoning object. Not a substitute for nullify.
 public final synchronized Object[] getChecklistInfo(int listno) throws SQLException 
 public final String[] getChecklistNames(int[] clnos) throws SQLException 
    Return names of the checklists passed in the argument.
 public final synchronized int getChildCount(int listnum) throws SQLException 
    Count the number of checklists that reference the argument as their parent. Used by ChecklistNode to implement TreeNode.
 public final synchronized int[] getChildNumbers(int listno) throws SQLException 
    Return primary keys of children of the given checklist.
 public final LogListener getLogListener() 
    Return the LogListener that is being used to log events.
 public final int getParentListNum(int listno) throws SQLException 
    Return the primary key of the parent of the given list number.
 public final int[] getParentListNums(int[] listnos) throws SQLException 
    Return the set of checklists that contains parents of the set of checklists in the argument. If any one of the the parents is zero or NULL, an int array of lenth 1 that contains the value zero is returned.
 public final synchronized String getTreeName(int listnum) throws SQLException 
    Return the name of a checklist that is suitable for display in a JTree.
 public final  void nullify() 
    Optional. Sets fields to null. Does not call close.
 public final int removeChecklist(int listno) throws SQLException 
    Remove a checklist from the database. Checklists that are children of the targets will have their parents changed from the target to the parent of the target. Well, not implmented yet. Parents are set to zero.
 public final int removeChecklist(int listno,
    int newparent) throws SQLException 
    Remove a checklist from the database. Checklists in the db that reference the target as their parent will have their parents reassigned to be newparent.

    The three transactions (i.e., replace parents, delete species, and delete metadata) are performed as a unit. If one fails, the database is rolled back so that none of the changes are effected.

    Returns the number of records deleted from table checklistinfo.

 public final int removeChecklists(int[] listnos) throws SQLException 
 public final int updateChecklist(int listno,
    Object[] data) throws SQLException