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, wait
create, getChildren
protected TermImpl()
protected TermImpl(BaseFactory factory)
public BaseFactory getFactory()
public <R> R accept(Visitor<R> v)
Term
Accepts 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 Term
v
- the visitor that wants to visit this term.net.sourceforge.czt.base.visitor
public List<Object> getAnns()
Term
Returns 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()
Term
public boolean hasAnn()
Term
annsSize()
has more than zero elements.public <T> T getAnn(Class<T> aClass)
Term
Returns 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)
Term
public <T> void removeAnn(Class<T> aClass)
Term
public <T> boolean removeAnn(T annotation)
Term
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.