T - An interface extending the interface JrpcgenItem or a class implementing
the interface JrpcgenItem.public class JrpcgenItemTable<T extends JrpcgenItem> extends Object implements Iterable<T>
An item list is prepared to hold a collection of any item as well as items
of a defined type. The global definition list of an RPC/XDR specification will
contain realisations of class JrpcgenXdrDefinition, for example.
| Constructor and Description |
|---|
JrpcgenItemTable() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addItem(T item)
Adds the passed item to this table, if its identifier is unknown to
this table.
|
void |
clear()
Clears this table.
|
T |
getFirstItem()
Returns the first item of this table.
|
<U extends JrpcgenItem> |
getItem(Class<U> clazz,
String identifier)
Returns the item based on the passed type and mapped to the passed
identifier.
|
T |
getItem(String identifier)
Returns the item mapped to the passed identifier.
|
List<T> |
getItemList()
Returns the list of items stored in this table.
|
T |
getLastItem()
Returns the last item of this table.
|
boolean |
isEmpty()
Returns whether the table is empty.
|
boolean |
isUnknownIdentifier(String identifier)
Returns whether the passed idnetifier is unknown to the table.
|
Iterator<T> |
iterator()
Returns an iterator to the items of this table.
|
<U extends JrpcgenItem> |
iterator(Class<U> clazz)
Returns an iterator to the items of this table, which are instances
of the passed type.
|
void |
putItem(T item)
Puts the passed item to this table, if no item with the same
identifier is already in this table.
|
int |
size()
Returns the size of this table reflecting the number of items
kept in this table.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic List<T> getItemList()
public void clear()
public boolean isEmpty()
true if the table does not contain any element,
false otherwise.public int size()
public boolean isUnknownIdentifier(String identifier)
true, if no item was found, or
false, if an item was found having set the passed identifier.identifier - The identifier to check for.true if no item was found whose identifier equals the passed one,
false otherwise.public boolean addItem(T item)
item - The item to be added to this table.true if the item was added due to the fact, that its
identifier was unknown to the table before, false
otherwise.public void putItem(T item)
item - The item to be put into this table.IllegalArgumentException - Passing an item with an already
known identifier to this table will cause this exception
to be thrown.public T getItem(String identifier)
identifier - The identifier of the requested item.null
otherwise.public <U extends JrpcgenItem> U getItem(Class<U> clazz, String identifier)
U - The required type of the requested item.clazz - The class object representing the expected type of the
requested item.identifier - The identifier of the requested item.null will be returned.public T getFirstItem()
null otherwise.public T getLastItem()
null otherwise.public Iterator<T> iterator()
iterator in interface Iterable<T extends JrpcgenItem>public <U extends JrpcgenItem> Iterator<U> iterator(Class<U> clazz)
U - The type of the items provided by the returned iterator.clazz - The class instance of the requested item type.Copyright © 2025. All rights reserved.