X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureStore.java;fp=src%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureStore.java;h=eb5688c6b9ef303e19b3344b73ae858c1b7e55ef;hb=c0501eaa85c0594f9275766f64de8ea44a59c368;hp=7651016f6283a390fe21934ae627a4ef750f7b93;hpb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;p=jalview.git diff --git a/src/jalview/datamodel/features/FeatureStore.java b/src/jalview/datamodel/features/FeatureStore.java index 7651016..eb5688c 100644 --- a/src/jalview/datamodel/features/FeatureStore.java +++ b/src/jalview/datamodel/features/FeatureStore.java @@ -182,18 +182,17 @@ public class FeatureStore { if (feature.isNonPositional()) { - return nonPositionalFeatures == null ? false : nonPositionalFeatures - .contains(feature); + return nonPositionalFeatures == null ? false + : nonPositionalFeatures.contains(feature); } if (feature.isContactFeature()) { - return contactFeatureStarts == null ? false : listContains( - contactFeatureStarts, feature); + return contactFeatureStarts == null ? false + : listContains(contactFeatureStarts, feature); } - return features == null ? false : features - .contains(feature); + return features == null ? false : features.contains(feature); } /** @@ -280,13 +279,12 @@ public class FeatureStore true, Compare.GE, feature.getBegin()); contactFeatureStarts.add(insertPosition, feature); - /* * insert into list sorted by end (second contact position): * binary search the sorted list to find the insertion point */ - insertPosition = BinarySearcher.findFirst(contactFeatureEnds, - false, Compare.GE, feature.getEnd()); + insertPosition = BinarySearcher.findFirst(contactFeatureEnds, false, + Compare.GE, feature.getEnd()); contactFeatureEnds.add(insertPosition, feature); return true; @@ -395,16 +393,16 @@ public class FeatureStore * find the first contact feature (if any) * whose end point is not before the target range */ - int index = BinarySearcher.findFirst(contactFeatureEnds, - false, Compare.GE, (int) from); + int index = BinarySearcher.findFirst(contactFeatureEnds, false, + Compare.GE, (int) from); while (index < contactFeatureEnds.size()) { SequenceFeature sf = contactFeatureEnds.get(index); if (!sf.isContactFeature()) { - System.err.println("Error! non-contact feature type " - + sf.getType() + " in contact features list"); + System.err.println("Error! non-contact feature type " + sf.getType() + + " in contact features list"); index++; continue; } @@ -448,8 +446,8 @@ public class FeatureStore protected void findContactStartOverlaps(long from, long to, List result) { - int index = BinarySearcher.findFirst(contactFeatureStarts, - true, Compare.GE, (int) from); + int index = BinarySearcher.findFirst(contactFeatureStarts, true, + Compare.GE, (int) from); while (index < contactFeatureStarts.size()) { @@ -675,10 +673,9 @@ public class FeatureStore public boolean isEmpty() { boolean hasFeatures = (contactFeatureStarts != null - && !contactFeatureStarts - .isEmpty()) - || (nonPositionalFeatures != null && !nonPositionalFeatures - .isEmpty()) + && !contactFeatureStarts.isEmpty()) + || (nonPositionalFeatures != null + && !nonPositionalFeatures.isEmpty()) || (features != null && features.size() > 0); return !hasFeatures; @@ -700,9 +697,9 @@ public class FeatureStore } else { - return nonPositionalFeatureGroups == null ? Collections - . emptySet() : Collections - .unmodifiableSet(nonPositionalFeatureGroups); + return nonPositionalFeatureGroups == null + ? Collections. emptySet() + : Collections.unmodifiableSet(nonPositionalFeatureGroups); } } @@ -717,8 +714,8 @@ public class FeatureStore { if (!positional) { - return nonPositionalFeatures == null ? 0 : nonPositionalFeatures - .size(); + return nonPositionalFeatures == null ? 0 + : nonPositionalFeatures.size(); } int size = 0; @@ -802,8 +799,8 @@ public class FeatureStore for (SequenceFeature sf : sfs) { String featureGroup = sf.getFeatureGroup(); - if (group == null && featureGroup == null || group != null - && group.equals(featureGroup)) + if (group == null && featureGroup == null + || group != null && group.equals(featureGroup)) { result.add(sf); }