|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TypeSystem
defines the types of the language and
how they are related.
Method Summary | |
Flags |
Abstract()
|
ClassType |
ArithmeticException()
java.lang.ArithmeticException |
ArrayType |
arrayOf(Position pos,
Type type)
Return an array of type |
ArrayType |
arrayOf(Position pos,
Type type,
int dims)
Return a dims -array of type |
ArrayType |
arrayOf(Type type)
Return an array of type |
ArrayType |
arrayOf(Type type,
int dims)
Return a dims -array of type |
ClassType |
ArrayStoreException()
java.lang.ArrayStoreException |
PrimitiveType |
Boolean()
boolean |
PrimitiveType |
Byte()
byte |
boolean |
callValid(ProcedureInstance mi,
java.util.List argTypes)
Return true if pi can be called with
actual parameters of types actualTypes . |
boolean |
canCoerceToString(Type t,
Context c)
Returns true iff the type t can be coerced to a String in the given Context. |
boolean |
canOverride(MethodInstance mi,
MethodInstance mj)
Return true if mi can override mj . |
PrimitiveType |
Char()
char |
void |
checkAccessFlags(Flags f)
Assert if the flags f are legal access flags. |
void |
checkClassConformance(ClassType ct)
Assert that ct implements all abstract methods that it
has to; that is, if it is a concrete class, then it must implement all
interfaces and abstract methods that it or its superclasses declare. |
void |
checkConstructorFlags(Flags f)
Assert if the flags f are legal constructor flags. |
void |
checkCycles(ReferenceType t)
Assert that t has no cycles in the super type+nested class
graph starting at t . |
void |
checkFieldFlags(Flags f)
Assert if the flags f are legal field flags. |
void |
checkInitializerFlags(Flags f)
Assert if the flags f are legal initializer flags. |
void |
checkLocalClassFlags(Flags f)
Assert if the flags f are legal local class flags. |
void |
checkLocalFlags(Flags f)
Assert if the flags f are legal local variable flags. |
void |
checkMemberClassFlags(Flags f)
Assert if the flags f are legal member class flags. |
void |
checkMethodFlags(Flags f)
Assert if the flags f are legal method flags. |
void |
checkOverride(MethodInstance mi,
MethodInstance mj)
Throw a SemanticException if mi cannot override
mj . |
void |
checkTopLevelClassFlags(Flags f)
Assert if the flags f are legal top-level class flags. |
ClassType |
Class()
java.lang.Class |
boolean |
classAccessible(ClassType ct,
Context context)
Checks whether a class can be accessed from Context context. |
boolean |
classAccessibleFromPackage(ClassType ct,
Package pkg)
Checks whether a top-level or member class can be accessed from the package pkg. |
ClassType |
ClassCastException()
java.lang.ClassCastException |
Resolver |
classContextResolver(ClassType ct)
Get a resolver for looking up a type in a class context. |
ClassType |
Cloneable()
java.lang.Cloneable |
ConstructorInstance |
constructorInstance(Position pos,
ClassType container,
Flags flags,
java.util.List argTypes,
java.util.List excTypes)
Create a constructor instance. |
ParsedClassType |
createClassType()
Create a new empty class. |
ParsedClassType |
createClassType(LazyClassInitializer init)
Create a new empty class. |
ParsedClassType |
createClassType(LazyClassInitializer init,
Source fromSource)
Create a new empty class. |
ParsedClassType |
createClassType(Source fromSource)
Create a new empty class. |
Context |
createContext()
Create a new context object for looking up variables, types, etc. |
Flags |
createNewFlag(java.lang.String name,
Flags print_after)
Create a new unique Flags object. |
Package |
createPackage(Package prefix,
java.lang.String name)
Return a package by name with the given outer package. |
Package |
createPackage(java.lang.String name)
Return a package by name. |
LazyClassInitializer |
defaultClassInitializer()
The default lazy class initializer. |
ConstructorInstance |
defaultConstructor(Position pos,
ClassType container)
Create a default constructor instance. |
java.util.List |
defaultPackageImports()
Return a list of the packages names that will be imported by default. |
boolean |
descendsFrom(Type child,
Type ancestor)
Returns true iff child is not ancestor, but child descends from ancestor. |
PrimitiveType |
Double()
double |
boolean |
equals(TypeObject type1,
TypeObject type2)
Returns true iff type1 and type2 represent the same type object. |
ClassType |
Error()
java.lang.Error |
ClassType |
Exception()
java.lang.Exception |
FieldInstance |
fieldInstance(Position pos,
ReferenceType container,
Flags flags,
Type type,
java.lang.String name)
Create a field instance. |
Flags |
Final()
|
ConstructorInstance |
findConstructor(ClassType container,
java.util.List argTypes,
ClassType currClass)
Find a constructor. |
ConstructorInstance |
findConstructor(ClassType container,
java.util.List argTypes,
Context c)
Deprecated. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name)
Returns the field named 'name' defined on 'type'. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name,
ClassType currClass)
Returns the field named 'name' defined on 'type'. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name,
Context c)
Deprecated. |
ClassType |
findMemberClass(ClassType container,
java.lang.String name)
Find a member class. |
ClassType |
findMemberClass(ClassType container,
java.lang.String name,
ClassType currClass)
Find a member class. |
ClassType |
findMemberClass(ClassType container,
java.lang.String name,
Context c)
Deprecated. |
MethodInstance |
findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
ClassType currClass)
Find a method. |
MethodInstance |
findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
Context c)
Deprecated. |
Flags |
flagsForBits(int bits)
Given the JVM encoding of a set of flags, returns the Flags object for that encoding. |
PrimitiveType |
Float()
float |
Named |
forName(java.lang.String name)
Get the named type object with the following name. |
java.lang.String |
getTransformedClassName(ClassType ct)
Get the transformed class name of a class. |
java.util.Set |
getTypeEncoderRootSet(Type clazz)
Return the set of objects that should be serialized into the type information for the given ClassType. |
boolean |
hasEnclosingInstance(ClassType inner,
ClassType encl)
Returns whether an object of the inner class inner has an
enclosing instance of class encl . |
boolean |
hasFormals(ProcedureInstance p,
java.util.List formalTypes)
Returns true iff p has exactly the formal arguments
formalTypes . |
boolean |
hasMethod(ReferenceType t,
MethodInstance mi)
Returns true iff t has the method mi . |
boolean |
hasMethodNamed(ReferenceType t,
java.lang.String name)
Returns true iff t has a method with name name
either defined in t or inherited into it. |
java.util.List |
implemented(MethodInstance mi)
Get the list of methods mi implements, in no
specified order. |
ImportTable |
importTable(Package pkg)
Create an import table for the source file. |
ImportTable |
importTable(java.lang.String sourceName,
Package pkg)
Create an import table for the source file. |
void |
initialize(LoadedClassResolver resolver,
ExtensionInfo extInfo)
Initialize the type system with the compiler. |
InitializerInstance |
initializerInstance(Position pos,
ClassType container,
Flags flags)
Create an initailizer instance. |
PrimitiveType |
Int()
int |
Flags |
Interface()
|
java.util.List |
interfaces(ReferenceType type)
Returns an immutable list of all the interface types which type implements. |
boolean |
isAccessible(MemberInstance mi,
Context context)
Checks whether a class member can be accessed from Context context. |
boolean |
isCanonical(Type type)
Returns true iff type is a canonical
(fully qualified) type. |
boolean |
isCastValid(Type fromType,
Type toType)
Returns true iff a cast from fromType to toType is valid; in other words, some non-null members of fromType are also members of toType. |
boolean |
isEnclosed(ClassType inner,
ClassType outer)
Returns whether inner is enclosed within outer |
boolean |
isImplicitCastValid(Type fromType,
Type toType)
Returns true iff an implicit cast from fromType to toType is valid; in other words, every member of fromType is member of toType. |
boolean |
isSameMethod(MethodInstance m1,
MethodInstance m2)
Returns true iff m1 is the same method as m2 . |
boolean |
isSubtype(Type child,
Type ancestor)
Returns true iff child descends from ancestor or child == ancestor. |
boolean |
isThrowable(Type type)
Returns true iff an object of type type may be thrown. |
boolean |
isUncheckedException(Type type)
Returns a true iff the type or a supertype is in the list returned by uncheckedExceptions(). |
Type |
leastCommonAncestor(Type type1,
Type type2)
Returns the least common ancestor of type1 and type2 |
LoadedClassResolver |
loadedResolver()
Return the type system's loaded resolver. |
LocalInstance |
localInstance(Position pos,
Flags flags,
Type type,
java.lang.String name)
Create a local variable instance. |
PrimitiveType |
Long()
long |
boolean |
methodCallValid(MethodInstance mi,
java.lang.String name,
java.util.List argTypes)
Return true if mi can be called with name name
and actual parameters of types actualTypes . |
MethodInstance |
methodInstance(Position pos,
ReferenceType container,
Flags flags,
Type returnType,
java.lang.String name,
java.util.List argTypes,
java.util.List excTypes)
Create a method instance. |
boolean |
moreSpecific(ProcedureInstance m1,
ProcedureInstance m2)
Returns true iff m1 is more specific than m2 . |
Flags |
Native()
|
Flags |
NoFlags()
|
NullType |
Null()
The type of null . |
ClassType |
NullPointerException()
java.lang.NullPointerException |
boolean |
numericConversionValid(Type t,
long value)
Returns true if value can be implicitly cast to type
t . |
boolean |
numericConversionValid(Type t,
java.lang.Object value)
Returns true if value can be implicitly cast to
type t . |
ClassType |
Object()
java.lang.Object |
ClassType |
OutOfBoundsException()
java.lang.ArrayIndexOutOfBoundsException |
java.util.List |
overrides(MethodInstance mi)
Get the list of methods mi (potentially) overrides, in
order from this class (that is, including this ) to super
classes. |
Resolver |
packageContextResolver(Resolver resolver,
Package pkg)
Get a resolver for looking up a type in a package. |
boolean |
packageExists(java.lang.String name)
Returns true if the package named name exists. |
Package |
packageForName(Package prefix,
java.lang.String name)
Return a package by name with the given outer package. |
Package |
packageForName(java.lang.String name)
Return a package by name. |
TableResolver |
parsedResolver()
Return the type system's table resolver. |
java.lang.Object |
placeHolder(TypeObject o)
Get a place-holder for serializing a type object. |
java.lang.Object |
placeHolder(TypeObject o,
java.util.Set roots)
Get a place-holder for serializing a type object. |
PrimitiveType |
primitiveForName(java.lang.String name)
Return the primitive with the given name. |
Flags |
Private()
|
PrimitiveType |
promote(Type t)
Unary promotion for numeric types. |
PrimitiveType |
promote(Type t1,
Type t2)
Binary promotion for numeric types. |
Flags |
Protected()
|
Flags |
Public()
|
ClassType |
RuntimeException()
java.lang.RuntimeException |
ClassType |
Serializable()
java.io.Serializable |
PrimitiveType |
Short()
short |
Flags |
Static()
|
Type |
staticTarget(Type t)
Returns t , modified as necessary to make it a legal
static target. |
Flags |
StrictFP()
|
ClassType |
String()
java.lang.String |
Type |
superType(ReferenceType type)
Returns the immediate supertype of type, or null if type has no supertype. |
Flags |
Synchronized()
|
TopLevelResolver |
systemResolver()
Returns the system resolver. |
ClassType |
Throwable()
java.lang.Throwable |
boolean |
throwsSubset(ProcedureInstance m1,
ProcedureInstance m2)
Returns true iff m1 throws fewer exceptions than
m2 . |
Flags |
Transient()
|
java.lang.String |
translateArray(Resolver c,
ArrayType t)
Translate an array type. |
java.lang.String |
translateClass(Resolver c,
ClassType t)
Translate a top-level class type. |
java.lang.String |
translatePackage(Resolver c,
Package p)
Translate a package. |
java.lang.String |
translatePrimitive(Resolver c,
PrimitiveType t)
Translate a primitive type. |
Type |
typeForName(java.lang.String name)
Get the type with the following name. |
java.util.Collection |
uncheckedExceptions()
Returns a collection of the Throwable types that need not be declared in method and constructor signatures. |
UnknownPackage |
unknownPackage(Position pos)
Get an unknown package. |
UnknownQualifier |
unknownQualifier(Position pos)
Get an unknown type qualifier. |
UnknownType |
unknownType(Position pos)
Get an unknown type. |
PrimitiveType |
Void()
void |
Flags |
Volatile()
|
java.lang.String |
wrapperTypeString(PrimitiveType t)
Return the boxed version of t . |
Method Detail |
public void initialize(LoadedClassResolver resolver, ExtensionInfo extInfo) throws SemanticException
resolver
- The resolver to use for loading types from class files
or other source files.extInfo
- The ExtensionInfo the TypeSystem is being created for.
SemanticException
public TopLevelResolver systemResolver()
public TableResolver parsedResolver()
public LoadedClassResolver loadedResolver()
public ImportTable importTable(java.lang.String sourceName, Package pkg)
sourceName
- Name of the source file to import into. This is used
mainly for error messages and for debugging.pkg
- The package of the source file in which to import.public ImportTable importTable(Package pkg)
pkg
- The package of the source file in which to import.public java.util.List defaultPackageImports()
public boolean packageExists(java.lang.String name)
name
exists.
public Named forName(java.lang.String name) throws SemanticException
name
- The name of the type object to look for.
SemanticException
- when object is not found.public Type typeForName(java.lang.String name) throws SemanticException
name
- The name to create the type for.
SemanticException
- when type is not found.public InitializerInstance initializerInstance(Position pos, ClassType container, Flags flags)
pos
- Position of the initializer.container
- Containing class of the initializer.flags
- The initializer's flags.public ConstructorInstance constructorInstance(Position pos, ClassType container, Flags flags, java.util.List argTypes, java.util.List excTypes)
pos
- Position of the constructor.container
- Containing class of the constructor.flags
- The constructor's flags.argTypes
- The constructor's formal parameter types.excTypes
- The constructor's exception throw types.public MethodInstance methodInstance(Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List argTypes, java.util.List excTypes)
pos
- Position of the method.container
- Containing type of the method.flags
- The method's flags.returnType
- The method's return type.name
- The method's name.argTypes
- The method's formal parameter types.excTypes
- The method's exception throw types.public FieldInstance fieldInstance(Position pos, ReferenceType container, Flags flags, Type type, java.lang.String name)
pos
- Position of the field.container
- Containing type of the field.flags
- The field's flags.type
- The field's type.name
- The field's name.public LocalInstance localInstance(Position pos, Flags flags, Type type, java.lang.String name)
pos
- Position of the local variable.flags
- The local variable's flags.type
- The local variable's type.name
- The local variable's name.public ConstructorInstance defaultConstructor(Position pos, ClassType container)
pos
- Position of the constructor.container
- Containing class of the constructor.public UnknownType unknownType(Position pos)
public UnknownPackage unknownPackage(Position pos)
public UnknownQualifier unknownQualifier(Position pos)
public boolean isSubtype(Type child, Type ancestor)
descendsFrom(child, ancestor) || equals(child, ancestor)
public boolean descendsFrom(Type child, Type ancestor)
public boolean isCastValid(Type fromType, Type toType)
public boolean isImplicitCastValid(Type fromType, Type toType)
public boolean equals(TypeObject type1, TypeObject type2)
public boolean numericConversionValid(Type t, long value)
value
can be implicitly cast to type
t
. This method should be removed. It is kept for backward
compatibility.
public boolean numericConversionValid(Type t, java.lang.Object value)
value
can be implicitly cast to
type t
.
public Type leastCommonAncestor(Type type1, Type type2) throws SemanticException
SemanticException
- if the LCA does not existpublic boolean isCanonical(Type type)
type
is a canonical
(fully qualified) type.
public boolean isAccessible(MemberInstance mi, Context context)
public boolean classAccessible(ClassType ct, Context context)
public boolean classAccessibleFromPackage(ClassType ct, Package pkg)
public boolean isEnclosed(ClassType inner, ClassType outer)
public boolean hasEnclosingInstance(ClassType inner, ClassType encl)
inner
has an
enclosing instance of class encl
.
public boolean canCoerceToString(Type t, Context c)
public boolean isThrowable(Type type)
type
may be thrown.
public boolean isUncheckedException(Type type)
public java.util.Collection uncheckedExceptions()
public PrimitiveType promote(Type t) throws SemanticException
SemanticException
- if the type cannot be promoted.public PrimitiveType promote(Type t1, Type t2) throws SemanticException
SemanticException
- if the types cannot be promoted.public FieldInstance findField(ReferenceType container, java.lang.String name, Context c) throws SemanticException
SemanticException
public FieldInstance findField(ReferenceType container, java.lang.String name, ClassType currClass) throws SemanticException
SemanticException
- if the field cannot be found or is
inaccessible.public FieldInstance findField(ReferenceType container, java.lang.String name) throws SemanticException
SemanticException
- if the field cannot be found or is
inaccessible.public MethodInstance findMethod(ReferenceType container, java.lang.String name, java.util.List argTypes, ClassType currClass) throws SemanticException
SemanticException
- if the method cannot be found or is
inaccessible.public MethodInstance findMethod(ReferenceType container, java.lang.String name, java.util.List argTypes, Context c) throws SemanticException
SemanticException
public ConstructorInstance findConstructor(ClassType container, java.util.List argTypes, ClassType currClass) throws SemanticException
SemanticException
- if the constructor cannot be found or is
inaccessible.public ConstructorInstance findConstructor(ClassType container, java.util.List argTypes, Context c) throws SemanticException
SemanticException
public ClassType findMemberClass(ClassType container, java.lang.String name, ClassType currClass) throws SemanticException
SemanticException
- if the class cannot be found or is
inaccessible.public ClassType findMemberClass(ClassType container, java.lang.String name, Context c) throws SemanticException
SemanticException
public ClassType findMemberClass(ClassType container, java.lang.String name) throws SemanticException
SemanticException
- if the class cannot be found or is
inaccessible.public Type superType(ReferenceType type)
public java.util.List interfaces(ReferenceType type)
public boolean throwsSubset(ProcedureInstance m1, ProcedureInstance m2)
m1
throws fewer exceptions than
m2
.
public boolean hasMethod(ReferenceType t, MethodInstance mi)
t
has the method mi
.
public boolean hasMethodNamed(ReferenceType t, java.lang.String name)
t
has a method with name name
either defined in t
or inherited into it.
public boolean isSameMethod(MethodInstance m1, MethodInstance m2)
m1
is the same method as m2
.
public boolean moreSpecific(ProcedureInstance m1, ProcedureInstance m2)
m1
is more specific than m2
.
public boolean hasFormals(ProcedureInstance p, java.util.List formalTypes)
p
has exactly the formal arguments
formalTypes
.
public NullType Null()
null
.
public PrimitiveType Void()
void
public PrimitiveType Boolean()
boolean
public PrimitiveType Char()
char
public PrimitiveType Byte()
byte
public PrimitiveType Short()
short
public PrimitiveType Int()
int
public PrimitiveType Long()
long
public PrimitiveType Float()
float
public PrimitiveType Double()
double
public ClassType Object()
java.lang.Object
public ClassType String()
java.lang.String
public ClassType Class()
java.lang.Class
public ClassType Throwable()
java.lang.Throwable
public ClassType Error()
java.lang.Error
public ClassType Exception()
java.lang.Exception
public ClassType RuntimeException()
java.lang.RuntimeException
public ClassType Cloneable()
java.lang.Cloneable
public ClassType Serializable()
java.io.Serializable
public ClassType NullPointerException()
java.lang.NullPointerException
public ClassType ClassCastException()
java.lang.ClassCastException
public ClassType OutOfBoundsException()
java.lang.ArrayIndexOutOfBoundsException
public ClassType ArrayStoreException()
java.lang.ArrayStoreException
public ClassType ArithmeticException()
java.lang.ArithmeticException
public ArrayType arrayOf(Type type)
type
public ArrayType arrayOf(Position pos, Type type)
type
public ArrayType arrayOf(Type type, int dims)
dims
-array of type
public ArrayType arrayOf(Position pos, Type type, int dims)
dims
-array of type
public Package packageForName(java.lang.String name) throws SemanticException
SemanticException
public Package packageForName(Package prefix, java.lang.String name) throws SemanticException
SemanticException
public Package createPackage(java.lang.String name)
public Package createPackage(Package prefix, java.lang.String name)
public Context createContext()
public Resolver packageContextResolver(Resolver resolver, Package pkg)
public Resolver classContextResolver(ClassType ct)
public LazyClassInitializer defaultClassInitializer()
public ParsedClassType createClassType(LazyClassInitializer init)
public ParsedClassType createClassType()
public ParsedClassType createClassType(LazyClassInitializer init, Source fromSource)
public ParsedClassType createClassType(Source fromSource)
public java.util.Set getTypeEncoderRootSet(Type clazz)
public java.lang.String getTransformedClassName(ClassType ct)
public java.lang.Object placeHolder(TypeObject o, java.util.Set roots)
o
- The object to get the place-holder for.roots
- The root objects for the serialization. Place holders
are not created for these.public java.lang.Object placeHolder(TypeObject o)
o
- The object to get the place-holder for.public java.lang.String translatePackage(Resolver c, Package p)
public java.lang.String translatePrimitive(Resolver c, PrimitiveType t)
public java.lang.String translateArray(Resolver c, ArrayType t)
public java.lang.String translateClass(Resolver c, ClassType t)
public java.lang.String wrapperTypeString(PrimitiveType t)
t
.
public boolean methodCallValid(MethodInstance mi, java.lang.String name, java.util.List argTypes)
mi
can be called with name name
and actual parameters of types actualTypes
.
public boolean callValid(ProcedureInstance mi, java.util.List argTypes)
pi
can be called with
actual parameters of types actualTypes
.
public java.util.List overrides(MethodInstance mi)
mi
(potentially) overrides, in
order from this class (that is, including this
) to super
classes.
public boolean canOverride(MethodInstance mi, MethodInstance mj)
mi
can override mj
.
public void checkOverride(MethodInstance mi, MethodInstance mj) throws SemanticException
mi
cannot override
mj
.
SemanticException
public java.util.List implemented(MethodInstance mi)
mi
implements, in no
specified order.
public PrimitiveType primitiveForName(java.lang.String name) throws SemanticException
SemanticException
public void checkMethodFlags(Flags f) throws SemanticException
f
are legal method flags.
SemanticException
public void checkLocalFlags(Flags f) throws SemanticException
f
are legal local variable flags.
SemanticException
public void checkFieldFlags(Flags f) throws SemanticException
f
are legal field flags.
SemanticException
public void checkConstructorFlags(Flags f) throws SemanticException
f
are legal constructor flags.
SemanticException
public void checkInitializerFlags(Flags f) throws SemanticException
f
are legal initializer flags.
SemanticException
public void checkTopLevelClassFlags(Flags f) throws SemanticException
f
are legal top-level class flags.
SemanticException
public void checkMemberClassFlags(Flags f) throws SemanticException
f
are legal member class flags.
SemanticException
public void checkLocalClassFlags(Flags f) throws SemanticException
f
are legal local class flags.
SemanticException
public void checkAccessFlags(Flags f) throws SemanticException
f
are legal access flags.
SemanticException
public void checkCycles(ReferenceType t) throws SemanticException
t
has no cycles in the super type+nested class
graph starting at t
.
SemanticException
public void checkClassConformance(ClassType ct) throws SemanticException
ct
implements all abstract methods that it
has to; that is, if it is a concrete class, then it must implement all
interfaces and abstract methods that it or its superclasses declare.
SemanticException
public Type staticTarget(Type t)
t
, modified as necessary to make it a legal
static target.
public Flags flagsForBits(int bits)
public Flags createNewFlag(java.lang.String name, Flags print_after)
name
- the name of the flagprint_after
- print the new flag after these flagspublic Flags NoFlags()
public Flags Public()
public Flags Protected()
public Flags Private()
public Flags Static()
public Flags Final()
public Flags Synchronized()
public Flags Transient()
public Flags Native()
public Flags Interface()
public Flags Abstract()
public Flags Volatile()
public Flags StrictFP()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |