public class ParametricType extends Object
Template types are resolved at code-generation type rather than at Instruction generation type. They let you bind the concrete type for opcodes at the last minute, so the same max conditional could be used for all primative types, with the type only being bound at the last moment.
Two ParametricType instances are the same if they are the same object, regardless of their names.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccept(CodeClass cc) |
static ParametricType |
createArrayType(String name)
Create a new ParametricType that claims to resolve to an array type.
|
static ParametricType |
createObjectType(String name)
Create a new ParametricType that claims to resolve to an object type.
|
static ParametricType |
createPrimitiveType(String name)
Create a new ParametricType that claims to resolve to a primative type.
|
static ParametricType |
createType(String name)
Create a new ParametricType that claims nothing.
|
static ParametricType |
createType(String name,
CodeClass[] classes)
Create a new ParametricType that claims to be castable to all the classes
in a list.
|
CodeClass[] |
getClasses() |
String |
getName()
Get the name of this type.
|
boolean |
isArray() |
boolean |
isObject() |
boolean |
isPrimitive()
Discover if this type must resolve to a primative.
|
String |
toString() |
public static ParametricType createType(String name)
name
- the name given to this typepublic static ParametricType createPrimitiveType(String name)
name
- the name given to this typepublic static ParametricType createObjectType(String name)
name
- the name given to this typepublic static ParametricType createArrayType(String name)
name
- the name given to this typepublic static ParametricType createType(String name, CodeClass[] classes)
name
- the name given to this typeclasses
- an array of Class objects that any bound type must be
castable topublic String getName()
public boolean isPrimitive()
It is an error for a parametric type to resolve to a non-primative if this flag is set.
public boolean isObject()
public boolean isArray()
public CodeClass[] getClasses()
Copyright © 2014 BioJava. All rights reserved.