Class MappableInfoList<T extends HasName>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
io.github.classgraph.PotentiallyUnmodifiableList<T>
io.github.classgraph.InfoList<T>
io.github.classgraph.MappableInfoList<T>
- Type Parameters:
T- the element type
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, SequencedCollection<T>
- Direct Known Subclasses:
AnnotationInfoList, AnnotationParameterValueList, ClassInfoList, FieldInfoList, ModuleInfoList, PackageInfoList
-
Field Summary
FieldsFields inherited from class PotentiallyUnmodifiableList
modifiableFields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.MappableInfoList(int sizeHint) Constructor.MappableInfoList(Collection<T> infoCollection) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionasMap()Get an index for this list, as a map from the name of each list item (obtained by callinggetName()on each list item) to the list item.booleancontainsName(String name) Check if this list contains an item with the given name.Get the list item with the given name, or null if not found.Methods inherited from class InfoList
equals, getAsStrings, getAsStringsWithSimpleNames, getNames, hashCodeMethods inherited from class PotentiallyUnmodifiableList
add, add, addAll, addAll, clear, iterator, listIterator, makeUnmodifiable, remove, remove, removeAll, retainAll, setMethods inherited from class ArrayList
addFirst, addLast, clone, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, lastIndexOf, listIterator, removeFirst, removeIf, removeLast, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDserialVersionUID- See Also:
-
-
Constructor Details
-
MappableInfoList
MappableInfoList()Constructor. -
MappableInfoList
MappableInfoList(int sizeHint) Constructor.- Parameters:
sizeHint- the size hint
-
MappableInfoList
MappableInfoList(Collection<T> infoCollection) Constructor.- Parameters:
infoCollection- the initial elements
-
-
Method Details
-
asMap
Get an index for this list, as a map from the name of each list item (obtained by callinggetName()on each list item) to the list item.- Returns:
- An index for this list, as a map from the name of each list item (obtained by calling
getName()on each list item) to the list item.
-
containsName
Check if this list contains an item with the given name.- Parameters:
name- The name to search for.- Returns:
- true if this list contains an item with the given name.
-
get
-