ID
- the identifier type of this property's entity (node or edge IdType
)K
- the type of this property's entity (node or edge, PgxEntity
)V
- the type of this property (see PropertyType
)public abstract class Property<ID,K extends PgxEntity<ID>,V> extends PgxManagedObject implements java.lang.Cloneable
PgxGraph
.Modifier and Type | Method and Description |
---|---|
PgxFuture<java.lang.Void> |
destroyAsync()
Requests destruction of this object.
|
boolean |
equals(java.lang.Object obj) |
void |
fill(V value)
Blocking version of
fillAsync(Object) . |
PgxFuture<java.lang.Void> |
fillAsync(V value)
Fill this property with a given value.
|
V |
get(ID id)
Blocking version of
getAsync(Object) . |
V |
get(K key)
Blocking version of
getAsync(PgxEntity) . |
PgxFuture<V> |
getAsync(ID id)
Gets the property value.
|
PgxFuture<V> |
getAsync(K key)
Gets the property value.
|
EntryIterable<ID,K,V> |
getBottomKValues(int k)
Blocking version of
getBottomKValuesAsync(int) . |
PgxFuture<EntryIterable<ID,K,V>> |
getBottomKValuesAsync(int k)
Gets the bottom k vertex/edge value pairs according to their value.
|
int |
getDimension()
Gets the dimension.
|
EntityType |
getEntityType()
Gets the entity type.
|
PgxGraph |
getGraph()
Gets the graph.
|
java.lang.String |
getName()
Gets the name.
|
oracle.pgx.common.PgxId |
getPropertyId()
Returns an internal identifier for this property
Only meant for internal usage.
|
EntryIterable<ID,K,V> |
getTopKValues(int k)
Blocking version of
getTopKValuesAsync(int) . |
PgxFuture<EntryIterable<ID,K,V>> |
getTopKValuesAsync(int k)
Gets the top k vertex/edge value pairs according to their value.
|
PropertyType |
getType()
Gets the PropertyType.
|
EntryIterable<ID,K,V> |
getValues()
Blocking version of
getValuesAsync() . |
PgxFuture<EntryIterable<ID,K,V>> |
getValuesAsync()
Gets the values.
|
int |
hashCode() |
boolean |
isPublished()
Blocking version of
isPublished() . |
PgxFuture<java.lang.Boolean> |
isPublishedAsync()
Checks if this property is published.
|
boolean |
isTransient()
Checks the transient flag of this property.
|
boolean |
isVectorProperty()
Checks if this property holds vectors or scalars.
|
void |
publish()
Blocking version of
publish() . |
PgxFuture<java.lang.Void> |
publishAsync()
Publishes the property into a shared graph so It can be shared between sessions.
|
void |
rename(java.lang.String newPropertyName)
Blocking version of
renameAsync(String) . |
PgxFuture<java.lang.Void> |
renameAsync(java.lang.String newPropertyName)
Renames this property.
|
void |
set(K key,
V value)
Blocking version of
setAsync(PgxEntity, Object) . |
PgxFuture<java.lang.Void> |
setAsync(K key,
V value)
Sets a property value.
|
void |
setValues(java.util.Map<K,V> values)
Blocking version of
setValuesAsync(Map) . |
void |
setValues(java.util.Map<K,V> values,
V defaultValue)
Blocking version of
setValuesAsync(Map, Object) . |
PgxFuture<java.lang.Void> |
setValuesAsync(java.util.Map<K,V> values)
Sets multiple property values.
|
PgxFuture<java.lang.Void> |
setValuesAsync(java.util.Map<K,V> values,
V defaultValue)
Sets multiple property values.
|
long |
size()
Blocking version of
sizeAsync() . |
PgxFuture<java.lang.Long> |
sizeAsync()
Gets the size/length of this property.
|
java.lang.String |
toString() |
static <V> V |
wrap(V value,
PropertyType type,
PgxGraph graph) |
close, destroy
public PgxFuture<java.lang.Void> destroyAsync()
Destroyable
destroyAsync
in class Destroyable
public boolean equals(java.lang.Object obj)
equals
in class PgxManagedObject
public void fill(V value) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
fillAsync(Object)
. Calls fillAsync(Object)
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.Void> fillAsync(V value)
value
- the valuepublic V get(ID id)
getAsync(Object)
. Calls getAsync(Object)
and waits for the returned
PgxFuture
to complete.public V get(K key)
getAsync(PgxEntity)
. Calls getAsync(PgxEntity)
and waits for the returned
PgxFuture
to complete.public PgxFuture<V> getAsync(ID id)
id
- the id of the propertypublic PgxFuture<V> getAsync(K key)
key
- the key of the propertypublic EntryIterable<ID,K,V> getBottomKValues(int k)
getBottomKValuesAsync(int)
. Calls getBottomKValuesAsync(int)
and waits for
returned PgxFuture
to complete.public PgxFuture<EntryIterable<ID,K,V>> getBottomKValuesAsync(int k)
k
- how many bottom values to retrieve, must be in the range between 0 and number of nodes/edges (inclusive)public int getDimension()
isVectorProperty()
is false
, the dimension will be 0.public EntityType getEntityType()
public PgxGraph getGraph()
public java.lang.String getName()
getName
in class PgxManagedObject
public final oracle.pgx.common.PgxId getPropertyId()
public EntryIterable<ID,K,V> getTopKValues(int k)
getTopKValuesAsync(int)
. Calls getTopKValuesAsync(int)
and waits for the
returned PgxFuture
to complete.public PgxFuture<EntryIterable<ID,K,V>> getTopKValuesAsync(int k)
k
- how many top values to retrieve, must be in the range between 0 and number of nodes/edges (inclusive)public PropertyType getType()
public EntryIterable<ID,K,V> getValues()
getValuesAsync()
. Calls getValuesAsync()
and waits for the returned
PgxFuture
to complete.public PgxFuture<EntryIterable<ID,K,V>> getValuesAsync()
public int hashCode()
hashCode
in class PgxManagedObject
public boolean isPublished()
isPublished()
. Calls isPublished()
and waits for returned PgxFuture
to complete.public PgxFuture<java.lang.Boolean> isPublishedAsync()
true
if this property is published, false
otherwise.public boolean isTransient()
true
if this property is transient (session-bound, private), false
otherwise.public boolean isVectorProperty()
true
if this is a vector property, false
otherwise.public void publish()
public PgxFuture<java.lang.Void> publishAsync()
public void rename(java.lang.String newPropertyName)
renameAsync(String)
. Calls renameAsync(String)
and waits for the returned
PgxFuture
to complete.public PgxFuture<java.lang.Void> renameAsync(java.lang.String newPropertyName)
newPropertyName
- the new name.public void set(K key, V value)
setAsync(PgxEntity, Object)
. Calls setAsync(PgxEntity, Object)
and
waits for the returned PgxFuture
to complete.public PgxFuture<java.lang.Void> setAsync(K key, V value)
key
- the key (vertex/edge) whose property to set.value
- the property value.public void setValues(java.util.Map<K,V> values)
setValuesAsync(Map)
. Calls setValuesAsync(Map)
and waits for the returned
PgxFuture
to complete.public void setValues(java.util.Map<K,V> values, V defaultValue)
setValuesAsync(Map, Object)
. Calls setValuesAsync(Map, Object)
and
waits for the returned PgxFuture
to complete.public PgxFuture<java.lang.Void> setValuesAsync(java.util.Map<K,V> values)
values
- the key/value mapping to set.public PgxFuture<java.lang.Void> setValuesAsync(java.util.Map<K,V> values, V defaultValue)
values
- the values to setdefaultValue
- default value if one of the values fails to be putpublic long size()
sizeAsync()
. Calls sizeAsync()
and waits for the returned PgxFuture
to complete.public PgxFuture<java.lang.Long> sizeAsync()
public java.lang.String toString()
toString
in class java.lang.Object
public static <V> V wrap(V value, PropertyType type, PgxGraph graph)