edu.upenn.gloDB
Class ObjectHandles

java.lang.Object
  extended by edu.upenn.gloDB.ObjectHandles

public class ObjectHandles
extends java.lang.Object

ObjectHandles.

Version:
$Id: ObjectHandles.java,v 1.15.2.13 2007/03/01 21:17:33 fisher Exp $

Field Summary
private static javax.swing.DefaultComboBoxModel sequenceList
          This is a duplicate list of Sequences in the sequencePool.
static java.util.HashMap sequencePool
          The set of all existing Sequences.
static java.util.HashMap trackBySequenceList
          This is a list of all Tracks in the trackPool, that contain each Sequence.
private static javax.swing.DefaultComboBoxModel trackList
          This is a duplicate list of Tracks in the trackPool.
static java.util.HashMap trackPool
          The HashMap of all existing Tracks.
 
Constructor Summary
ObjectHandles()
           
 
Method Summary
static void addFeature(Feature feature)
          Add a Feature to the featurePool.
static void addSequence(Sequence sequence)
          Add a Sequence to the sequencePool.
static void addTrack(Track track)
          Add a Tracks to the trackPool.
static boolean containsSequence(java.lang.String id)
          Returns true if the Sequence object exists in the sequencePool.
static boolean containsTrack(java.lang.String id)
          Returns true if the Track object exists in the trackPool.
static Sequence getSequence(java.lang.String id)
          Returns the Sequence object for the given ID.
static javax.swing.DefaultComboBoxModel getSequenceList()
          Get the sequenceList.
static java.util.HashMap getSequencePool()
          Get the sequencePool.
static Track getTrack(java.lang.String id)
          Returns the Track object for the given ID.
static java.util.TreeSet getTrackBySequenceList(java.lang.String id)
          Get the trackList that contains all Tracks with the given Sequence.
static javax.swing.DefaultComboBoxModel getTrackList()
          Get the trackList.
static java.util.HashMap getTrackPool()
          Get the trackPool.
static void rebuildTrack(Track track)
          Rebuilds the Track relevant lists.
static void removeSequence(Sequence sequence)
          Removes the Sequence object for sequencePool and other relevant lists.
static void removeTrack(java.lang.String id)
          Removes the Track object for trackPool and other relevant lists.
static void removeTrack(Track track)
          Removes the Track object for trackPool and other relevant lists.
static void renameTrack(java.lang.String oldID, java.lang.String newID)
          Changes the Track's ID in trackPool, trackList, and trackBySequenceList.
static void renameTrack(Track track, java.lang.String newID)
          Changes the Track's ID in trackPool, trackList, and trackBySequenceList.
static java.util.Iterator sequenceIterator()
          Returns a iterator over all Sequences in sequencePool.
static java.util.Iterator trackIterator()
          Returns a iterator over all Tracks in trackPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trackPool

public static java.util.HashMap trackPool
The HashMap of all existing Tracks. It is made public so that the user can directly access the Tracks to test if a specific Track is in the set and to remove Tracks from the HashMap in the case of deleting the Track. When deleting Tracks, it is necessary to remove the Track from the trackPool. While new Tracks are added to the trackPool by default, it is possible to create a Track and not have it added to the trackPool. This should be avoided as certain functions require the Track to exist in the trackPool.


sequencePool

public static java.util.HashMap sequencePool
The set of all existing Sequences. It is made public so that the user can directly access the tracks to test if a specific Sequence is in the set and to remove Sequences from the set in the case of deleting the Sequence. When removing Sequences, they must be removed from the sequencePool. While new Sequences are added to the sequencePool by default, it is possible to create a Sequence and not have it added to the sequencePool. This should be avoided as certain functions require the Sequence to exist in the sequencePool.


trackList

private static javax.swing.DefaultComboBoxModel trackList
This is a duplicate list of Tracks in the trackPool. It is used by the GUI.


sequenceList

private static javax.swing.DefaultComboBoxModel sequenceList
This is a duplicate list of Sequences in the sequencePool. It is used by the GUI.


trackBySequenceList

public static java.util.HashMap trackBySequenceList
This is a list of all Tracks in the trackPool, that contain each Sequence. It is used by the GUI.

Constructor Detail

ObjectHandles

public ObjectHandles()
Method Detail

getTrackPool

public static java.util.HashMap getTrackPool()
Get the trackPool.


getTrackList

public static javax.swing.DefaultComboBoxModel getTrackList()
Get the trackList.


getSequencePool

public static java.util.HashMap getSequencePool()
Get the sequencePool.


getSequenceList

public static javax.swing.DefaultComboBoxModel getSequenceList()
Get the sequenceList.


addTrack

public static void addTrack(Track track)
                     throws InvalidIDException
Add a Tracks to the trackPool.

Throws:
InvalidIDException

removeTrack

public static void removeTrack(java.lang.String id)
Removes the Track object for trackPool and other relevant lists.


removeTrack

public static void removeTrack(Track track)
Removes the Track object for trackPool and other relevant lists.


rebuildTrack

public static void rebuildTrack(Track track)
Rebuilds the Track relevant lists.


containsTrack

public static boolean containsTrack(java.lang.String id)
Returns true if the Track object exists in the trackPool.


getTrack

public static Track getTrack(java.lang.String id)
Returns the Track object for the given ID.

Notes:
Should throw an exception if 'id' is not found.

trackIterator

public static java.util.Iterator trackIterator()
Returns a iterator over all Tracks in trackPool.


renameTrack

public static void renameTrack(java.lang.String oldID,
                               java.lang.String newID)
Changes the Track's ID in trackPool, trackList, and trackBySequenceList.


renameTrack

public static void renameTrack(Track track,
                               java.lang.String newID)
Changes the Track's ID in trackPool, trackList, and trackBySequenceList.


getTrackBySequenceList

public static java.util.TreeSet getTrackBySequenceList(java.lang.String id)
Get the trackList that contains all Tracks with the given Sequence.


addFeature

public static void addFeature(Feature feature)
Add a Feature to the featurePool.


addSequence

public static void addSequence(Sequence sequence)
                        throws InvalidIDException
Add a Sequence to the sequencePool.

Throws:
InvalidIDException

removeSequence

public static void removeSequence(Sequence sequence)
Removes the Sequence object for sequencePool and other relevant lists.


containsSequence

public static boolean containsSequence(java.lang.String id)
Returns true if the Sequence object exists in the sequencePool.


sequenceIterator

public static java.util.Iterator sequenceIterator()
Returns a iterator over all Sequences in sequencePool.


getSequence

public static Sequence getSequence(java.lang.String id)
Returns the Sequence object for the given ID.

Notes:
Should throw an exception if 'id' is not found.



Copyright 2012 Stephen Fisher and Junhyong Kim, University of Pennsylvania. All Rights Reserved.