class JNarrowedClass extends JClass
Modifier and Type | Field and Description |
---|---|
private java.util.List<JClass> |
args
Arguments to those parameters.
|
(package private) JClass |
basis
A generic class with type parameters.
|
EMPTY_ARRAY
Constructor and Description |
---|
JNarrowedClass(JClass basis,
JClass arg) |
JNarrowedClass(JClass basis,
java.util.List<JClass> args) |
Modifier and Type | Method and Description |
---|---|
JClass |
_extends()
Gets the super class of this class.
|
java.util.Iterator<JClass> |
_implements()
Iterates all super interfaces directly implemented by
this class/interface.
|
JPackage |
_package()
Gets the package to which this class belongs.
|
java.lang.String |
binaryName()
Gets the binary name of the type.
|
boolean |
equals(java.lang.Object obj) |
JClass |
erasure()
Returns the erasure of this type.
|
java.lang.String |
fullName()
Gets the full name of the type.
|
void |
generate(JFormatter f) |
java.util.List<JClass> |
getTypeParameters()
If this class is parameterized, return the type parameter of the given index.
|
int |
hashCode() |
boolean |
isAbstract()
Checks if this class is an abstract class.
|
boolean |
isArray()
Tell whether or not this is an array type.
|
boolean |
isInterface()
Checks if this object represents an interface.
|
java.lang.String |
name()
Gets the name of this class.
|
JClass |
narrow(JClass... clazz) |
JClass |
narrow(JClass clazz)
"Narrows" a generic class to a concrete class by specifying
a type argument.
|
(package private) void |
printLink(JFormatter f)
Prints the class name in javadoc @link format.
|
protected JClass |
substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings)
Substitutes the type variables with their actual arguments.
|
array, boxify, dotclass, getBaseClass, getBaseClass, getPrimitiveType, isAssignableFrom, isParameterized, narrow, narrow, narrow, narrow, outer, owner, staticInvoke, staticInvoke, staticRef, staticRef, superWildcard, toString, typeParams, unboxify, wildcard
compareTo, elementType, isPrimitive, isReference, parse
final JClass basis
private final java.util.List<JClass> args
public JClass narrow(JClass clazz)
JClass
.narrow(X)
builds Set<X>
from Set
.
public java.lang.String name()
JClass
public java.lang.String fullName()
JType
public java.lang.String binaryName()
JType
binaryName
in class JType
public void generate(JFormatter f)
generate
in interface JGenerable
generate
in class JClass
void printLink(JFormatter f)
JClass
public JPackage _package()
JClass
public JClass _extends()
JClass
_extends
in class JClass
JClass
.
Even if no super class is given explicitly or this JClass
is not a class, this method still returns
JClass
for Object
.
If this JClass represents Object
, return null.public java.util.Iterator<JClass> _implements()
JClass
_implements
in class JClass
JClass
objects that represents those interfaces
implemented by this object.public JClass erasure()
JType
public boolean isInterface()
JClass
isInterface
in class JClass
public boolean isAbstract()
JClass
isAbstract
in class JClass
public boolean isArray()
JType
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected JClass substituteParams(JTypeVar[] variables, java.util.List<JClass> bindings)
JClass
For example, when this class is Map<String,Map<V>>,
(where V then doing
substituteParams( V, Integer ) returns a JClass
for Map<String,Map<Integer>>
.
This method needs to work recursively.
substituteParams
in class JClass
public java.util.List<JClass> getTypeParameters()
JClass
getTypeParameters
in class JClass