net.sourceforge.pmd.util

Class TypeMap

public class TypeMap extends Object

A specialized map that stores classes by both their full and short names.

Author: Brian Remedios

Constructor Summary
TypeMap(int initialSize)
Constructor for TypeMap.
TypeMap(Class... types)
Constructor for TypeMap that takes in an initial set of types.
Method Summary
voidadd(Class type)
Adds a type to the receiver and stores it keyed by both its full and short names.
voidadd(Class... types)
Adds an array of types to the receiver at once.
booleancontains(Class type)
Returns whether the type is known to the receiver.
booleancontains(String typeName)
Returns whether the typeName is known to the receiver.
ClasstypeFor(String typeName)
Returns the type for the typeName specified.

Constructor Detail

TypeMap

public TypeMap(int initialSize)
Constructor for TypeMap.

Parameters: initialSize int

TypeMap

public TypeMap(Class... types)
Constructor for TypeMap that takes in an initial set of types.

Parameters: types Class[]

Method Detail

add

public void add(Class type)
Adds a type to the receiver and stores it keyed by both its full and short names.

Parameters: type Class

add

public void add(Class... types)
Adds an array of types to the receiver at once.

Parameters: types Class[]

contains

public boolean contains(Class type)
Returns whether the type is known to the receiver.

Parameters: type Class

Returns: boolean

contains

public boolean contains(String typeName)
Returns whether the typeName is known to the receiver.

Parameters: typeName String

Returns: boolean

typeFor

public Class typeFor(String typeName)
Returns the type for the typeName specified.

Parameters: typeName String

Returns: Class