T
- the type of object stored in the namespacepublic interface Namespace<T> extends Iterable<T>
Map
.
A Namespace
, however, also always remembers the order
of insertion. Entries can be referenced either by name
or by position as needed.Modifier and Type | Method and Description |
---|---|
T |
get(int i)
Gets the entry at the specified index.
|
T |
get(String name)
Gets the entry associated with the specified namefrom the namespace.
|
NameBinding<T> |
getBinding(int i)
Gets the name-entry association at the specified index.
|
List<NameBinding<T>> |
getBindings()
Gets a collection of all the name-entry associations.
|
String |
getName(int i)
Gets the name associated with entry at the specified
index.
|
String[] |
getNames()
Gets all names registered in the namespace.
|
int |
indexOf(String name)
Gets the index of the entry associated with the
given name.
|
boolean |
isEmpty()
Indicates whether the namespace is empty.
|
Set<String> |
nameSet()
Get an unmodifiable collection of all names.
|
int |
size()
Retrieves the number of elements in the namespace.
|
List<T> |
toList()
Gets a list containing all namespace entries.
|
List<? super T> |
toList(List<? super T> list)
Extracts all namespace entries to the specified list.
|
Map<String,T> |
toMap()
Create a map containing the same mapping between
names and entries.
|
void |
verifyNames(Iterable<String> names)
Verifies that one or more names exist in the namespace.
|
void |
verifyNames(String... names)
Verifies that one or more names exist in the namespace.
|
forEach, iterator, spliterator
int size()
boolean isEmpty()
size() == 0
.true
if empty, false
otherwiseT get(int i)
i
- index of the element to retrieveIndexOutOfBoundsException
- if
i < 0 || i >= size()
NameBinding<T> getBinding(int i)
i
- index of the element to retrieveIndexOutOfBoundsException
- if
i < 0 || i >= size()
String getName(int i)
i
- index of the element name to retrieveIndexOutOfBoundsException
- if
i < 0 || i >= size()
int indexOf(String name)
name
- the name of the entry to find-1
if
no entry with the given name existsT get(String name)
name
- the name of the entry to findnull
if there is no such entryString[] getNames()
Set<String> nameSet()
List<NameBinding<T>> getBindings()
List<T> toList()
List<? super T> toList(List<? super T> list)
list
- the list to which to add namespace entriesMap<String,T> toMap()
void verifyNames(Iterable<String> names) throws InvalidFieldException
names
- the names to verifyInvalidFieldException
- if any of the specified names
are not present in the namespacevoid verifyNames(String... names) throws InvalidFieldException
names
- the names to verifyInvalidFieldException
- if any of the specified names
are not present in the namespaceCopyright © 2021 Actian Corporation. All rights reserved.