Package gw.internal.gosu.parser
Class GosuArrayClass
- java.lang.Object
-
- gw.lang.reflect.AbstractType
-
- gw.lang.reflect.DefaultArrayType
-
- gw.internal.gosu.parser.GosuArrayClass
-
- All Implemented Interfaces:
IGosuArrayClass,IDefaultArrayType,IEnhanceableType,IHasJavaClass,IType,java.io.Serializable
public class GosuArrayClass extends DefaultArrayType implements IGosuArrayClass
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private LockingLazyVar<IJavaClassInfo>_lazyConcreteClass-
Fields inherited from class gw.lang.reflect.DefaultArrayType
INTERFACES
-
Fields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST
-
-
Constructor Summary
Constructors Constructor Description GosuArrayClass(IType componentType, ITypeLoader typeLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetArrayComponent(java.lang.Object array, int iIndex)Returns the value of the indexed component in the specified array object.intgetArrayLength(java.lang.Object array)Returns the length of the specified array object.IJavaClassInfogetConcreteClass()private int[]getDims(java.lang.Integer depth, int iLength)private Pair<java.lang.Integer,java.lang.Class>getGosuClassDepthPair(IType component, int depth)booleanhasGosuClassAtRoot(IType component)java.lang.ObjectmakeArrayInstance(int iLength)Construct an array instance of specified length.protected IGosuArrayClassmakeArrayType()Allows subclasses to return a more specific interfacesvoidsetArrayComponent(java.lang.Object array, int iIndex, java.lang.Object value)Sets the value of the indexed component in the specified array object.-
Methods inherited from class gw.lang.reflect.DefaultArrayType
getAllTypesInHierarchy, getArrayType, getBackingClass, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getGenericType, getGenericTypeVariables, getInterfaces, getModifiers, getName, getNamespace, getParameterizedType, getRelativeName, getSupertype, getThisRef, getTypeInfo, getTypeLoader, getTypeParameters, isAbstract, isArray, isAssignableFrom, isCompoundType, isDiscarded, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, readResolve, setDiscarded, toString, unloadTypeInfo
-
Methods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType, getTheRef
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.IType
compile, getAllTypesInHierarchy, getArrayType, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getFunctionalInterface, getGenericType, getGenericTypeVariables, getInterfaces, getLiteralMetaType, getMetaType, getModifiers, getName, getNamespace, getParameterizedType, getRelativeName, getSourceFiles, getSupertype, getTypeInfo, getTypeLoader, getTypeParameters, isAbstract, isArray, isAssignableFrom, isCompilable, isCompoundType, isDiscarded, isDynamic, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, readResolve, setDiscarded, unloadTypeInfo
-
-
-
-
Field Detail
-
_lazyConcreteClass
private LockingLazyVar<IJavaClassInfo> _lazyConcreteClass
-
-
Constructor Detail
-
GosuArrayClass
public GosuArrayClass(IType componentType, ITypeLoader typeLoader)
-
-
Method Detail
-
makeArrayType
protected IGosuArrayClass makeArrayType()
Description copied from class:DefaultArrayTypeAllows subclasses to return a more specific interfaces- Overrides:
makeArrayTypein classDefaultArrayType
-
makeArrayInstance
public java.lang.Object makeArrayInstance(int iLength)
Description copied from interface:ITypeConstruct an array instance of specified length.- Specified by:
makeArrayInstancein interfaceIType- Overrides:
makeArrayInstancein classDefaultArrayType
-
getDims
private int[] getDims(java.lang.Integer depth, int iLength)
-
getArrayComponent
public java.lang.Object getArrayComponent(java.lang.Object array, int iIndex) throws java.lang.IllegalArgumentException, java.lang.ArrayIndexOutOfBoundsExceptionDescription copied from interface:ITypeReturns the value of the indexed component in the specified array object.- Specified by:
getArrayComponentin interfaceIType- Overrides:
getArrayComponentin classDefaultArrayType- Parameters:
array- An array instance of this intrinsic type.iIndex- The index of the component to get.- Returns:
- The value of the indexed component in the specified array.
- Throws:
java.lang.IllegalArgumentException- If the specified object is not an array.java.lang.ArrayIndexOutOfBoundsException- If the specified index argument is negative, or if it is greater than or equal to the length of the specified array
-
setArrayComponent
public void setArrayComponent(java.lang.Object array, int iIndex, java.lang.Object value) throws java.lang.IllegalArgumentException, java.lang.ArrayIndexOutOfBoundsExceptionDescription copied from interface:ITypeSets the value of the indexed component in the specified array object.- Specified by:
setArrayComponentin interfaceIType- Overrides:
setArrayComponentin classDefaultArrayType- Parameters:
array- An array instance of this intrinsic type.iIndex- The index of the component to set.value- The new value of the indexed component.- Throws:
java.lang.IllegalArgumentException- If the specified object is not an array.java.lang.ArrayIndexOutOfBoundsException- If the specified index argument is negative, or if it is greater than or equal to the length of the specified array
-
getArrayLength
public int getArrayLength(java.lang.Object array) throws java.lang.IllegalArgumentExceptionDescription copied from interface:ITypeReturns the length of the specified array object.- Specified by:
getArrayLengthin interfaceIType- Overrides:
getArrayLengthin classDefaultArrayType- Parameters:
array- An array instance of this intrinsic type.- Returns:
- The length of the array.
- Throws:
java.lang.IllegalArgumentException- If the object argument is not an array.
-
hasGosuClassAtRoot
public boolean hasGosuClassAtRoot(IType component)
-
getConcreteClass
public IJavaClassInfo getConcreteClass()
- Specified by:
getConcreteClassin interfaceIDefaultArrayType- Overrides:
getConcreteClassin classDefaultArrayType
-
-