data
Class Mapping<T,U>

java.lang.Object
  extended by data.Mapping<T,U>

public class Mapping<T,U>
extends java.lang.Object

Mapping of spotIDs to corresponding indices of RNA sets

Author:
Stefanie Kaufmann

Constructor Summary
Mapping()
          Constructor to initialize the Mapping
 
Method Summary
 void addMap(T spotId, U attribute)
          add the values to the internal map as well as to the map containing the inverted values (attribute --> spotID)
 void changeMap(T spotId, U attribute)
          Change the attribute of a specific spotID
 boolean containsAttribute(U attribute)
          Returns true if the given attribute exists in the Mapping
 boolean containsSpot(T spotId)
          Returns true if the given key exists in the Mapping
 U getAttribute(T spotId)
          Retrieves the attribute for one given key
 java.util.ArrayList<T> getSpotId(U attribute)
          Retrieves the list of keys for one given attribute
 java.util.Iterator<T> iterate()
          Provides an iterator to iterate over the keys of the Mapping
 java.util.Iterator<T> iterateSpots(U attr)
          Provides an iterator to iterate over the keys corresponding to a certain attribute
 int mapSize()
          Returns the size of the Mapping (=number of entries)
 void removeAllSpots(java.util.ArrayList<T> spots)
          Removes all keys given in a list
 void removeAttribute(U attribute)
          Removes all entries corresponding to a specific attribute from the Mapping
 void removeSpot(T spotId)
          Removes a given key from the Mapping
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping()
Constructor to initialize the Mapping

Method Detail

addMap

public void addMap(T spotId,
                   U attribute)
add the values to the internal map as well as to the map containing the inverted values (attribute --> spotID)

Parameters:
spotId -
attribute -

removeSpot

public void removeSpot(T spotId)
Removes a given key from the Mapping

Parameters:
spotId - Key that will be removed

removeAllSpots

public void removeAllSpots(java.util.ArrayList<T> spots)
Removes all keys given in a list

Parameters:
spots - List of keys that will be removed

removeAttribute

public void removeAttribute(U attribute)
Removes all entries corresponding to a specific attribute from the Mapping

Parameters:
attribute - Attribute for which all corresponding entries will be removed

changeMap

public void changeMap(T spotId,
                      U attribute)
Change the attribute of a specific spotID

Parameters:
spotId -
attribute -

containsSpot

public boolean containsSpot(T spotId)
Returns true if the given key exists in the Mapping

Parameters:
spotId -
Returns:
true if key exists

containsAttribute

public boolean containsAttribute(U attribute)
Returns true if the given attribute exists in the Mapping

Parameters:
attribute -
Returns:
true if the attribute exists

iterate

public java.util.Iterator<T> iterate()
Provides an iterator to iterate over the keys of the Mapping

Returns:
Iterator over keyset

iterateSpots

public java.util.Iterator<T> iterateSpots(U attr)
Provides an iterator to iterate over the keys corresponding to a certain attribute


getSpotId

public java.util.ArrayList<T> getSpotId(U attribute)
Retrieves the list of keys for one given attribute

Parameters:
attribute - The attribute for which the list of keys will be given
Returns:
The list of keys corresponding to the attribute

getAttribute

public U getAttribute(T spotId)
Retrieves the attribute for one given key

Parameters:
spotId - The key for which the attribute will be given
Returns:
The attribute corresponding to the given key

mapSize

public int mapSize()
Returns the size of the Mapping (=number of entries)

Returns:
size of the Mapping