aicas logo Jamaica 3.4 release 8

sun.reflect.generics.reflectiveObjects
Class ParameterizedTypeImpl

java.lang.Object
  extended by sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
All Implemented Interfaces:
ParameterizedType, Type

public class ParameterizedTypeImpl
extends Object
implements ParameterizedType

Implementing class for ParameterizedType interface.


Method Summary
 boolean equals(Object o)
          equals compares this object to another object.
 Type[] getActualTypeArguments()
          Returns an array of Type objects representing the actual type arguments to this type.
 Type getOwnerType()
          Returns a Type object representing the type that this type is a member of.
 Class<?> getRawType()
          Returns the Type object representing the class or interface that declared this type.
 int hashCode()
          hashCode returns a hash code for this object.
static ParameterizedTypeImpl make(Class<?> rawType, Type[] actualTypeArguments, Type ownerType)
          Static factory.
 String toString()
          toString creates a printable string that represents this object for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public static ParameterizedTypeImpl make(Class<?> rawType,
                                         Type[] actualTypeArguments,
                                         Type ownerType)
Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type.

This method throws a MalformedParameterizedTypeException under the following circumstances: If the number of actual type arguments (i.e., the size of the array typeArgs) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.

Parameters:
rawType - the Class representing the generic type declaration being instantiated
actualTypeArguments - - a (possibly empty) array of types representing the actual type arguments to the parameterized type
ownerType - - the enclosing type, if known.
Returns:
An instance of ParameterizedType
Throws:
MalformedParameterizedTypeException - - if the instantiation is invalid

getActualTypeArguments

public Type[] getActualTypeArguments()
Returns an array of Type objects representing the actual type arguments to this type.

Note that in some cases, the returned array be empty. This can occur if this type represents a non-parameterized type nested within a parameterized type.

Specified by:
getActualTypeArguments in interface ParameterizedType
Returns:
an array of Type objects representing the actual type arguments to this type
Throws:
TypeNotPresentException - if any of the actual type arguments refers to a non-existent type declaration
MalformedParameterizedTypeException - if any of the actual type parameters refer to a parameterized type that cannot be instantiated for any reason
Since:
1.5

getRawType

public Class<?> getRawType()
Returns the Type object representing the class or interface that declared this type.

Specified by:
getRawType in interface ParameterizedType
Returns:
the Type object representing the class or interface that declared this type

getOwnerType

public Type getOwnerType()
Returns a Type object representing the type that this type is a member of. For example, if this type is O.I, return a representation of O.

If this type is a top-level type, null is returned.

Specified by:
getOwnerType in interface ParameterizedType
Returns:
a Type object representing the type that this type is a member of. If this type is a top-level type, null is returned
Throws:
TypeNotPresentException - if the owner type refers to a non-existent type declaration
MalformedParameterizedTypeException - if the owner type refers to a parameterized type that cannot be instantiated for any reason

equals

public boolean equals(Object o)
Description copied from class: Object
equals compares this object to another object.

Equals must be symmetric (a.equals(b) == b.equals(a)), reflexive (a.equals(a)==true) and transitive (a.equals(b) && b.equals(c) IMPLIES (a.equals(c))) and not change over time (a.equals(b) == a.equals(b)). a.equals(null) should always return false.

If a.equals(b) is true for two objects a and b, then a.hashCode()==b.hashCode() must hold.

The default implementation of equals returns this==other.

Overrides:
equals in class Object
Parameters:
o - the other object.
Returns:
if this and other are considered equal.

hashCode

public int hashCode()
Description copied from class: Object
hashCode returns a hash code for this object. The hash code must be equal for two objects a and b if a.equals(b) is true.

The default implementation returns System.identityHashCode(this).

Overrides:
hashCode in class Object
Returns:
a hash code value.

toString

public String toString()
Description copied from class: Object
toString creates a printable string that represents this object for debugging purposes.

The default implementation returns getClass().getName() + '@' + Integer.toHexString(hashCode()).

Overrides:
toString in class Object
Returns:
a string identifying this object.

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.