|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pmd.util.TypeMap
public class TypeMap
A specialized map that stores types by both their full and short (without package prefixes) names. If an incoming type shares the same name (but different package/prefix) with a type already in the map then an IllegalArgumentException will be thrown since any subsequent retrievals by said short name could be in error.
Constructor Summary | |
---|---|
TypeMap(Class<?>... types)
Constructor for TypeMap that takes in an initial set of types. |
|
TypeMap(int initialSize)
Constructor for TypeMap. |
Method Summary | |
---|---|
void |
add(Class<?>... types)
Adds an array of types to the receiver at once. |
void |
add(Class<?> type)
Adds a type to the receiver and stores it keyed by both its full and short names. |
Map<Class<?>,String> |
asInverseWithShortName()
Creates and returns a map of short type names (without the package prefixes) keyed by the classes themselves. |
boolean |
contains(Class<?> type)
Returns whether the type is known to the receiver. |
boolean |
contains(String typeName)
Returns whether the typeName is known to the receiver. |
int |
size()
Returns the total number of entries in the receiver. |
Class<?> |
typeFor(String typeName)
Returns the type for the typeName specified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypeMap(int initialSize)
initialSize
- intpublic TypeMap(Class<?>... types)
types
- Class[]Method Detail |
---|
public void add(Class<?> type)
type
- Class
IllegalArgumentException
public boolean contains(Class<?> type)
type
- Class
public boolean contains(String typeName)
typeName
- String
public Class<?> typeFor(String typeName)
typeName
- String
public void add(Class<?>... types)
types
- Class[]public Map<Class<?>,String> asInverseWithShortName()
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |