package jalview.datamodel.features;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
* @param featureType
* @return
*/
- public Iterable<String> getAttributes(String featureType)
+ public List<String> getAttributes(String featureType)
{
if (!attributes.containsKey(featureType))
{
- return Collections.emptySet();
+ return Collections.<String> emptyList();
}
- return attributes.get(featureType);
+ return new ArrayList<>(attributes.get(featureType));
+ }
+
+ /**
+ * Answers true if at least one attribute is known for the given feature type,
+ * else false
+ *
+ * @param featureType
+ * @return
+ */
+ public boolean hasAttributes(String featureType)
+ {
+
+ if (attributes.containsKey(featureType))
+ {
+ if (!attributes.get(featureType).isEmpty())
+ {
+ return true;
+ }
+ }
+ return false;
}
/**