|
Java Annotation Indexer 1.0.0.Final | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.jandex.DotName
public final class DotName
A DotName represents a dot separated name, typically a Java package or a Java class. It has two possible variants. A simple wrapper based variant allows for fast construction (it simply wraps the specified name string). Whereas, a componentized variant represents one or more String components that when combined with a dot character, assemble the full name. The intention of the componentized variant is that the String components can be reused to offer memory efficiency. This reuse is common in Java where packages and classes follow a tree structure.
Both the simple and componentized variants are considered semantically equivalent if they refer to the same logical name. More specifically the equals and hashCode methods return the same values for the same semantic name regardless of the variant used. Which variant to use when depends on the specific performance and overhead objectives of the specific use pattern.
Simple names are cheap to construct (just a an additional wrapper object), so are ideal for temporary use, like looking for an entry in a Map. Componentized names however require that they be split in advance, and so require some additional time to construct. However the memory benefits of reusing component strings make them desirable when stored in a longer term area such as in a Java data structure.
Method Summary | |
---|---|
int |
compareTo(DotName other)
|
static DotName |
createComponentized(DotName prefix,
String localName)
Constructs a componentized DotName. |
static DotName |
createSimple(String name)
Constructs a simple DotName which stores the string in it's entirety. |
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isComponentized()
Returns whether this DotName is a componentized variant. |
String |
local()
Returns the local portion of this DotName. |
DotName |
prefix()
Returns the parent prefix for this DotName or null if there is none. |
String |
toString()
Returns the regular fully qualifier class name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static DotName createSimple(String name)
name
- A fully qualified non-null name (with dots)
public static DotName createComponentized(DotName prefix, String localName)
prefix
- Another DotName that is the portion to the left of
localName, this may be null if there is not onelocalName
- the local non-null portion of this name, which does not contain
'.'
public DotName prefix()
public String local()
public boolean isComponentized()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(DotName other)
compareTo
in interface Comparable<DotName>
public boolean equals(Object o)
equals
in class Object
|
Java Annotation Indexer 1.0.0.Final | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |