com.thinkaurelius.titan.core

## Interface TitanVertex

- All Superinterfaces:
    com.tinkerpop.blueprints.Element, Idfiable, Removable, TitanElement, com.tinkerpop.blueprints.Vertex
  All Known Subinterfaces:
    EdgeLabel, InternalRelationType, InternalVertex, InternalVertexLabel, PropertyKey, RelationType, SystemRelationType, VertexLabel
  All Known Implementing Classes:
    AbstractVertex, BaseKey, BaseLabel, BaseRelationType, BaseVertexLabel, CacheVertex, EdgeLabelVertex, EmptyRelationType, EmptyVertex, FulgoraNeighborVertex, FulgoraVertex, ImplicitKey, PropertyKeyVertex, RelationTypeVertex, StandardVertex, TitanSchemaVertex, VertexLabelVertex

      public interface TitanVertex
      extends TitanElement, com.tinkerpop.blueprints.Vertex

  TitanVertex is the basic unit of a `TitanGraph`. It extends the functionality provided by Blueprint's `Vertex` by helper and convenience methods.

  Vertices have incident edges and properties. Edge connect the vertex to other vertices. Properties attach key-value pairs to this vertex to define it.

  Like `TitanRelation` a vertex has a vertex label.
  Author:
    Matthias Bröcheler (http://www.matthiasb.com)

- - ### 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.
    `TitanProperty` | `addProperty(PropertyKey key, Object value)` Creates a new property for this vertex and given key with the specified value.
    `TitanProperty` | `addProperty(String key, Object value)` Creates a new property for this vertex and given key with the specified value.
    `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 d, String... labels)` Returns an iterable over all edges of the specified edge label in the given direction incident on this vertex.
    `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.
    `long` | `getPropertyCount()` Returns the number of properties incident on this vertex.
    `Iterable<TitanRelation>` | `getRelations()` Returns an iterable over all relations incident on this vertex.
    `Iterable<TitanEdge>` | `getTitanEdges(com.tinkerpop.blueprints.Direction d, 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.
    `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.
    `TitanVertexQuery<? extends TitanVertexQuery>` | `query()` Starts a new `TitanVertexQuery` for this vertex.

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

      `getId, getLongId, getProperty, getProperty, hasId, isLoaded, isNew, isRemoved, remove, removeProperty, removeProperty, setProperty, setProperty`

    - ### Methods inherited from interface com.tinkerpop.blueprints.Vertex

      `addEdge, getVertices`

    - ### Methods inherited from interface com.tinkerpop.blueprints.Element

      `getPropertyKeys`

- - ### Method Detail

    - #### addEdge

          TitanEdge addEdge(EdgeLabel label,
                          TitanVertex vertex)

      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.
      Parameters:
        `label` - label of the edge to be created
        `vertex` - incoming vertex of the edge to be created
      Returns:
        new edge

    - #### addEdge

          TitanEdge addEdge(String label,
                          TitanVertex vertex)

      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`.
      Parameters:
        `label` - label of the edge to be created
        `vertex` - incoming vertex of the edge to be created
      Returns:
        new edge

    - #### addProperty

          TitanProperty addProperty(PropertyKey key,
                                  Object value)

      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.
      Parameters:
        `key` - key of the property to be created
        `value` - value of the property to be created
      Returns:
        New property
      Throws:
        `IllegalArgumentException` - if the value does not match the data type of the property key.

    - #### addProperty

          TitanProperty addProperty(String key,
                                  Object value)

      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`.
      Parameters:
        `key` - key of the property to be created
        `value` - value of the property to be created
      Returns:
        New property
      Throws:
        `IllegalArgumentException` - if the value does not match the data type of the property key.

    - #### getLabel

          String getLabel()

      Returns the name of the vertex label for this vertex.
      Returns:

    - #### getVertexLabel

          VertexLabel getVertexLabel()

      Returns the vertex label of this vertex.
      Returns:

    - #### query

          TitanVertexQuery<? extends TitanVertexQuery> query()

      Starts a new `TitanVertexQuery` for this vertex.

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

    - #### getProperties

          Iterable<TitanProperty> getProperties()

      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.
      Returns:
        `Iterable` over all properties incident on this vertex

    - #### getProperties

          Iterable<TitanProperty> getProperties(PropertyKey key)

      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.
      Parameters:
        `key` - `PropertyKey` of the returned properties
      Returns:
        `Iterable` over all properties of the specified key incident on this vertex

    - #### getProperties

          Iterable<TitanProperty> getProperties(String key)

      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.
      Parameters:
        `key` - key of the returned properties
      Returns:
        `Iterable` over all properties of the specified key incident on this vertex

    - #### getTitanEdges

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

      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.
      Parameters:
        `labels` - label of the returned edges
        `d` - Direction of the returned edges with respect to this vertex
      Returns:
        `Iterable` over all edges with the given label and direction incident on this vertex

    - #### getEdges

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

      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 `com.tinkerpop.blueprints.Vertex`
      Parameters:
        `labels` - label of the returned edges
        `d` - Direction of the returned edges with respect to this vertex
      Returns:
        `Iterable` over all edges with the given label and direction incident on this vertex

    - #### getEdges

          Iterable<TitanEdge> getEdges()

      Returns an iterable over all edges incident on this vertex.

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

    - #### getRelations

          Iterable<TitanRelation> getRelations()

      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`.
      Returns:
        `Iterable` over all properties and edges incident on this vertex.

    - #### getEdgeCount

          long getEdgeCount()

      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.
      Returns:
        The number of edges incident on this vertex.

    - #### getPropertyCount

          long getPropertyCount()

      Returns the number of properties incident on this vertex.

      Returns the total number of properties irrespective of key.
      Returns:
        The number of properties incident on this vertex.

    - #### isConnected

          boolean isConnected()

      Checks whether this vertex has at least one incident edge. In other words, it returns getEdgeCount()>0, but might be implemented more efficiently.
      Returns:
        true, if this vertex has at least one incident edge, else false

    - #### isModified

          boolean isModified()

      Checks whether this entity has been loaded into the current transaction and modified.
      Returns:
        True, has been loaded and modified, else false.

Copyright © 2012–2014. All rights reserved.