import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Enumeration;
import java.util.HashMap;
-import java.util.Hashtable;
+import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
/**
* map of positions in the associated annotation
*/
- public java.util.Hashtable<Integer, Annotation> sequenceMapping;
+ private Map<Integer, Annotation> sequenceMapping;
/** DOCUMENT ME!! */
public float graphMin;
: annotations[index + offset].secondaryStructure);
}
+ @Override
public String toString()
{
char[] string = new char[max - offset];
if (annotation.sequenceMapping != null)
{
Integer p = null;
- sequenceMapping = new Hashtable();
- Enumeration pos = annotation.sequenceMapping.keys();
- while (pos.hasMoreElements())
+ sequenceMapping = new HashMap<Integer, Annotation>();
+ Iterator<Integer> pos = annotation.sequenceMapping.keySet()
+ .iterator();
+ while (pos.hasNext())
{
// could optimise this!
- p = (Integer) pos.nextElement();
+ p = pos.next();
Annotation a = annotation.sequenceMapping.get(p);
if (a == null)
{
int epos = sequenceRef.findPosition(endRes);
if (sequenceMapping != null)
{
- Hashtable newmapping = new Hashtable();
- Enumeration e = sequenceMapping.keys();
- while (e.hasMoreElements())
+ Map<Integer, Annotation> newmapping = new HashMap<Integer, Annotation>();
+ Iterator<Integer> e = sequenceMapping.keySet().iterator();
+ while (e.hasNext())
{
- Integer pos = (Integer) e.nextElement();
+ Integer pos = e.next();
if (pos.intValue() >= spos && pos.intValue() <= epos)
{
newmapping.put(pos, sequenceMapping.get(pos));
*
* @return DOCUMENT ME!
*/
+ @Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder(256);
for (int i = 0; i < annotations.length; i++)
{
{
return;
}
- sequenceMapping = new java.util.Hashtable();
+ sequenceMapping = new HashMap<Integer, Annotation>();
int seqPos;
.getTo() == sq.getDatasetSequence()) : false;
// TODO build a better annotation element map and get rid of annotations[]
- Hashtable<Integer, Annotation> mapForsq = new Hashtable();
+ Map<Integer, Annotation> mapForsq = new HashMap<Integer, Annotation>();
if (sequenceMapping != null)
{
if (sp2sq != null)
{
if (mapping != null)
{
- Hashtable<Integer, Annotation> old = sequenceMapping, remap = new Hashtable<Integer, Annotation>();
+ Map<Integer, Annotation> old = sequenceMapping;
+ Map<Integer, Annotation> remap = new HashMap<Integer, Annotation>();
int index = -1;
for (int mp[] : mapping)
{