Class MethodInfoList
java.lang.Object
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<MethodInfo>, Collection<MethodInfo>, List<MethodInfo>, RandomAccess, SequencedCollection<MethodInfo>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFilter anMethodInfoListusing a predicate mapping anMethodInfoobject to a boolean, producing anotherMethodInfoListfor all items in the list for which the predicate is true. -
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new modifiable empty list ofMethodInfoobjects.MethodInfoList(int sizeHint) Construct a new modifiable empty list ofMethodInfoobjects, given a size hint.MethodInfoList(Collection<MethodInfo> methodInfoCollection) Construct a new modifiable emptyMethodInfoList, given an initial collection ofMethodInfoobjects. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, MethodInfo element) booleanadd(MethodInfo element) booleanaddAll(int index, Collection<? extends MethodInfo> c) booleanaddAll(Collection<? extends MethodInfo> c) asMap()Get thisMethodInfoListas a map from method name to aMethodInfoListof methods with that name.voidclear()booleancontainsName(String methodName) Check whether the list contains a method with the given name.static MethodInfoListReturn an unmodifiable emptyMethodInfoList.Find the subset of theMethodInfoobjects in this list for which the given filter predicate is true.protected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced in the type descriptor or type signature.Returns a list of all methods matching a given name.getSingleMethod(String methodName) Returns a single method with the given name, or null if not found.iterator()remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) set(int index, MethodInfo element) Methods inherited from class InfoList
equals, getAsStrings, getAsStringsWithSimpleNames, getNames, hashCodeMethods 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
-
Constructor Details
-
MethodInfoList
public MethodInfoList()Construct a new modifiable empty list ofMethodInfoobjects. -
MethodInfoList
public MethodInfoList(int sizeHint) Construct a new modifiable empty list ofMethodInfoobjects, given a size hint.- Parameters:
sizeHint- the size hint
-
MethodInfoList
Construct a new modifiable emptyMethodInfoList, given an initial collection ofMethodInfoobjects.- Parameters:
methodInfoCollection- the collection ofMethodInfoobjects.
-
-
Method Details
-
emptyList
Return an unmodifiable emptyMethodInfoList.- Returns:
- the unmodifiable empty
MethodInfoList.
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced in the type descriptor or type signature.- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
asMap
Get thisMethodInfoListas a map from method name to aMethodInfoListof methods with that name.- Returns:
- This
MethodInfoListas a map from method name to aMethodInfoListof methods with that name.
-
containsName
Check whether the list contains a method with the given name.- Parameters:
methodName- The name of a class.- Returns:
- true if the list contains a method with the given name.
-
get
Returns a list of all methods matching a given name. (There may be more than one method with a given name, due to overloading, so this returns aMethodInfoListrather than a singleMethodInfo.)- Parameters:
methodName- The name of a method.- Returns:
- A
MethodInfoListofMethodInfoobjects from this list that have the given name (there may be more than one method with a given name, due to overloading, so this returns aMethodInfoListrather than a singleMethodInfo). Returns the empty list if no method had a matching name.
-
getSingleMethod
Returns a single method with the given name, or null if not found. ThrowsIllegalArgumentExceptionif there are two methods with the given name.- Parameters:
methodName- The name of a method.- Returns:
- The
MethodInfoobject from the list with the given name, if there is exactly one method with the given name. Returns null if there were no methods with the given name. - Throws:
IllegalArgumentException- if there are two or more methods with the given name.
-
filter
Find the subset of theMethodInfoobjects in this list for which the given filter predicate is true.- Parameters:
filter- TheMethodInfoList.MethodInfoFilterto apply.- Returns:
- The subset of the
MethodInfoobjects in this list for which the given filter predicate is true.
-
add
-
add
-
remove
-
remove
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
-
set
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Overrides:
listIteratorin classArrayList<T>
-