Package com.piketec.tpt.api
Interface RemoteList<E>
-
- Type Parameters:
E
- the type of elements in this list
- All Superinterfaces:
java.rmi.Remote
,RemoteCollection<E>
,RemoteIterable<E>
,TptRemote
- All Known Subinterfaces:
AssessmentGroup
,ExecutionConfiguration
,ExecutionConfigurationGroup
,RemoteIndexedList<KEY,E>
,ScenarioGroup
,TestSetGroup
,TransitionSpecGroup
- All Known Implementing Classes:
IterableRemoteIndexedList
,IterableRemoteList
public interface RemoteList<E> extends RemoteCollection<E>
An ordered collection of (Remote) elements. Changes to this list will be done directly in TPT.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IterableRemoteList<E>
asIterable()
Provides anIterable
view of thisRemoteIterable
.void
delete(int index)
Removes the element at positionindex
from the list.E
get(int index)
Returns the element at positionindex
.int
indexOf(E element)
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.More formally, returns the lowest index i such that Objects.equals(o, get(i)), or -1 if there is no such index.E
move(int from, int to)
Moves an element from the positionfrom
toto
.-
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
-
-
-
-
Method Detail
-
get
E get(int index) throws java.lang.IndexOutOfBoundsException, java.rmi.RemoteException
Returns the element at positionindex
.- Parameters:
index
- The position of the element in the list.- Returns:
- The element that is at this position.
- Throws:
java.lang.IndexOutOfBoundsException
- If theindex < 0
orindex >= getItems().size()
java.rmi.RemoteException
- remote communication problem
-
delete
void delete(int index) throws java.lang.IndexOutOfBoundsException, java.rmi.RemoteException
Removes the element at positionindex
from the list.- Parameters:
index
- The position of the item that should be deleted.- Throws:
java.lang.IndexOutOfBoundsException
- If theindex < 0
orindex >= getItems().size()
java.rmi.RemoteException
- remote communication problem
-
move
E move(int from, int to) throws java.lang.IndexOutOfBoundsException, java.rmi.RemoteException
Moves an element from the positionfrom
toto
. All elements in this interval will be shifted accordingly such that no gaps exist afterwards and no items will be overwritten.- Parameters:
from
- The old position of the element.to
- The new position for the element given byfrom
- Returns:
- Returns a reference to the moved item.
- Throws:
java.lang.IndexOutOfBoundsException
- Ifto < 0
orfrom < 0
orto >= getItems().size()
orfrom >= getItems().size()
java.rmi.RemoteException
- remote communication problem
-
indexOf
int indexOf(E element) throws java.rmi.RemoteException, java.lang.ClassCastException, java.lang.NullPointerException
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.More formally, returns the lowest index i such that Objects.equals(o, get(i)), or -1 if there is no such index.- Parameters:
element
- element to search for- Returns:
- the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element
- Throws:
java.rmi.RemoteException
- remote communication problemjava.lang.ClassCastException
- if the type of the specified element is incompatible with this list(optional)java.lang.NullPointerException
- if the specified element is null and this list does not permit null elements(optional)
-
asIterable
IterableRemoteList<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<E>
- Specified by:
asIterable
in interfaceRemoteIterable<E>
- Returns:
- an iterable view of this
RemoteIterable
- Throws:
java.rmi.RemoteException
- remote communication problem- See Also:
ApiIterator
-
-