Class MethodInfoList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<MethodInfo>, Collection<MethodInfo>, List<MethodInfo>, RandomAccess, SequencedCollection<MethodInfo>

public class MethodInfoList extends InfoList<MethodInfo>
A list of MethodInfo objects.
See Also:
  • Field Details

  • Constructor Details

    • MethodInfoList

      public MethodInfoList()
      Construct a new modifiable empty list of MethodInfo objects.
    • MethodInfoList

      public MethodInfoList(int sizeHint)
      Construct a new modifiable empty list of MethodInfo objects, given a size hint.
      Parameters:
      sizeHint - the size hint
    • MethodInfoList

      public MethodInfoList(Collection<MethodInfo> methodInfoCollection)
      Construct a new modifiable empty MethodInfoList, given an initial collection of MethodInfo objects.
      Parameters:
      methodInfoCollection - the collection of MethodInfo objects.
  • Method Details

    • emptyList

      public static MethodInfoList emptyList()
      Return an unmodifiable empty MethodInfoList.
      Returns:
      the unmodifiable empty MethodInfoList.
    • findReferencedClassInfo

      protected void findReferencedClassInfo(Map<String,ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log)
      Get ClassInfo objects for any classes referenced in the type descriptor or type signature.
      Parameters:
      classNameToClassInfo - the map from class name to ClassInfo.
      refdClassInfo - the referenced class info
      log - the log
    • asMap

      public Map<String,MethodInfoList> asMap()
      Get this MethodInfoList as a map from method name to a MethodInfoList of methods with that name.
      Returns:
      This MethodInfoList as a map from method name to a MethodInfoList of methods with that name.
    • containsName

      public boolean containsName(String methodName)
      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

      public MethodInfoList get(String methodName)
      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 a MethodInfoList rather than a single MethodInfo.)
      Parameters:
      methodName - The name of a method.
      Returns:
      A MethodInfoList of MethodInfo objects 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 a MethodInfoList rather than a single MethodInfo). Returns the empty list if no method had a matching name.
    • getSingleMethod

      public MethodInfo getSingleMethod(String methodName)
      Returns a single method with the given name, or null if not found. Throws IllegalArgumentException if there are two methods with the given name.
      Parameters:
      methodName - The name of a method.
      Returns:
      The MethodInfo object 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 the MethodInfo objects in this list for which the given filter predicate is true.
      Parameters:
      filter - The MethodInfoList.MethodInfoFilter to apply.
      Returns:
      The subset of the MethodInfo objects in this list for which the given filter predicate is true.