Top Inners Fields Constructors Methods
org.codehaus.groovy.reflection

public Class CachedClass

extends Object
Class Inheritance
Known Direct Subclasses
org.codehaus.groovy.reflection.stdclasses.ArrayCachedClass, org.codehaus.groovy.reflection.stdclasses.BooleanCachedClass, org.codehaus.groovy.reflection.stdclasses.CachedClosureClass, org.codehaus.groovy.reflection.stdclasses.CachedSAMClass, org.codehaus.groovy.reflection.stdclasses.CharacterCachedClass, org.codehaus.groovy.reflection.stdclasses.NumberCachedClass, org.codehaus.groovy.reflection.stdclasses.ObjectCachedClass, org.codehaus.groovy.reflection.stdclasses.StringCachedClass
Imports
groovy.lang.Closure, .ExpandoMetaClass, .GroovyRuntimeException, .MetaClass, .MetaClassImpl, .MetaMethod, org.codehaus.groovy.classgen.asm.BytecodeHelper, org.codehaus.groovy.runtime.callsite.CallSiteClassLoader, org.codehaus.groovy.runtime.metaclass.ClosureMetaClass, org.codehaus.groovy.util.FastArray, .LazyReference, .ReferenceBundle, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Arrays, .Collection, .Collections, .Comparator, .HashSet, .LinkedHashSet, .List, .Set

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final Class<?>
private LazyReference<CachedClass>
private final LazyReference<CallSiteClassLoader>
public ClassInfo
private LazyReference<CachedConstructor[]>
private final LazyReference<Set<CachedClass>>
pack-priv int
public static final CachedClass[]
private final LazyReference<CachedField[]>
pack-priv int
private final LazyReference<Collection<ClassInfo>>
private final LazyReference<Set<CachedClass>>
public final boolean
public final boolean
public final boolean
public final boolean
private final LazyReference<CachedMethod[]>
public final int
public CachedMethod[]
private static ReferenceBundle

Constructor Summary

AccessConstructor and Description
public
CachedClass(Class<?> klazz, ClassInfo classInfo)

Method Summary

Modifier and TypeMethod and Description
public void
private void
public Object
public CachedClass

Returns:

this
getCachedClass
()

compatibility method

public CachedClass
public CallSiteClassLoader
public CachedConstructor[]
public Set<CachedClass>
public CachedField[]
public Collection<ClassInfo>
public Set<CachedClass>
public CachedMethod[]
public int
public String
public MetaMethod[]
public int
public final Class<T>
public String
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
isAssignableFrom(Class<T> argument)

public boolean
public boolean
public boolean
public boolean
public CachedMethod
searchMethods(String name, CachedClass[] parameterTypes)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

cachedClassback to summary
private final Class<?> cachedClass
cachedSuperClassback to summary
private LazyReference<CachedClass> cachedSuperClass
callSiteClassLoaderback to summary
private final LazyReference<CallSiteClassLoader> callSiteClassLoader
classInfoback to summary
public ClassInfo classInfo
constructorsback to summary
private LazyReference<CachedConstructor[]> constructors
declaredInterfacesback to summary
private final LazyReference<Set<CachedClass>> declaredInterfaces
distanceback to summary
pack-priv int distance
EMPTY_ARRAYback to summary
public static final CachedClass[] EMPTY_ARRAY
fieldsback to summary
private final LazyReference<CachedField[]> fields
hashCodeback to summary
pack-priv int hashCode
hierarchyback to summary
private final LazyReference<Collection<ClassInfo>> hierarchy
interfacesback to summary
private final LazyReference<Set<CachedClass>> interfaces
isArrayback to summary
public final boolean isArray
isInterfaceback to summary
public final boolean isInterface
isNumberback to summary
public final boolean isNumber
isPrimitiveback to summary
public final boolean isPrimitive
methodsback to summary
private final LazyReference<CachedMethod[]> methods
modifiersback to summary
public final int modifiers
mopMethodsback to summary
public CachedMethod[] mopMethods
softBundleback to summary
private static ReferenceBundle softBundle

