X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fviewmodel%2Fseqfeatures%2FFeaturesDisplayed.java;h=f44a2d178fc174f77b2360e407201138d6f34454;hb=136c0793b90b72b928c4d77dc109dd5c644e00d3;hp=b04764c01ea0d1fe00c22fb6ef4b5f916c8a8285;hpb=7a2f4e9ee4119f0369743e7996bcebbb6ab46f9e;p=jalview.git
diff --git a/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java b/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java
index b04764c..f44a2d1 100644
--- a/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java
+++ b/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java
@@ -1,24 +1,43 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.viewmodel.seqfeatures;
import jalview.api.FeaturesDisplayedI;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
+import java.util.Set;
public class FeaturesDisplayed implements FeaturesDisplayedI
{
- private HashSet featuresDisplayed = new HashSet();
+ private Set featuresDisplayed = new HashSet();
- private HashSet featuresRegistered = new HashSet();
+ private Set featuresRegistered = new HashSet();
public FeaturesDisplayed(FeaturesDisplayedI featuresDisplayed2)
{
- Iterator fdisp = featuresDisplayed2.getVisibleFeatures();
- String ftype;
- while (fdisp.hasNext())
+ Set fdisp = featuresDisplayed2.getVisibleFeatures();
+ for (String ftype : fdisp)
{
- ftype = fdisp.next();
featuresDisplayed.add(ftype);
featuresRegistered.add(ftype);
}
@@ -26,13 +45,12 @@ public class FeaturesDisplayed implements FeaturesDisplayedI
public FeaturesDisplayed()
{
- // TODO Auto-generated constructor stub
}
@Override
- public Iterator getVisibleFeatures()
+ public Set getVisibleFeatures()
{
- return featuresDisplayed.iterator();
+ return Collections.unmodifiableSet(featuresDisplayed);
}
@Override
@@ -42,7 +60,7 @@ public class FeaturesDisplayed implements FeaturesDisplayedI
}
@Override
- public boolean areVisible(Collection featureTypes)
+ public boolean areVisible(Collection featureTypes)
{
return featuresDisplayed.containsAll(featureTypes);
}
@@ -55,7 +73,7 @@ public class FeaturesDisplayed implements FeaturesDisplayedI
}
@Override
- public void setAllVisible(Collection makeVisible)
+ public void setAllVisible(Collection makeVisible)
{
featuresDisplayed.addAll(makeVisible);
featuresRegistered.addAll(makeVisible);
@@ -87,7 +105,7 @@ public class FeaturesDisplayed implements FeaturesDisplayedI
}
@Override
- public int getRegisterdFeaturesCount()
+ public int getRegisteredFeaturesCount()
{
return featuresRegistered.size();
}