| Modifier | Constructor and Description |
|---|---|
protected |
TermImpl() |
protected |
TermImpl(BaseFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(Visitor<R> v)
Accepts a visitor.
|
int |
annsSize()
Returns whether the annotation list size.
|
boolean |
equals(Object obj) |
<T> T |
getAnn(Class<T> aClass)
Returns one of the
aClass annotations of this
term, or null if the term does not contain an
annotation of this type. |
List<Object> |
getAnns()
Returns a list of annotations.
|
BaseFactory |
getFactory() |
boolean |
hasAnn()
Returns true when
annsSize() has more than zero elements. |
<T> boolean |
hasAnn(Class<T> aClass)
Checks whether the term has any annotation of the given class type
|
int |
hashCode() |
<T> void |
removeAnn(Class<T> aClass)
Removes all annotations of the specific class.
|
<T> boolean |
removeAnn(T annotation)
Removes a specific annotation, if present.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreate, getChildrenprotected TermImpl()
protected TermImpl(BaseFactory factory)
public BaseFactory getFactory()
public <R> R accept(Visitor<R> v)
TermAccepts a visitor.
This method provides support for the visitor design pattern. Depending on the kind of visitor interfaces the given visitor implements, the visited term chooses the visit-method which fits best and returns the object that a call to this method returns.
accept in interface Termv - the visitor that wants to visit this term.net.sourceforge.czt.base.visitorpublic List<Object> getAnns()
TermReturns a list of annotations.
To add or remove elements, use the methods provided by the List interface (that's why there is no need for a setter method).
Avoid calling this method directly and prefer to check with hasAnn()
first. This delays creation of underlying arrays and lead to considerable memory
optimisation on large specs.
public int annsSize()
Termpublic boolean hasAnn()
TermannsSize() has more than zero elements.public <T> T getAnn(Class<T> aClass)
TermReturns one of the aClass annotations of this
term, or null if the term does not contain an
annotation of this type.
public <T> boolean hasAnn(Class<T> aClass)
Termpublic <T> void removeAnn(Class<T> aClass)
Termpublic <T> boolean removeAnn(T annotation)
TermCopyright © 2003–2016 Community Z Tools Project. All rights reserved.