Class ArrayMetaMethod

java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.runtime.dgmimpl.arrays.ArrayMetaMethod
All Implemented Interfaces:
MetaMember, Cloneable
Direct Known Subclasses:
ArrayGetAtMetaMethod, ArrayPutAtMetaMethod

public abstract class ArrayMetaMethod extends MetaMethod
Shared meta-method base for array getAt and putAt.
  • Field Details

    • INTEGER_CLASS

      protected static final CachedClass INTEGER_CLASS
      Cached Integer class, the index type for array getAt and putAt.
    • INTEGER_CLASS_ARR

      protected static final CachedClass[] INTEGER_CLASS_ARR
      One-element parameter list containing INTEGER_CLASS.
  • Constructor Details

    • ArrayMetaMethod

      public ArrayMetaMethod()
  • Method Details

    • normaliseIndex

      protected static int normaliseIndex(int i, int size)
      Maps a negative index from the end of the array. An index that is still negative after adding size is rejected. A non-negative index is returned unchanged, even when it is past the end.
      Parameters:
      i - the requested index, which may be negative
      size - the array length added to a negative index
      Returns:
      i when i is non-negative, otherwise i + size
    • getModifiers

      public int getModifiers()
      Description copied from class: MetaMethod
      Returns the modifiers of this method.
      Specified by:
      getModifiers in interface MetaMember
      Specified by:
      getModifiers in class MetaMethod
      Returns:
      modifiers as an int.