import jalview.api.DBRefEntryI;
import java.util.Arrays;
+import java.util.List;
public class DBRefEntry implements DBRefEntryI
{
}
@Override
- public boolean isPrimary()
+ public boolean isPrimaryCandidate()
{
/*
* if a map is present, unless it is 1:1 and has no SequenceI mate, it cannot be a primary reference.
{
return false;
}
- // check map is really 1:1, no shifts allowed.
- if (map.getMap().getFromHighest() != map.getMap().getToHighest()
- && map.getMap().getFromLowest() != map.getMap().getToLowest()
- && !Arrays.equals(
- map.getMap().getFromRanges().toArray(new int[0][]),
- map.getMap().getToRanges().toArray(new int[0][])))
+ // check map is between identical single contiguous ranges
+ List<int[]> fromRanges = map.getMap().getFromRanges();
+ List<int[]> toRanges = map.getMap().getToRanges();
+ if (fromRanges.size() != 1 || toRanges.size() != 1)
+ {
+ return false;
+ }
+ if (fromRanges.get(0)[0] != toRanges.get(0)[0]
+ || fromRanges.get(0)[1] != toRanges.get(0)[1])
{
return false;
}