com.thinkaurelius.titan.graphdb.vertices

## Class AbstractVertex

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.internal.AbstractElement
  - - com.thinkaurelius.titan.graphdb.vertices.AbstractVertex

- All Implemented Interfaces:
    Idfiable, TitanElement, TitanVertex, InternalElement, InternalVertex, Removable, com.tinkerpop.blueprints.Element, com.tinkerpop.blueprints.Vertex, Comparable<TitanElement>
  Direct Known Subclasses:
    StandardVertex

      public abstract class AbstractVertex
      extends AbstractElement
      implements InternalVertex

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractVertex(StandardTitanTx tx, long id)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TitanEdge` | `addEdge(EdgeLabel label, TitanVertex vertex)` Creates a new edge incident on this vertex.
    `TitanEdge` | `addEdge(String label, TitanVertex vertex)` Creates a new edge incident on this vertex.
    `com.tinkerpop.blueprints.Edge` | `addEdge(String label, com.tinkerpop.blueprints.Vertex vertex)`
    `TitanProperty` | `addProperty(PropertyKey key, Object attribute)` Creates a new property for this vertex and given key with the specified value.
    `TitanProperty` | `addProperty(String key, Object attribute)` Creates a new property for this vertex and given key with the specified value.
    `long` | `getCompareId()` Long identifier used to compare elements.
    `long` | `getEdgeCount()` Returns the number of edges incident on this vertex.
    `Iterable<TitanEdge>` | `getEdges()` Returns an iterable over all edges incident on this vertex.
    `Iterable<com.tinkerpop.blueprints.Edge>` | `getEdges(com.tinkerpop.blueprints.Direction dir, String... labels)` Returns an iterable over all edges of the specified edge label in the given direction incident on this vertex.
    `Object` | `getId()` Returns a unique identifier for this entity.
    `String` | `getLabel()` Returns the name of the vertex label for this vertex.
    `Iterable<TitanProperty>` | `getProperties()` Returns an iterable over all properties incident on this vertex.
    `Iterable<TitanProperty>` | `getProperties(PropertyKey key)` Returns an iterable over all properties of the specified property key incident on this vertex.
    `Iterable<TitanProperty>` | `getProperties(String key)` Returns an iterable over all properties of the specified property key incident on this vertex.
    `<O> O` | `getProperty(PropertyKey key)` Retrieves the value associated with the given key on this vertex and casts it to the specified type.
    `<O> O` | `getProperty(String key)` Retrieves the value associated with the given key on this vertex and casts it to the specified type.
    `long` | `getPropertyCount()` Returns the number of properties incident on this vertex.
    `Set<String>` | `getPropertyKeys()`
    `Iterable<TitanRelation>` | `getRelations()` Returns an iterable over all relations incident on this vertex.
    `Iterable<TitanEdge>` | `getTitanEdges(com.tinkerpop.blueprints.Direction dir, EdgeLabel... labels)` Returns an iterable over all edges of the specified edge label in the given direction incident on this vertex.
    `VertexLabel` | `getVertexLabel()` Returns the vertex label of this vertex.
    `protected com.tinkerpop.blueprints.Vertex` | `getVertexLabelInternal()`
    `Iterable<com.tinkerpop.blueprints.Vertex>` | `getVertices(com.tinkerpop.blueprints.Direction direction, String... labels)`
    `boolean` | `isConnected()` Checks whether this vertex has at least one incident edge.
    `boolean` | `isModified()` Checks whether this entity has been loaded into the current transaction and modified.
    `InternalVertex` | `it()` Returns this element in the context of the current transaction.
    `VertexCentricQueryBuilder` | `query()` Starts a new `TitanVertexQuery` for this vertex.
    `void` | `remove()` Deletes this entity and any incident edges or properties from the graph.
    `<O> O` | `removeProperty(RelationType key)` Removes the value associated with the given key for this vertex (if exists).
    `<O> O` | `removeProperty(String key)` Removes the value associated with the given key for this vertex (if exists).
    `void` | `setProperty(PropertyKey key, Object value)` Sets the value for the given key on this element.
    `void` | `setProperty(String key, Object value)` Sets the value for the given key on this element.
    `String` | `toString()`
    `StandardTitanTx` | `tx()` Returns the transaction to which the element is currently bound or should be refreshed into

    - ### Methods inherited from class com.thinkaurelius.titan.graphdb.internal.AbstractElement

      `clone, compare, compareTo, equals, getLongId, hashCode, hasId, isHidden, isLoaded, isNew, isRemoved, isTemporaryId, setId`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.thinkaurelius.titan.graphdb.internal.InternalVertex

      `addRelation, getAddedRelations, hasAddedRelations, hasLoadedRelations, hasRemovedRelations, loadRelations, removeRelation`

    - ### Methods inherited from interface com.thinkaurelius.titan.graphdb.internal.InternalElement

      `getLifeCycle, isHidden, setId`

    - ### Methods inherited from interface com.thinkaurelius.titan.core.TitanElement

      `getLongId, hasId, isLoaded, isNew, isRemoved`

- - ### Constructor Detail

    - #### AbstractVertex

          protected AbstractVertex(StandardTitanTx tx,
                        long id)

  - ### Method Detail

    - #### it

          public final InternalVertex it()

      Description copied from interface: `InternalElement`
      Returns this element in the context of the current transaction.
      Specified by:
        `it` in interface `InternalElement`
      Specified by:
        `it` in interface `InternalVertex`
      Returns:

    - #### tx

          public final StandardTitanTx tx()

      Description copied from interface: `InternalElement`
      Returns the transaction to which the element is currently bound or should be refreshed into
      Specified by:
        `tx` in interface `InternalElement`
      Returns:

    - #### getCompareId

          public long getCompareId()

      Description copied from class: `AbstractElement`
      Long identifier used to compare elements. Often, this is the same as `AbstractElement.getLongId()` but some instances of elements may be considered the same even if their ids differ. In that case, this method should be overwritten to return an id that can be used for comparison.
      Overrides:
        `getCompareId` in class `AbstractElement`
      Returns:

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getId

          public Object getId()

      Description copied from interface: `TitanElement`
      Returns a unique identifier for this entity.

      The unique identifier may only be set when the transaction in which entity is created commits. The Graph Configuration Wiki explains how to configure when entity ids are assigned. Some entities are never assigned a unique identifier if they depend on a parent entity.

      Specified by:
        `getId` in interface `TitanElement`
      Specified by:
        `getId` in interface `com.tinkerpop.blueprints.Element`
      Returns:
        The unique identifier for this entity
      See Also:
        `TitanElement.hasId()`

    - #### isModified

          public boolean isModified()

      Description copied from interface: `TitanVertex`
      Checks whether this entity has been loaded into the current transaction and modified.
      Specified by:
        `isModified` in interface `TitanVertex`
      Returns:
        True, has been loaded and modified, else false.

    - #### remove

          public void remove()

      Description copied from interface: `TitanElement`
      Deletes this entity and any incident edges or properties from the graph.

      Specified by:
        `remove` in interface `TitanElement`
      Specified by:
        `remove` in interface `Removable`
      Specified by:
        `remove` in interface `com.tinkerpop.blueprints.Element`

    - #### getLabel

          public String getLabel()

      Description copied from interface: `TitanVertex`
      Returns the name of the vertex label for this vertex.
      Specified by:
        `getLabel` in interface `TitanVertex`
      Returns:

    - #### getVertexLabelInternal

          protected com.tinkerpop.blueprints.Vertex getVertexLabelInternal()

    - #### getVertexLabel

          public VertexLabel getVertexLabel()

      Description copied from interface: `TitanVertex`
      Returns the vertex label of this vertex.
      Specified by:
        `getVertexLabel` in interface `TitanVertex`
      Returns:

    - #### query

          public VertexCentricQueryBuilder query()

      Description copied from interface: `TitanVertex`
      Starts a new `TitanVertexQuery` for this vertex.

      Initializes and returns a new `TitanVertexQuery` based on this vertex.
      Specified by:
        `query` in interface `TitanVertex`
      Specified by:
        `query` in interface `InternalVertex`
      Specified by:
        `query` in interface `com.tinkerpop.blueprints.Vertex`
      Returns:
        New TitanQuery for this vertex
      See Also:
        `TitanVertexQuery`

    - #### getPropertyKeys

          public Set<String> getPropertyKeys()

      Specified by:
        `getPropertyKeys` in interface `com.tinkerpop.blueprints.Element`

    - #### getProperty

          public <O> O getProperty(PropertyKey key)

      Description copied from interface: `TitanElement`
      Retrieves the value associated with the given key on this vertex and casts it to the specified type. If the key has cardinality SINGLE, then there can be at most one value and this value is returned (or null). Otherwise a list of all associated values is returned, or an empty list if non exist.

      Specified by:
        `getProperty` in interface `TitanElement`
      Parameters:
        `key` - key
      Returns:
        value or list of values associated with key

    - #### getProperty

          public <O> O getProperty(String key)

      Description copied from interface: `TitanElement`
      Retrieves the value associated with the given key on this vertex and casts it to the specified type. If the key has cardinality SINGLE, then there can be at most one value and this value is returned (or null). Otherwise a list of all associated values is returned, or an empty list if non exist.

      Specified by:
        `getProperty` in interface `TitanElement`
      Specified by:
        `getProperty` in interface `com.tinkerpop.blueprints.Element`
      Parameters:
        `key` - string identifying a key
      Returns:
        value or list of values associated with key

    - #### getProperties

          public Iterable<TitanProperty> getProperties()

      Description copied from interface: `TitanVertex`
      Returns an iterable over all properties incident on this vertex.

      There is no guarantee concerning the order in which the properties are returned. All properties incident on this vertex are returned irrespective of their key.
      Specified by:
        `getProperties` in interface `TitanVertex`
      Returns:
        `Iterable` over all properties incident on this vertex

    - #### getProperties

          public Iterable<TitanProperty> getProperties(PropertyKey key)

      Description copied from interface: `TitanVertex`
      Returns an iterable over all properties of the specified property key incident on this vertex.

      There is no guarantee concerning the order in which the properties are returned. All returned properties are of the specified key.
      Specified by:
        `getProperties` in interface `TitanVertex`
      Parameters:
        `key` - `PropertyKey` of the returned properties
      Returns:
        `Iterable` over all properties of the specified key incident on this vertex

    - #### getProperties

          public Iterable<TitanProperty> getProperties(String key)

      Description copied from interface: `TitanVertex`
      Returns an iterable over all properties of the specified property key incident on this vertex.

      There is no guarantee concerning the order in which the properties are returned. All returned properties are of the specified key.
      Specified by:
        `getProperties` in interface `TitanVertex`
      Parameters:
        `key` - key of the returned properties
      Returns:
        `Iterable` over all properties of the specified key incident on this vertex

    - #### getEdges

          public Iterable<TitanEdge> getEdges()

      Description copied from interface: `TitanVertex`
      Returns an iterable over all edges incident on this vertex.

      There is no guarantee concerning the order in which the edges are returned.
      Specified by:
        `getEdges` in interface `TitanVertex`
      Returns:
        `Iterable` over all edges incident on this vertex

    - #### getTitanEdges

          public Iterable<TitanEdge> getTitanEdges(com.tinkerpop.blueprints.Direction dir,
                                          EdgeLabel... labels)

      Description copied from interface: `TitanVertex`
      Returns an iterable over all edges of the specified edge label in the given direction incident on this vertex.

      There is no guarantee concerning the order in which the edges are returned. All returned edges have the given label and the direction of the edge from the perspective of this vertex matches the specified direction.
      Specified by:
        `getTitanEdges` in interface `TitanVertex`
      Parameters:
        `dir` - Direction of the returned edges with respect to this vertex
        `labels` - label of the returned edges
      Returns:
        `Iterable` over all edges with the given label and direction incident on this vertex

    - #### getEdges

          public Iterable<com.tinkerpop.blueprints.Edge> getEdges(com.tinkerpop.blueprints.Direction dir,
                                                         String... labels)

      Description copied from interface: `TitanVertex`
      Returns an iterable over all edges of the specified edge label in the given direction incident on this vertex.

      There is no guarantee concerning the order in which the edges are returned. All returned edges have the given label and the direction of the edge from the perspective of this vertex matches the specified direction.
      Specified by:
        `getEdges` in interface `TitanVertex`
      Specified by:
        `getEdges` in interface `com.tinkerpop.blueprints.Vertex`
      Parameters:
        `dir` - Direction of the returned edges with respect to this vertex
        `labels` - label of the returned edges
      Returns:
        `Iterable` over all edges with the given label and direction incident on this vertex

    - #### getRelations

          public Iterable<TitanRelation> getRelations()

      Description copied from interface: `TitanVertex`
      Returns an iterable over all relations incident on this vertex.

      There is no guarantee concerning the order in which the relations are returned. Note, that this method potentially returns both `TitanEdge` and `TitanProperty`.
      Specified by:
        `getRelations` in interface `TitanVertex`
      Returns:
        `Iterable` over all properties and edges incident on this vertex.

    - #### getVertices

          public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(com.tinkerpop.blueprints.Direction direction,
                                                              String... labels)

      Specified by:
        `getVertices` in interface `com.tinkerpop.blueprints.Vertex`

    - #### getPropertyCount

          public long getPropertyCount()

      Description copied from interface: `TitanVertex`
      Returns the number of properties incident on this vertex.

      Returns the total number of properties irrespective of key.
      Specified by:
        `getPropertyCount` in interface `TitanVertex`
      Returns:
        The number of properties incident on this vertex.

    - #### getEdgeCount

          public long getEdgeCount()

      Description copied from interface: `TitanVertex`
      Returns the number of edges incident on this vertex.

      Returns the total number of edges irrespective of label and direction. Note, that loop edges, i.e. edges with identical in- and outgoing vertex, are counted twice.
      Specified by:
        `getEdgeCount` in interface `TitanVertex`
      Returns:
        The number of edges incident on this vertex.

    - #### isConnected

          public boolean isConnected()

      Description copied from interface: `TitanVertex`
      Checks whether this vertex has at least one incident edge. In other words, it returns getEdgeCount()>0, but might be implemented more efficiently.
      Specified by:
        `isConnected` in interface `TitanVertex`
      Returns:
        true, if this vertex has at least one incident edge, else false

    - #### addProperty

          public TitanProperty addProperty(PropertyKey key,
                                  Object attribute)

      Description copied from interface: `TitanVertex`
      Creates a new property for this vertex and given key with the specified value.

      Creates and returns a new `TitanProperty` for the given key on this vertex with the specified object being the value.
      Specified by:
        `addProperty` in interface `TitanVertex`
      Parameters:
        `key` - key of the property to be created
        `attribute` - value of the property to be created
      Returns:
        New property

    - #### addProperty

          public TitanProperty addProperty(String key,
                                  Object attribute)

      Description copied from interface: `TitanVertex`
      Creates a new property for this vertex and given key with the specified value.

      Creates and returns a new `TitanProperty` for the given key on this vertex with the specified object being the value.
      Automatically creates the property key if it does not exist and automatic creation of types is enabled. Otherwise, this method with throw an `IllegalArgumentException`.
      Specified by:
        `addProperty` in interface `TitanVertex`
      Parameters:
        `key` - key of the property to be created
        `attribute` - value of the property to be created
      Returns:
        New property

    - #### setProperty

          public void setProperty(String key,
                         Object value)

      Description copied from interface: `TitanElement`
      Sets the value for the given key on this element. The key must be defined to have `Cardinality.SINGLE`, otherwise this method throws an exception.
      Specified by:
        `setProperty` in interface `TitanElement`
      Specified by:
        `setProperty` in interface `com.tinkerpop.blueprints.Element`
      Parameters:
        `key` - the string identifying the key
        `value` - the object value

    - #### setProperty

          public void setProperty(PropertyKey key,
                         Object value)

      Description copied from interface: `TitanElement`
      Sets the value for the given key on this element. The key must be defined to have `Cardinality.SINGLE`, otherwise this method throws an exception.
      Specified by:
        `setProperty` in interface `TitanElement`
      Parameters:
        `key` - the key
        `value` - the object value

    - #### addEdge

          public TitanEdge addEdge(EdgeLabel label,
                          TitanVertex vertex)

      Description copied from interface: `TitanVertex`
      Creates a new edge incident on this vertex.

      Creates and returns a new `TitanEdge` of the specified label with this vertex being the outgoing vertex and the given vertex being the incoming vertex.
      Specified by:
        `addEdge` in interface `TitanVertex`
      Parameters:
        `label` - label of the edge to be created
        `vertex` - incoming vertex of the edge to be created
      Returns:
        new edge

    - #### addEdge

          public TitanEdge addEdge(String label,
                          TitanVertex vertex)

      Description copied from interface: `TitanVertex`
      Creates a new edge incident on this vertex.

      Creates and returns a new `TitanEdge` of the specified label with this vertex being the outgoing vertex and the given vertex being the incoming vertex.
      Automatically creates the edge label if it does not exist and automatic creation of types is enabled. Otherwise, this method with throw an `IllegalArgumentException`.
      Specified by:
        `addEdge` in interface `TitanVertex`
      Parameters:
        `label` - label of the edge to be created
        `vertex` - incoming vertex of the edge to be created
      Returns:
        new edge

    - #### addEdge

          public com.tinkerpop.blueprints.Edge addEdge(String label,
                                              com.tinkerpop.blueprints.Vertex vertex)

      Specified by:
        `addEdge` in interface `com.tinkerpop.blueprints.Vertex`

    - #### removeProperty

          public <O> O removeProperty(RelationType key)

      Description copied from interface: `TitanElement`
      Removes the value associated with the given key for this vertex (if exists). If the key is list-valued then all values associated with this key are removed and only the last removed value returned.
      Specified by:
        `removeProperty` in interface `TitanElement`
      Parameters:
        `key` - the key
      Returns:
        the object value associated with that key prior to removal, or NULL if such does not exist.

    - #### removeProperty

          public <O> O removeProperty(String key)

      Description copied from interface: `TitanElement`
      Removes the value associated with the given key for this vertex (if exists).
      Specified by:
        `removeProperty` in interface `TitanElement`
      Specified by:
        `removeProperty` in interface `com.tinkerpop.blueprints.Element`
      Parameters:
        `key` - the string identifying the key
      Returns:
        the object value associated with that key prior to removal, or NULL if such does not exist.
      See Also:
        `TitanElement.removeProperty(RelationType)`

Copyright © 2012–2014. All rights reserved.