Package com.piketec.tpt.api
Interface RemoteIndexedList<KEY,E>
-
- Type Parameters:
KEY
- the type of keys of this indexed listE
- the type of elements in this indexed list
- All Superinterfaces:
java.rmi.Remote
,RemoteCollection<E>
,RemoteIterable<E>
,RemoteList<E>
,TptRemote
- All Known Implementing Classes:
IterableRemoteIndexedList
public interface RemoteIndexedList<KEY,E> extends RemoteList<E>
A list of Objects that supports fast access to elements based on an index.- Author:
- Copyright (c) 2014-2020 Piketec GmbH - MIT License (MIT) - All rights reserved
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IterableRemoteIndexedList<KEY,E>
asIterable()
Provides anIterable
view of thisRemoteIterable
.boolean
containsKey(KEY key)
Returnstrue
if this list contains an object with the given key.E
get(KEY key)
Returns the value object for the given key ornull
if no such value exists.KEY
getKey(E obj)
Returns the key that belongs to the given value object.RemoteCollection<KEY>
keySet()
Returns a set of the keys contained in this list.E
removeByKey(KEY key)
Removes the object with the given key from the list.-
Methods inherited from interface com.piketec.tpt.api.RemoteCollection
clear, contains, containsAll, delete, deleteAll, getItems, isEmpty, retainAll, size
-
Methods inherited from interface com.piketec.tpt.api.util.RemoteIterable
remoteIterator
-
Methods inherited from interface com.piketec.tpt.api.RemoteList
delete, get, move
-
-
-
-
Method Detail
-
get
E get(KEY key) throws java.rmi.RemoteException
Returns the value object for the given key ornull
if no such value exists.- Parameters:
key
- the key whose associated value is to be returned- Returns:
- the value object for the given key
- Throws:
java.rmi.RemoteException
- remote communication problem
-
getKey
KEY getKey(E obj) throws java.rmi.RemoteException
Returns the key that belongs to the given value object.- Parameters:
obj
- the value object whose key is to be returned- Returns:
- the key that belongs to the given value object
- Throws:
java.rmi.RemoteException
- remote communication problem
-
removeByKey
E removeByKey(KEY key) throws java.rmi.RemoteException
Removes the object with the given key from the list.- Parameters:
key
- the key whose associated value is to be removed- Returns:
- the removed object with the specified key
- Throws:
java.rmi.RemoteException
- remote communication problem
-
containsKey
boolean containsKey(KEY key) throws java.rmi.RemoteException
Returnstrue
if this list contains an object with the given key.- Parameters:
key
- the key whose presence in this list is to be tested- Returns:
true
if this list contains an object for the specified key- Throws:
java.rmi.RemoteException
- remote communication problem
-
keySet
RemoteCollection<KEY> keySet() throws java.rmi.RemoteException
Returns a set of the keys contained in this list.- Returns:
- set of keys
- Throws:
java.rmi.RemoteException
- remote communication problem
-
asIterable
IterableRemoteIndexedList<KEY,E> asIterable() throws java.rmi.RemoteException
Description copied from interface:RemoteIterable
Provides anIterable
view of thisRemoteIterable
. This normally usesRemoteIterable.remoteIterator()
and wraps the return value into a realIterator
that throwsRuntimeExceptions
instead ofRemoteExceptions
so that this view can be used in for-each loops.- Specified by:
asIterable
in interfaceRemoteCollection<KEY>
- Specified by:
asIterable
in interfaceRemoteIterable<KEY>
- Specified by:
asIterable
in interfaceRemoteList<KEY>
- Returns:
- an iterable view of this
RemoteIterable
- Throws:
java.rmi.RemoteException
- remote communication problem- See Also:
ApiIterator
-
-