Constructor and Description |
---|
FeatureNameList()
Create with no names (an empty list).
|
FeatureNameList(List<String> list) |
FeatureNameList(java.util.stream.Stream<String> stream)
Create from a stream of names.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String name)
Adds a feature-name.
|
List<String> |
asList()
Exposes the underlying list of names.
|
FeatureNameMapToIndex |
createMapToIndex()
Creates a map from the feature-names to their indices in the list.
|
FeatureNameList |
duplicateShallow()
Shallow copy of the current instance.
|
String |
get(int index)
Gets a name corresponding to a particular position.
|
void |
insertBeginning(String name)
Inserts a new feature-name at the beginning of the list.
|
void |
insertBeginning(String[] names)
Inserts new feature-names at the beginning of the list.
|
Iterator<String> |
iterator() |
int |
size()
The number of names in the list.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public FeatureNameList()
public FeatureNameList(java.util.stream.Stream<String> stream)
stream
- the stream.public List<String> asList()
public FeatureNameMapToIndex createMapToIndex()
public FeatureNameList duplicateShallow()
public void add(String name)
name
- the name to add.public void insertBeginning(String name)
name
- feature-name to insert.public void insertBeginning(String[] names)
names
- the feature-names to insert.public String get(int index)
index
- the position of the name in the list (zero-indexed).public int size()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.