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
JAL-3453 Some tests require different Desktop constructor
[jalview.git]
/
src
/
jalview
/
datamodel
/
Alignment.java
diff --git
a/src/jalview/datamodel/Alignment.java
b/src/jalview/datamodel/Alignment.java
index
98510e3
..
7b97d49
100755
(executable)
--- a/
src/jalview/datamodel/Alignment.java
+++ b/
src/jalview/datamodel/Alignment.java
@@
-42,13
+42,13
@@
import java.util.Vector;
/**
* Data structure to hold and manipulate a multiple sequence alignment
/**
* Data structure to hold and manipulate a multiple sequence alignment
- */
-/**
- * @author JimP
*
*
+ * @author JimP
*/
public class Alignment implements AlignmentI
{
*/
public class Alignment implements AlignmentI
{
+ private static final SequenceGroup[] NO_GROUPS = new SequenceGroup[0];
+
private Alignment dataset;
private List<SequenceI> sequences;
private Alignment dataset;
private List<SequenceI> sequences;
@@
-59,6
+59,13
@@
public class Alignment implements AlignmentI
private boolean nucleotide = true;
private boolean nucleotide = true;
+ private List<AlignedCodonFrame> codonFrameList;
+
+ /*
+ * persistent object to hold result of findAllGroups(SequenceI)
+ */
+ private List<SequenceGroup> groupsForSequence = new ArrayList<>();
+
public boolean hasRNAStructure = false;
public AlignmentAnnotation[] annotations;
public boolean hasRNAStructure = false;
public AlignmentAnnotation[] annotations;
@@
-69,8
+76,6
@@
public class Alignment implements AlignmentI
public Hashtable alignmentProperties;
public Hashtable alignmentProperties;
- private List<AlignedCodonFrame> codonFrameList;
-
private void initAlignment(SequenceI[] seqs)
{
groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
private void initAlignment(SequenceI[] seqs)
{
groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
@@
-398,10
+403,6
@@
public class Alignment implements AlignmentI
return null;
}
return null;
}
- private static final SequenceGroup[] noGroups = new SequenceGroup[0];
-
- private ArrayList<SequenceGroup> temp = new ArrayList<>();
-
/*
* (non-Javadoc)
*
/*
* (non-Javadoc)
*
@@
-411,15
+412,14
@@
public class Alignment implements AlignmentI
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
-
synchronized (groups)
{
int gSize = groups.size();
if (gSize == 0)
{
synchronized (groups)
{
int gSize = groups.size();
if (gSize == 0)
{
- return noGroups;
+ return NO_GROUPS;
}
}
- temp.clear();
+ groupsForSequence.clear();
for (int i = 0; i < gSize; i++)
{
SequenceGroup sg = groups.get(i);
for (int i = 0; i < gSize; i++)
{
SequenceGroup sg = groups.get(i);
@@
-432,12
+432,12
@@
public class Alignment implements AlignmentI
if (sg.getSequences().contains(s))
{
if (sg.getSequences().contains(s))
{
- temp.add(sg);
+ groupsForSequence.add(sg);
}
}
}
}
}
}
- SequenceGroup[] ret = new SequenceGroup[temp.size()];
- return temp.toArray(ret);
+ SequenceGroup[] ret = new SequenceGroup[groupsForSequence.size()];
+ return groupsForSequence.toArray(ret);
}
/** */
}
/** */
@@
-2034,17
+2034,4
@@
public class Alignment implements AlignmentI
}
}
}
}
- @Override
- public void resetColors()
- {
- for (int i = getHeight(); --i >= 0;)
- {
- sequences.get(i).resetColors();
- }
- // if (dataset != null)
- // {
- // dataset.resetColors();
- // }
- }
-
}
}