Package io.github.classgraph
Class MappableInfoList<T extends HasName>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<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
A list of named objects that can be indexed by name.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends T> c) booleanaddAll(Collection<? extends T> c) 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.voidclear()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.iterator()remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) Methods inherited from class io.github.classgraph.InfoList
equals, getAsStrings, getAsStringsWithSimpleNames, getNames, hashCodeMethods inherited from class java.util.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 java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
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
Get the list item with the given name, or null if not found.- Parameters:
name- The name to search for.- Returns:
- The list item with the given name, or null if not found.
-
add
-
add
-
remove
-
remove
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
set
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Overrides:
listIteratorin classArrayList<T>
-