E
- the element typeID
- the ID type of the element typepublic abstract class PgxCollection<E,ID> extends PgxManagedObject implements java.lang.Iterable<E>, oracle.pgx.common.IdentifiableCollection
Modifier and Type | Method and Description |
---|---|
void |
add(E entity)
Adds one element to this collection.
|
abstract void |
addAll(PgxEntity[] elements)
Adds elements of a
PgxEntity array to this collection. |
PgxFuture<java.lang.Void> |
addAllAsync(E[] elements)
Add elements to an existing collection.
|
void |
addAllElements(java.util.Collection<E> source)
Blocking version of
addAllElementsAsync(Collection) . |
abstract PgxFuture<java.lang.Void> |
addAllElementsAsync(java.util.Collection<E> source)
Adds elements to an existing collection.
|
void |
clear()
Blocking version of
clearAsync() . |
PgxFuture<java.lang.Void> |
clearAsync()
Clear an existing collection
|
PgxCollection<E,ID> |
clone() |
PgxCollection<E,ID> |
clone(java.lang.String newName)
Blocking version of
clone(String) . |
PgxFuture<PgxCollection<E,ID>> |
cloneAsync()
|
PgxFuture<PgxCollection<E,ID>> |
cloneAsync(java.lang.String newName)
Clone an existing collection.
|
boolean |
contains(E element)
Blocking version of
#containsAsync(E) . |
abstract PgxFuture<java.lang.Boolean> |
containsAsync(E element)
Returns
true if this collection contains the specified element. |
PgxFuture<java.lang.Void> |
destroyAsync()
Requests destruction of this object.
|
CollectionType |
getCollectionType()
Gets the collection type.
|
PropertyType |
getContentType()
Gets this collection's content type.
|
PgxGraph |
getGraph()
Gets the graph.
|
oracle.pgx.common.PgxId |
getId()
Returns an internal identifier for this collection.
|
abstract IdType |
getIdType()
Gets the ID type of the element type.
|
java.lang.String |
getName() |
boolean |
isMutable()
Blocking version of
isMutableAsync() . |
PgxFuture<java.lang.Boolean> |
isMutableAsync()
Checks whether an existing collection is mutable
|
java.util.Iterator<E> |
iterator()
Blocking version of
iteratorAsync() . |
PgxFuture<java.util.Iterator<E>> |
iteratorAsync()
Gets an Iterator over the collection.
|
void |
remove(E entity)
Removes one element from this collection.
|
void |
removeAllElements(java.util.Collection<E> source)
Blocking version of
removeAllElementsAsync(Collection) . |
abstract PgxFuture<java.lang.Void> |
removeAllElementsAsync(java.util.Collection<E> source)
Removes elements from an existing collection.
|
int |
size()
Blocking version of
sizeAsync() . |
PgxFuture<java.lang.Integer> |
sizeAsync()
Gets the number of elements in this collection
|
java.util.stream.Stream<E> |
stream()
Creates a new sequential or parallel
Stream from Spliterator . |
PgxCollection<E,ID> |
toMutable()
Blocking version of
toMutableAsync() . |
PgxCollection<E,ID> |
toMutable(java.lang.String newName)
Blocking version of
toMutableAsync(String) . |
PgxFuture<PgxCollection<E,ID>> |
toMutableAsync()
Create a mutable copy of an existing collection
|
PgxFuture<PgxCollection<E,ID>> |
toMutableAsync(java.lang.String newName)
Create a mutable copy of an existing collection
|
java.lang.String |
toString()
(non-Javadoc)
|
equals, hashCode
close, destroy
public void add(E entity)
entity
- the entitypublic abstract void addAll(PgxEntity[] elements)
PgxEntity
array to this collection.elements
- the PgxEntity
array containing the elements to addpublic PgxFuture<java.lang.Void> addAllAsync(E[] elements)
elements
- elements to addpublic void addAllElements(java.util.Collection<E> source)
addAllElementsAsync(Collection)
. Calls addAllElementsAsync(Collection)
and waits for the returned PgxFuture
to complete.public abstract PgxFuture<java.lang.Void> addAllElementsAsync(java.util.Collection<E> source)
source
- elements to addpublic void clear()
clearAsync()
. Calls clearAsync()
and waits for the returned
PgxFuture
to complete.public PgxFuture<java.lang.Void> clearAsync()
public PgxCollection<E,ID> clone()
clone
in class java.lang.Object
public PgxCollection<E,ID> clone(java.lang.String newName) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
clone(String)
. Calls clone(String)
and waits for the returned
PgxFuture
to complete.java.util.concurrent.ExecutionException
java.lang.InterruptedException
public PgxFuture<PgxCollection<E,ID>> cloneAsync()
public PgxFuture<PgxCollection<E,ID>> cloneAsync(java.lang.String newName)
newName
- name of the new collectionpublic boolean contains(E element)
#containsAsync(E)
. Calls #containsAsync(E)
and
waits for the returned PgxFuture
to complete.public abstract PgxFuture<java.lang.Boolean> containsAsync(E element)
true
if this collection contains the specified element.element
- element whose presence in this collection is to be testedtrue
if this collection contains the specified
elementpublic PgxFuture<java.lang.Void> destroyAsync()
Destroyable
destroyAsync
in class Destroyable
public CollectionType getCollectionType()
public PropertyType getContentType()
public PgxGraph getGraph()
public oracle.pgx.common.PgxId getId()
getId
in interface oracle.pgx.common.IdentifiableCollection
public abstract IdType getIdType()
public java.lang.String getName()
getName
in class PgxManagedObject
public boolean isMutable() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
isMutableAsync()
. Calls isMutableAsync()
and waits for the returned
PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will
be nested.public PgxFuture<java.lang.Boolean> isMutableAsync()
true
if the collection is mutable, false
if it is immutablepublic java.util.Iterator<E> iterator()
iteratorAsync()
. Calls iteratorAsync()
and waits for the returned
PgxFuture
to complete.iterator
in interface java.lang.Iterable<E>
public PgxFuture<java.util.Iterator<E>> iteratorAsync()
public void remove(E entity)
entity
- the entitypublic void removeAllElements(java.util.Collection<E> source)
removeAllElementsAsync(Collection)
. Calls removeAllElementsAsync(Collection)
and waits for the returned PgxFuture
to complete.public abstract PgxFuture<java.lang.Void> removeAllElementsAsync(java.util.Collection<E> source)
source
- elements to removepublic int size()
sizeAsync()
. Calls sizeAsync()
and waits for the returned PgxFuture
to complete.public PgxFuture<java.lang.Integer> sizeAsync()
public java.util.stream.Stream<E> stream()
Stream
from Spliterator
.Stream
public PgxCollection<E,ID> toMutable() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
toMutableAsync()
. Calls toMutableAsync()
and waits for the returned
PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will
be nested.public PgxCollection<E,ID> toMutable(java.lang.String newName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
toMutableAsync(String)
. Calls toMutableAsync(String)
and waits for the
returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will
be nested.public PgxFuture<PgxCollection<E,ID>> toMutableAsync()
Convenience method around toMutableAsync(String)
passing name as null
public PgxFuture<PgxCollection<E,ID>> toMutableAsync(java.lang.String newName)
newName
- name of the new collectionpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()