public class ImmutableTerm extends Object implements Term
AbstractImmutableVocabulary, which behave as Enum constants.AbstractImmutableVocabulary,
Serialized Form| Constructor and Description |
|---|
ImmutableTerm(AbstractImmutableVocabulary<? extends ImmutableTerm> vocabulary,
String entityName)
Create a new term for a vocabulary and entity.
|
| Modifier and Type | Method and Description |
|---|---|
<V> V |
as(Class<? extends V> valueClass)
Transform the term to an instance of the specified type.
|
int |
compareTo(Term other)
Compares this term with the specified object for order.
|
String |
entityName()
Returns the simple name of the entity of the vocabulary identified by
this term constant.
|
boolean |
equals(Object other)
Returns true if the specified object is equal to this term constant.
|
Vocabulary |
getDeclaringVocabulary()
Returns the Vocabulary object corresponding to this term constant's
vocabulary type.
|
int |
hashCode()
Returns a hash code for this term constant.
|
String |
name()
Returns the name of this term constant, exactly as declared in its
vocabulary declaration.
|
int |
ordinal()
Returns the ordinal of this term (its position in its vocabulary
declaration, where the initial constant is assigned an ordinal of zero).
|
String |
qualifiedEntityName()
Returns the qualified name of the entity of the vocabulary identified by
this term constant.
|
String |
toString()
Returns the qualified entity name of this term constant.
|
public ImmutableTerm(AbstractImmutableVocabulary<? extends ImmutableTerm> vocabulary, String entityName)
vocabulary - the vocabulary to which the term will belong to.entityName - the entity name of the term.NullPointerException - if any of the vocabulary is null.IllegalArgumentException - if the entity name is not valid.public final int ordinal()
public final String name()
#toString method in preference
to this one, as the toString method may return a more user-friendly
name. This method is designed primarily for use in specialized
situations where correctness depends on getting the exact name, which
will not vary from release to release.public final String entityName()
entityName in interface Termpublic final String qualifiedEntityName()
qualifiedEntityName in interface Termpublic final Vocabulary getDeclaringVocabulary()
e1.getDeclaringVocabulary() == e2.getDeclaringVocabulary().getDeclaringVocabulary in interface Termpublic <V> V as(Class<? extends V> valueClass)
public final boolean equals(Object other)
public final int hashCode()
public String toString()
public int compareTo(Term other)
compareTo in interface Comparable<Term>
Copyright (C) 2014, Center for Open Middleware