git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into features/JAL-845splitPaneMergeDevelop
[jalview.git]
/
src
/
jalview
/
datamodel
/
AlignmentAnnotation.java
diff --git
a/src/jalview/datamodel/AlignmentAnnotation.java
b/src/jalview/datamodel/AlignmentAnnotation.java
index
09d9ee0
..
5282000
100755
(executable)
--- a/
src/jalview/datamodel/AlignmentAnnotation.java
+++ b/
src/jalview/datamodel/AlignmentAnnotation.java
@@
-27,9
+27,8
@@
import jalview.analysis.WUSSParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashMap;
-import java.util.Hashtable;
+import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Map;
import java.util.Map.Entry;
@@
-155,7
+154,7
@@
public class AlignmentAnnotation
/**
* map of positions in the associated annotation
*/
/**
* map of positions in the associated annotation
*/
- public java.util.Hashtable<Integer, Annotation> sequenceMapping;
+ private Map<Integer, Annotation> sequenceMapping;
/** DOCUMENT ME!! */
public float graphMin;
/** DOCUMENT ME!! */
public float graphMin;
@@
-499,6
+498,7
@@
public class AlignmentAnnotation
: annotations[index + offset].secondaryStructure);
}
: annotations[index + offset].secondaryStructure);
}
+ @Override
public String toString()
{
char[] string = new char[max - offset];
public String toString()
{
char[] string = new char[max - offset];
@@
-710,12
+710,13
@@
public class AlignmentAnnotation
if (annotation.sequenceMapping != null)
{
Integer p = null;
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!
{
// could optimise this!
- p = (Integer) pos.nextElement();
+ p = pos.next();
Annotation a = annotation.sequenceMapping.get(p);
if (a == null)
{
Annotation a = annotation.sequenceMapping.get(p);
if (a == null)
{
@@
-789,11
+790,11
@@
public class AlignmentAnnotation
int epos = sequenceRef.findPosition(endRes);
if (sequenceMapping != 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));
if (pos.intValue() >= spos && pos.intValue() <= epos)
{
newmapping.put(pos, sequenceMapping.get(pos));
@@
-836,9
+837,10
@@
public class AlignmentAnnotation
*
* @return DOCUMENT ME!
*/
*
* @return DOCUMENT ME!
*/
+ @Override
public String toString()
{
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder(256);
for (int i = 0; i < annotations.length; i++)
{
for (int i = 0; i < annotations.length; i++)
{
@@
-911,7
+913,7
@@
public class AlignmentAnnotation
{
return;
}
{
return;
}
- sequenceMapping = new java.util.Hashtable();
+ sequenceMapping = new HashMap<Integer, Annotation>();
int seqPos;
int seqPos;
@@
-1223,7
+1225,7
@@
public class AlignmentAnnotation
.getTo() == sq.getDatasetSequence()) : false;
// TODO build a better annotation element map and get rid of annotations[]
.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 (sequenceMapping != null)
{
if (sp2sq != null)
@@
-1275,7
+1277,8
@@
public class AlignmentAnnotation
{
if (mapping != 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)
{
int index = -1;
for (int mp[] : mapping)
{