public interface Vocabulary<T extends Term> extends Iterable<T>, Serializable
Term| Modifier and Type | Method and Description |
|---|---|
T |
fromName(String name)
Returns the vocabulary term with the specified name.
|
T |
fromOrdinal(int ordinal)
Returns the vocabulary term specified in a given position.
|
<V> T |
fromValue(V value)
Returns the vocabulary term that matches the specified value.
|
String |
getNamespace()
Get the namespace of the vocabulary.
|
String |
getPreferredPrefix()
Get the preferred prefix for the vocabulary namespace.
|
int |
size()
Get the number of terms defined in the vocabulary.
|
T[] |
terms()
Get the terms defined in the vocabulary.
|
String getNamespace()
null
nor empty.String getPreferredPrefix()
null nor empty.int size()
0 if no term is defined.T[] terms()
T fromName(String name)
name - the name of the term to returnIllegalArgumentException - if name is null.T fromOrdinal(int ordinal)
ordinal - the position in which the desired term was declared.IndexOutOfBoundsException - if the specified ordinal is lower than 0 or greater
or equal than #size().<V> T fromValue(V value)
value - a value to determine the desired term.value.UnsupportedOperationException - if the terms of the vocabulary cannot be transformed to
instances a compatible class.Term.as(Class)
Copyright (C) 2014, Center for Open Middleware