Class Property<ID,​K extends PgxEntity<ID>,​V>

  • Type Parameters:
    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)
    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 a PgxGraph.
    • 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:
        getName in class PgxManagedObject
        Returns:
        the name of this property
      • getDimension

        public int getDimension()
        Gets the dimension.
        Returns:
        the dimension. If isVectorProperty() is false, the dimension will be 0.
      • isVectorProperty

        public boolean isVectorProperty()
        Checks if this property holds vectors or scalars.
        Returns:
        true if this is a vector property, false otherwise.
      • isTransient

        public boolean isTransient()
        Checks the transient flag of this property.
        Returns:
        true if this property is transient (session-bound, private), false otherwise.
      • destroyAsync

        public PgxFuture<java.lang.Void> destroyAsync()
        Description copied from class: Destroyable
        Requests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.
        Specified by:
        destroyAsync in class Destroyable
        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 set
        defaultValue - 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:
        true if this property is published, false otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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
      • fill

        public void fill​(V value)
                  throws java.util.concurrent.ExecutionException,
                         java.lang.InterruptedException
        Blocking version of fillAsync(Object). Calls fillAsync(Object) and waits for the returned PgxFuture to 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.