Constructor Detail

CachedClassback to summary
public CachedClass(Class<?> klazz, ClassInfo classInfo)

Method Detail

addNewMopMethodsback to summary
public void addNewMopMethods(List<MetaMethod> arr)
addSubclassExpandosback to summary
private void addSubclassExpandos(List<MetaMethod> arr, MetaClass mc)
coerceArgumentback to summary
public Object coerceArgument(Object argument)
getCachedClassback to summary
public CachedClass getCachedClass()

compatibility method

Returns:CachedClass

this

getCachedSuperClassback to summary
public CachedClass getCachedSuperClass()
getCallSiteLoaderback to summary
public CallSiteClassLoader getCallSiteLoader()
getConstructorsback to summary
public CachedConstructor[] getConstructors()
getDeclaredInterfacesback to summary
public Set<CachedClass> getDeclaredInterfaces()
getFieldsback to summary
public CachedField[] getFields()
getHierarchyback to summary
public Collection<ClassInfo> getHierarchy()
getInterfacesback to summary
public Set<CachedClass> getInterfaces()
getMethodsback to summary
public CachedMethod[] getMethods()
getModifiersback to summary
public int getModifiers()
getNameback to summary
public String getName()
getNewMetaMethodsback to summary
public MetaMethod[] getNewMetaMethods()
getSuperClassDistanceback to summary
public int getSuperClassDistance()
getTheClassback to summary
public final Class<T> getTheClass()
getTypeDescriptionback to summary
public String getTypeDescription()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isAssignableFromback to summary
public boolean isAssignableFrom(Class<T> argument)
isDirectlyAssignableback to summary
public boolean isDirectlyAssignable(Object argument)
isInterfaceback to summary
public boolean isInterface()
isPrimitiveback to summary
public boolean isPrimitive()
isVoidback to summary
public boolean isVoid()
searchMethodsback to summary
public CachedMethod searchMethods(String name, CachedClass[] parameterTypes)
setNewMopMethodsback to summary
public void setNewMopMethods(List<MetaMethod> arr)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
updateAddNewMopMethodsback to summary
private void updateAddNewMopMethods(List<MetaMethod> arr)
updateSetNewMopMethodsback to summary
private void updateSetNewMopMethods(List<MetaMethod> arr)
org.codehaus.groovy.reflection back to summary

public Class CachedClass.CachedMethodComparatorByName

extends Object
implements Comparator<CachedMethod>
Class Inheritance
  • java.lang.Object
  • org.codehaus.groovy.reflection.CachedClass.CachedMethodComparatorByName
All Implemented Interfaces
java.util.Comparator

Field Summary

Modifier and TypeField and Description
public static final Comparator<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
compare(CachedMethod
the first object to be compared.
o1
,
CachedMethod
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final Comparator<T> INSTANCE

Constructor Detail

CachedMethodComparatorByNameback to summary
public CachedMethodComparatorByName()

Method Detail

compareback to summary
public int compare(CachedMethod o1, CachedMethod o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:CachedMethod

the first object to be compared.

o2:CachedMethod

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
org.codehaus.groovy.reflection back to summary

public Class CachedClass.CachedMethodComparatorWithString

extends Object
implements Comparator
Class Inheritance
  • java.lang.Object
  • org.codehaus.groovy.reflection.CachedClass.CachedMethodComparatorWithString
All Implemented Interfaces
java.util.Comparator

Field Summary

Modifier and TypeField and Description
public static final Comparator<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
compare(Object
the first object to be compared.
o1
,
Object
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final Comparator<T> INSTANCE

Constructor Detail

CachedMethodComparatorWithStringback to summary
public CachedMethodComparatorWithString()

Method Detail

compareback to summary
public int compare(Object o1, Object o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:Object

the first object to be compared.

o2:Object

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override