Package gw.lang.reflect
Class MethodList
- All Implemented Interfaces:
Iterable<IMethodInfo>,Collection<IMethodInfo>,List<IMethodInfo>,RandomAccess
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate HashMap<String,DynamicArray<IMethodInfo>> static final MethodListFields inherited from class gw.util.DynamicArray
data, sizeFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsModifierConstructorDescriptionMethodList(int size) protectedMethodList(MethodList source) MethodList(List<IMethodInfo> methods) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, IMethodInfo method) Inserts the specified element at the specified position in this list.booleanadd(IMethodInfo method) Appends the specified element to the end of this list.booleanaddAll(int index, Collection<? extends IMethodInfo> c) Inserts all of the elements in the specified collection into this list, starting at the specified position.booleanaddAll(Collection<? extends IMethodInfo> c) 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.private voidaddToMap(IMethodInfo method) voidclear()Removes all of the elements from this list.copy()Returns a shallow copy of this ArrayList instance.filterMethods(IRelativeTypeInfo.Accessibility accessibility) findAssignableMethod(IMethodInfo miTo, boolean bStatic, TypeVarToTypeMap inferenceMap) DynamicArray<? extends IMethodInfo>getMethods(String name) intReturns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.static ITypemaybeInferParamType(TypeVarToTypeMap inferenceMap, IType ownersType, IType fromParamType, IType toParamType) static ITypemaybeInferReturnType(TypeVarToTypeMap inferenceMap, IType ownersType, IType fromReturnType, IType toReturnType) remove(int index) Removes the element at the specified position in this list.booleanRemoves the first occurrence of the specified element from this list, if it is present.booleanremoveAll(Collection<?> c) protected voidremoveRange(int fromIndex, int toIndex) Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.booleanretainAll(Collection<?> c) set(int index, IMethodInfo method) Replaces the element at the specified position in this list with the specified element.static MethodListsingleton(IMethodInfo theOneMethod) Methods inherited from class gw.util.DynamicArray
contains, ensureCapacity, get, isEmpty, lastIndexOf, size, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subListMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, replaceAll, sort, spliterator, subList
-
Field Details
-
EMPTY
-
_map
-
-
Constructor Details
-
MethodList
public MethodList() -
MethodList
-
MethodList
public MethodList(int size) -
MethodList
-
-
Method Details
-
copy
Description copied from class:DynamicArrayReturns a shallow copy of this ArrayList instance. (The elements themselves are not copied.)- Overrides:
copyin classDynamicArray<IMethodInfo>- Returns:
- a copy of this DynamicArray instance
-
filterMethods
-
add
Description copied from class:DynamicArrayAppends the specified element to the end of this list.- Specified by:
addin interfaceCollection<IMethodInfo>- Specified by:
addin interfaceList<IMethodInfo>- Overrides:
addin classDynamicArray<IMethodInfo>- Parameters:
method- element to be appended to this list- Returns:
- true (as specified by
Collection.add(E))
-
addAll
Description copied from class:DynamicArrayAppends 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:
addAllin interfaceCollection<IMethodInfo>- Specified by:
addAllin interfaceList<IMethodInfo>- Overrides:
addAllin classDynamicArray<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
-
remove
Description copied from class:DynamicArrayRemoves the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).- Specified by:
removein interfaceList<IMethodInfo>- Overrides:
removein classDynamicArray<IMethodInfo>- Parameters:
index- the index of the element to be removed- Returns:
- the element that was removed from the list
-
set
Description copied from class:DynamicArrayReplaces the element at the specified position in this list with the specified element.- Specified by:
setin interfaceList<IMethodInfo>- Overrides:
setin classDynamicArray<IMethodInfo>- Parameters:
index- index of the element to replacemethod- element to be stored at the specified position- Returns:
- the element previously at the specified position
-
indexOf
Description copied from class:DynamicArrayReturns 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:
indexOfin interfaceList<IMethodInfo>- Overrides:
indexOfin classDynamicArray<IMethodInfo>
-
getMethods
-
singleton
-
add
Description copied from class:DynamicArrayInserts 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:
addin interfaceList<IMethodInfo>- Overrides:
addin classDynamicArray<IMethodInfo>- Parameters:
index- index at which the specified element is to be insertedmethod- element to be inserted
-
addAll
Description copied from class:DynamicArrayInserts 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:
addAllin interfaceList<IMethodInfo>- Overrides:
addAllin classDynamicArray<IMethodInfo>- Parameters:
index- index at which to insert the first element from the specified collectionc- collection containing elements to be added to this list- Returns:
- true if this list changed as a result of the call
-
remove
Description copied from class:DynamicArrayRemoves 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:
removein interfaceCollection<IMethodInfo>- Specified by:
removein interfaceList<IMethodInfo>- Overrides:
removein classDynamicArray<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:DynamicArrayRemoves 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:
removeRangein classDynamicArray<IMethodInfo>- Parameters:
fromIndex- index of first element to be removedtoIndex- index after last element to be removed
-
clear
public void clear()Description copied from class:DynamicArrayRemoves all of the elements from this list. The list will be empty after this call returns.- Specified by:
clearin interfaceCollection<IMethodInfo>- Specified by:
clearin interfaceList<IMethodInfo>- Overrides:
clearin classDynamicArray<IMethodInfo>
-
removeAll
- Specified by:
removeAllin interfaceCollection<IMethodInfo>- Specified by:
removeAllin interfaceList<IMethodInfo>- Overrides:
removeAllin classAbstractCollection<IMethodInfo>
-
retainAll
- Specified by:
retainAllin interfaceCollection<IMethodInfo>- Specified by:
retainAllin interfaceList<IMethodInfo>- Overrides:
retainAllin classAbstractCollection<IMethodInfo>
-
findAssignableMethod
public IMethodInfo findAssignableMethod(IMethodInfo miTo, boolean bStatic, TypeVarToTypeMap inferenceMap) -
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)
-