Class MethodList

All Implemented Interfaces:
Iterable<IMethodInfo>, Collection<IMethodInfo>, List<IMethodInfo>, RandomAccess

public class MethodList extends DynamicArray<IMethodInfo>
  • Field Details

  • Constructor Details

    • MethodList

      public MethodList()
    • MethodList

      public MethodList(List<IMethodInfo> methods)
    • MethodList

      public MethodList(int size)
    • MethodList

      protected MethodList(MethodList source)
  • Method Details

    • copy

      public MethodList copy()
      Description copied from class: DynamicArray
      Returns a shallow copy of this ArrayList instance. (The elements themselves are not copied.)
      Overrides:
      copy in class DynamicArray<IMethodInfo>
      Returns:
      a copy of this DynamicArray instance
    • filterMethods

      public MethodList filterMethods(IRelativeTypeInfo.Accessibility accessibility)
    • add

      public boolean add(IMethodInfo method)
      Description copied from class: DynamicArray
      Appends the specified element to the end of this list.
      Specified by:
      add in interface Collection<IMethodInfo>
      Specified by:
      add in interface List<IMethodInfo>
      Overrides:
      add in class DynamicArray<IMethodInfo>
      Parameters:
      method - element to be appended to this list
      Returns:
      true (as specified by Collection.add(E))
    • addAll

      public boolean addAll(Collection<? extends IMethodInfo> c)
      Description copied from class: DynamicArray
      Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this list, and this list is nonempty.)
      Specified by:
      addAll in interface Collection<IMethodInfo>
      Specified by:
      addAll in interface List<IMethodInfo>
      Overrides:
      addAll in class DynamicArray<IMethodInfo>
      Parameters:
      c - collection containing elements to be added to this list
      Returns:
      true if this list changed as a result of the call
    • addToMap

      private void addToMap(IMethodInfo method)
    • remove

      public IMethodInfo remove(int index)
      Description copied from class: DynamicArray
      Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
      Specified by:
      remove in interface List<IMethodInfo>
      Overrides:
      remove in class DynamicArray<IMethodInfo>
      Parameters:
      index - the index of the element to be removed
      Returns:
      the element that was removed from the list
    • set

      public IMethodInfo set(int index, IMethodInfo method)
      Description copied from class: DynamicArray
      Replaces the element at the specified position in this list with the specified element.
      Specified by:
      set in interface List<IMethodInfo>
      Overrides:
      set in class DynamicArray<IMethodInfo>
      Parameters:
      index - index of the element to replace
      method - element to be stored at the specified position
      Returns:
      the element previously at the specified position
    • indexOf

      public int indexOf(Object o)
      Description copied from class: DynamicArray
      Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
      Specified by:
      indexOf in interface List<IMethodInfo>
      Overrides:
      indexOf in class DynamicArray<IMethodInfo>
    • getMethods

      public DynamicArray<? extends IMethodInfo> getMethods(String name)
    • singleton

      public static MethodList singleton(IMethodInfo theOneMethod)
    • add

      public void add(int index, IMethodInfo method)
      Description copied from class: DynamicArray
      Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      Specified by:
      add in interface List<IMethodInfo>
      Overrides:
      add in class DynamicArray<IMethodInfo>
      Parameters:
      index - index at which the specified element is to be inserted
      method - element to be inserted
    • addAll

      public boolean addAll(int index, Collection<? extends IMethodInfo> c)
      Description copied from class: DynamicArray
      Inserts all of the elements in the specified collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified collection's iterator.
      Specified by:
      addAll in interface List<IMethodInfo>
      Overrides:
      addAll in class DynamicArray<IMethodInfo>
      Parameters:
      index - index at which to insert the first element from the specified collection
      c - collection containing elements to be added to this list
      Returns:
      true if this list changed as a result of the call
    • remove

      public boolean remove(Object o)
      Description copied from class: DynamicArray
      Removes the first occurrence of the specified element from this list, if it is present. If the list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists). Returns true if this list contained the specified element (or equivalently, if this list changed as a result of the call).
      Specified by:
      remove in interface Collection<IMethodInfo>
      Specified by:
      remove in interface List<IMethodInfo>
      Overrides:
      remove in class DynamicArray<IMethodInfo>
      Parameters:
      o - element to be removed from this list, if present
      Returns:
      true if this list contained the specified element
    • removeRange

      protected void removeRange(int fromIndex, int toIndex)
      Description copied from class: DynamicArray
      Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)
      Overrides:
      removeRange in class DynamicArray<IMethodInfo>
      Parameters:
      fromIndex - index of first element to be removed
      toIndex - index after last element to be removed
    • clear

      public void clear()
      Description copied from class: DynamicArray
      Removes all of the elements from this list. The list will be empty after this call returns.
      Specified by:
      clear in interface Collection<IMethodInfo>
      Specified by:
      clear in interface List<IMethodInfo>
      Overrides:
      clear in class DynamicArray<IMethodInfo>
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<IMethodInfo>
      Specified by:
      removeAll in interface List<IMethodInfo>
      Overrides:
      removeAll in class AbstractCollection<IMethodInfo>
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<IMethodInfo>
      Specified by:
      retainAll in interface List<IMethodInfo>
      Overrides:
      retainAll in class AbstractCollection<IMethodInfo>
    • findAssignableMethod

      public IMethodInfo findAssignableMethod(IMethodInfo miTo, boolean bStatic, TypeVarToTypeMap inferenceMap)
    • getMethodBuckets

      public Collection<DynamicArray<IMethodInfo>> getMethodBuckets()
    • maybeInferParamType

      public static IType maybeInferParamType(TypeVarToTypeMap inferenceMap, IType ownersType, IType fromParamType, IType toParamType)
    • maybeInferReturnType

      public static IType maybeInferReturnType(TypeVarToTypeMap inferenceMap, IType ownersType, IType fromReturnType, IType toReturnType)