Package oracle.pgx.api
Class Property<ID,K extends PgxEntity<ID>,V>
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.Destroyable
-
- oracle.pgx.api.PgxManagedObject
-
- oracle.pgx.api.Property<ID,K,V>
-
- Type Parameters:
ID- the identifier type of this property's entity (node or edgeIdType)K- the type of this property's entity (node or edge,PgxEntity)V- the type of this property (seePropertyType)
- All Implemented Interfaces:
java.lang.AutoCloseable,java.lang.Cloneable
- Direct Known Subclasses:
EdgeProperty,VertexProperty
public abstract class Property<ID,K extends PgxEntity<ID>,V> extends PgxManagedObject implements java.lang.Cloneable
A property of aPgxGraph.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PgxFuture<java.lang.Void>destroyAsync()Requests destruction of this object.booleanequals(java.lang.Object obj)voidfill(V value)Blocking version offillAsync(Object).PgxFuture<java.lang.Void>fillAsync(V value)Fill this property with a given value.Vget(ID id)Blocking version ofgetAsync(Object).Vget(K key)Blocking version ofgetAsync(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 ofgetBottomKValuesAsync(int).PgxFuture<EntryIterable<ID,K,V>>getBottomKValuesAsync(int k)Gets the bottom k vertex/edge value pairs according to their value.intgetDimension()Gets the dimension.EntityTypegetEntityType()Gets the entity type.PgxGraphgetGraph()Gets the graph.java.lang.StringgetName()Gets the name.oracle.pgx.common.PgxIdgetPropertyId()Returns an internal identifier for this property Only meant for internal usage.EntryIterable<ID,K,V>getTopKValues(int k)Blocking version ofgetTopKValuesAsync(int).PgxFuture<EntryIterable<ID,K,V>>getTopKValuesAsync(int k)Gets the top k vertex/edge value pairs according to their value.PropertyTypegetType()Gets the PropertyType.EntryIterable<ID,K,V>getValues()Blocking version ofgetValuesAsync().PgxFuture<EntryIterable<ID,K,V>>getValuesAsync()Gets the values.inthashCode()booleanisPublished()Blocking version ofisPublished().PgxFuture<java.lang.Boolean>isPublishedAsync()Checks if this property is published.booleanisTransient()Checks the transient flag of this property.booleanisVectorProperty()Checks if this property holds vectors or scalars.voidpublish()Blocking version ofpublish().PgxFuture<java.lang.Void>publishAsync()Publishes the property into a shared graph so It can be shared between sessions.voidrename(java.lang.String newPropertyName)Blocking version ofrenameAsync(String).PgxFuture<java.lang.Void>renameAsync(java.lang.String newPropertyName)Renames this property.voidset(K key, V value)Blocking version ofsetAsync(PgxEntity, Object).PgxFuture<java.lang.Void>setAsync(K key, V value)Sets a property value.voidsetValues(java.util.Map<K,V> values)Blocking version ofsetValuesAsync(Map).voidsetValues(java.util.Map<K,V> values, V defaultValue)Blocking version ofsetValuesAsync(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.longsize()Blocking version ofsizeAsync().PgxFuture<java.lang.Long>sizeAsync()Gets the size/length of this property.java.lang.StringtoString()static <V> Vwrap(V value, PropertyType type, PgxGraph graph)-
Methods inherited from class oracle.pgx.api.Destroyable
close, destroy
-
-
-
-
Method Detail
-
getPropertyId
public final oracle.pgx.common.PgxId getPropertyId()
Returns an internal identifier for this property Only meant for internal usage.- Returns:
- the internal identifier of this property
- Since:
- 21.1
-
getGraph
public PgxGraph getGraph()
Gets the graph.- Returns:
- the graph this property belongs to
-
getEntityType
public EntityType getEntityType()
Gets the entity type.- Returns:
- the entity type of this property
-
getName
public java.lang.String getName()
Gets the name.- Specified by:
getNamein classPgxManagedObject- Returns:
- the name of this property
-
getDimension
public int getDimension()
Gets the dimension.- Returns:
- the dimension. If
isVectorProperty()isfalse, the dimension will be 0.
-
isVectorProperty
public boolean isVectorProperty()
Checks if this property holds vectors or scalars.- Returns:
trueif this is a vector property,falseotherwise.
-
isTransient
public boolean isTransient()
Checks the transient flag of this property.- Returns:
trueif this property is transient (session-bound, private),falseotherwise.
-
destroyAsync
public PgxFuture<java.lang.Void> destroyAsync()
Description copied from class:DestroyableRequests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.- Specified by:
destroyAsyncin classDestroyable- Returns:
- a future which will be completed once the destruction request finishes.
-
getType
public PropertyType getType()
Gets the PropertyType.- Returns:
- the propertytype
-
setAsync
public PgxFuture<java.lang.Void> setAsync(K key, V value)
Sets a property value.- Parameters:
key- the key (vertex/edge) whose property to set.value- the property value.
-
setValuesAsync
public PgxFuture<java.lang.Void> setValuesAsync(java.util.Map<K,V> values)
Sets multiple property values.- Parameters:
values- the key/value mapping to set.
-
setValuesAsync
public PgxFuture<java.lang.Void> setValuesAsync(java.util.Map<K,V> values, V defaultValue)
Sets multiple property values.- Parameters:
values- the values to setdefaultValue- default value if one of the values fails to be put
-
fillAsync
public PgxFuture<java.lang.Void> fillAsync(V value)
Fill this property with a given value.- Parameters:
value- the value
-
renameAsync
public PgxFuture<java.lang.Void> renameAsync(java.lang.String newPropertyName)
Renames this property.- Parameters:
newPropertyName- the new name.
-
publishAsync
public PgxFuture<java.lang.Void> publishAsync()
Publishes the property into a shared graph so It can be shared between sessions.
-
isPublishedAsync
public PgxFuture<java.lang.Boolean> isPublishedAsync()
Checks if this property is published.- Returns:
trueif this property is published,falseotherwise.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classPgxManagedObject
-
hashCode
public int hashCode()
- Overrides:
hashCodein classPgxManagedObject
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
sizeAsync
public PgxFuture<java.lang.Long> sizeAsync()
Gets the size/length of this property.- Returns:
- the size of the property.
-
getAsync
public PgxFuture<V> getAsync(ID id)
Gets the property value.- Parameters:
id- the id of the property- Returns:
- property value
-
getAsync
public PgxFuture<V> getAsync(K key)
Gets the property value.- Parameters:
key- the key of the property- Returns:
- property value
-
getValuesAsync
public PgxFuture<EntryIterable<ID,K,V>> getValuesAsync()
Gets the values.- Returns:
- an iterable of the values
-
getTopKValuesAsync
public PgxFuture<EntryIterable<ID,K,V>> getTopKValuesAsync(int k)
Gets the top k vertex/edge value pairs according to their value.- Parameters:
k- how many top values to retrieve, must be in the range between 0 and number of nodes/edges (inclusive)- Returns:
- iterable over the values
-
getBottomKValuesAsync
public PgxFuture<EntryIterable<ID,K,V>> getBottomKValuesAsync(int k)
Gets the bottom k vertex/edge value pairs according to their value.- Parameters:
k- how many bottom values to retrieve, must be in the range between 0 and number of nodes/edges (inclusive)- Returns:
- iterable over the values
-
wrap
public static <V> V wrap(V value, PropertyType type, PgxGraph graph)
-
set
public void set(K key, V value)
Blocking version ofsetAsync(PgxEntity, Object). CallssetAsync(PgxEntity, Object)and waits for the returnedPgxFutureto complete.
-
setValues
public void setValues(java.util.Map<K,V> values)
Blocking version ofsetValuesAsync(Map). CallssetValuesAsync(Map)and waits for the returnedPgxFutureto complete.
-
setValues
public void setValues(java.util.Map<K,V> values, V defaultValue)
Blocking version ofsetValuesAsync(Map, Object). CallssetValuesAsync(Map, Object)and waits for the returnedPgxFutureto complete.
-
fill
public void fill(V value) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Blocking version offillAsync(Object). CallsfillAsync(Object)and waits for the returnedPgxFutureto complete.- Throws:
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.
-
rename
public void rename(java.lang.String newPropertyName)
Blocking version ofrenameAsync(String). CallsrenameAsync(String)and waits for the returnedPgxFutureto complete.
-
size
public long size()
Blocking version ofsizeAsync(). CallssizeAsync()and waits for the returnedPgxFutureto complete.
-
get
public V get(ID id)
Blocking version ofgetAsync(Object). CallsgetAsync(Object)and waits for the returnedPgxFutureto complete.
-
get
public V get(K key)
Blocking version ofgetAsync(PgxEntity). CallsgetAsync(PgxEntity)and waits for the returnedPgxFutureto complete.
-
getValues
public EntryIterable<ID,K,V> getValues()
Blocking version ofgetValuesAsync(). CallsgetValuesAsync()and waits for the returnedPgxFutureto complete.
-
getTopKValues
public EntryIterable<ID,K,V> getTopKValues(int k)
Blocking version ofgetTopKValuesAsync(int). CallsgetTopKValuesAsync(int)and waits for the returnedPgxFutureto complete.
-
getBottomKValues
public EntryIterable<ID,K,V> getBottomKValues(int k)
Blocking version ofgetBottomKValuesAsync(int). CallsgetBottomKValuesAsync(int)and waits for returnedPgxFutureto complete.
-
publish
public void publish()
-
isPublished
public boolean isPublished()
Blocking version ofisPublished(). CallsisPublished()and waits for returnedPgxFutureto complete.
-
-