Package io.github.classgraph
Class MappableInfoList<T extends HasName>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
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
- Direct Known Subclasses:
AnnotationInfoList
,AnnotationParameterValueList
,ClassInfoList
,FieldInfoList
,ModuleInfoList
,PackageInfoList
A list of named objects that can be indexed by name.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends T> c) boolean
addAll
(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.void
clear()
boolean
containsName
(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) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) Methods inherited from class io.github.classgraph.InfoList
equals, getAsStrings, getAsStringsWithSimpleNames, getNames, hashCode
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
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:
listIterator
in interfaceList<T>
- Overrides:
listIterator
in classArrayList<T>
-