Package com.piketec.tpt.api
Interface RemoteCollection<E>
-
- Type Parameters:
E
- the type of elements in this collection
- All Superinterfaces:
java.rmi.Remote
,RemoteIterable<E>
,TptRemote
- All Known Subinterfaces:
AssessmentGroup
,ExecutionConfiguration
,ExecutionConfigurationGroup
,RemoteIndexedList<KEY,E>
,RemoteList<E>
,ScenarioGroup
,TestSetGroup
,TransitionSpecGroup
- All Known Implementing Classes:
IterableRemoteCollection
,IterableRemoteIndexedList
,IterableRemoteList
public interface RemoteCollection<E> extends TptRemote, RemoteIterable<E>
A collection of items where changes to the items are directly performed in TPT- Author:
- Copyright (c) 2014-2021 Piketec GmbH - MIT License (MIT) - All rights reserved
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IterableRemoteCollection<E>
asIterable()
Provides anIterable
view of thisRemoteIterable
.void
clear()
Remove all elements from this collection.boolean
contains(E o)
Returnstrue
e if this collection contains the specified element.boolean
containsAll(java.util.Collection<? extends E> c)
Returnstrue
if this collection contains all the elements in the given collection.void
delete(E element)
Delete an element from the list.boolean
deleteAll(java.util.Collection<?> c)
Removes all of this collection's elements that are contained in the given collection.java.util.Collection<E>
getItems()
Returns all items of thisRemoteCollection
.boolean
isEmpty()
Returnstrue
if this collection contains no elements.boolean
retainAll(java.util.Collection<?> c)
Removes all of this collection's elements that are not contained in the specified collection.int
size()
Returns the number of elements in this collection.-
Methods inherited from interface com.piketec.tpt.api.util.RemoteIterable
remoteIterator
-
-
-
-
Method Detail
-
getItems
java.util.Collection<E> getItems() throws java.rmi.RemoteException
Returns all items of thisRemoteCollection
. Any change to the returnedCollection
is local and will not be sent to TPT.
If you just want to iterate over the items useasIterable()
.- Returns:
- all items of this
RemoteCollection
at once. - Throws:
java.rmi.RemoteException
- remote communication problem- See Also:
asIterable()
-
delete
void delete(E element) throws java.rmi.RemoteException
Delete an element from the list. This function directly deletes the correspondingelement
in TPT.If multiple
RemoteCollections
refer to the same collection in TPT, the TPT object will be deleted from the collection as soon as this method is called with any of those and the change is reflected in all of them.- Parameters:
element
- The element to remove.- Throws:
java.rmi.RemoteException
- remote communication problem
-
size
int size() throws java.rmi.RemoteException
Returns the number of elements in this collection.- Returns:
- the number of elements in this collection
- Throws:
java.rmi.RemoteException
- remote communication problem
-
isEmpty
boolean isEmpty() throws java.rmi.RemoteException
Returnstrue
if this collection contains no elements.- Returns:
true
if this collection contains no elements- Throws:
java.rmi.RemoteException
- remote communication problem
-
contains
boolean contains(E o) throws java.rmi.RemoteException
Returnstrue
e if this collection contains the specified element.- Parameters:
o
- element whose presence in this collection is to be tested- Returns:
true
e if this collection contains the specified element- Throws:
java.rmi.RemoteException
- remote communication problem
-
containsAll
boolean containsAll(java.util.Collection<? extends E> c) throws java.rmi.RemoteException
Returnstrue
if this collection contains all the elements in the given collection.- Parameters:
c
- collection of elements whose presence in this collection is to be tested- Returns:
true
e if this collection contains all the specified elements- Throws:
java.rmi.RemoteException
- remote communication problem
-
deleteAll
boolean deleteAll(java.util.Collection<?> c) throws java.rmi.RemoteException
Removes all of this collection's elements that are contained in the given collection.- Parameters:
c
- collection containing elements to be removed from this collection- Returns:
true
if this collection was changed as a result of the call- Throws:
java.rmi.RemoteException
- remote communication problem
-
retainAll
boolean retainAll(java.util.Collection<?> c) throws java.rmi.RemoteException
Removes all of this collection's elements that are not contained in the specified collection.- Parameters:
c
- collection containing elements to be retained in this collection- Returns:
true
if this collection was changed as a result of the call- Throws:
java.rmi.RemoteException
- remote communication problem
-
clear
void clear() throws java.rmi.RemoteException
Remove all elements from this collection.- Throws:
java.rmi.RemoteException
- remote communication problem
-
asIterable
IterableRemoteCollection<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 interfaceRemoteIterable<E>
- Returns:
- an iterable view of this
RemoteIterable
- Throws:
java.rmi.RemoteException
- remote communication problem- See Also:
ApiIterator
-
-