com.thinkaurelius.titan.graphdb.relations

## Class AbstractTypedRelation

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.internal.AbstractElement
  - - com.thinkaurelius.titan.graphdb.relations.AbstractTypedRelation

- All Implemented Interfaces:
    Idfiable, TitanElement, TitanRelation, InternalElement, InternalRelation, Removable, com.tinkerpop.blueprints.Element, Comparable<TitanElement>
  Direct Known Subclasses:
    AbstractEdge, AbstractProperty

      public abstract class AbstractTypedRelation
      extends AbstractElement
      implements InternalRelation

- - ### Property Summary

    - ### Properties inherited from interface com.thinkaurelius.titan.core.TitanRelation

      `isProperty`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected InternalRelationType` | `type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTypedRelation(long id, RelationType type)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.tinkerpop.blueprints.Direction` | `getDirection(TitanVertex vertex)` Returns the direction of this relation from the perspective of the specified vertex.
    `RelationIdentifier` | `getId()` Returns a unique identifier for this entity.
    `TitanVertex` | `getProperty(EdgeLabel label)` Returns the vertex associated to this relation by a unidirected edge of the given label or NULL if such does not exist.
    `<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(RelationType type)`
    `<O> O` | `getProperty(String key)` Retrieves the value associated with the given key on this vertex and casts it to the specified type.
    `Set<String>` | `getPropertyKeys()`
    `RelationType` | `getType()` Returns the type of this relation.
    `boolean` | `isHidden()` Whether this element is hidden and should only be returned to queries that explicitly ask for hidden elements.
    `boolean` | `isIncidentOn(TitanVertex vertex)` Checks whether this relation is incident on the specified vertex.
    `boolean` | `isLoop()` Checks whether this relation is a loop.
    `InternalRelation` | `it()` Returns this element in the context of the current transaction.
    `<O> O` | `removeProperty(RelationType type)` 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(EdgeLabel label, TitanVertex vertex)` Establishes a unidirectional edge between this relation and the given vertex for the specified label.
    `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.
    `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, getCompareId, getLongId, hashCode, hasId, isLoaded, isNew, isRemoved, isTemporaryId, setId`

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

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

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

      `getArity, getLen, getPropertyDirect, getPropertyKeysDirect, getVertex, removePropertyDirect, setPropertyDirect`

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

      `isEdge, isProperty`

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

      `getLifeCycle, setId`

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

      `getLongId, hasId, isLoaded, isNew, isRemoved, remove`

- - ### Field Detail

    - #### type

          protected final InternalRelationType type

  - ### Constructor Detail

    - #### AbstractTypedRelation

          public AbstractTypedRelation(long id,
                               RelationType type)

  - ### Method Detail

    - #### it

          public InternalRelation 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 `InternalRelation`
      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:

    - #### getDirection

          public com.tinkerpop.blueprints.Direction getDirection(TitanVertex vertex)

      Description copied from interface: `TitanRelation`
      Returns the direction of this relation from the perspective of the specified vertex.
      Specified by:
        `getDirection` in interface `TitanRelation`
      Parameters:
        `vertex` - vertex on which the relation is incident
      Returns:
        The direction of this relation from the perspective of the specified vertex.

    - #### isIncidentOn

          public boolean isIncidentOn(TitanVertex vertex)

      Description copied from interface: `TitanRelation`
      Checks whether this relation is incident on the specified vertex.
      Specified by:
        `isIncidentOn` in interface `TitanRelation`
      Parameters:
        `vertex` - vertex to check incidence for
      Returns:
        true, if this relation is incident on the vertex, else false

    - #### isHidden

          public boolean isHidden()

      Description copied from interface: `InternalElement`
      Whether this element is hidden and should only be returned to queries that explicitly ask for hidden elements.
      Specified by:
        `isHidden` in interface `InternalElement`
      Overrides:
        `isHidden` in class `AbstractElement`
      Returns:

    - #### isLoop

          public boolean isLoop()

      Description copied from interface: `TitanRelation`
      Checks whether this relation is a loop. An relation is a loop if it connects a vertex with itself.
      Specified by:
        `isLoop` in interface `TitanRelation`
      Returns:
        true, if this relation is a loop, else false.

    - #### getType

          public RelationType getType()

      Description copied from interface: `TitanRelation`
      Returns the type of this relation.

      The type is either a label (`EdgeLabel` if this relation is an edge or a key (`PropertyKey`) if this relation is a property.
      Specified by:
        `getType` in interface `TitanRelation`
      Returns:
        Type of this relation

    - #### getId

          public RelationIdentifier 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()`

    - #### 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)`

    - #### removeProperty

          public <O> O removeProperty(RelationType type)

      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:
        `type` - the key
      Returns:
        the object value associated with that key prior to removal, or NULL if such does not exist.

    - #### setProperty

          public void setProperty(EdgeLabel label,
                         TitanVertex vertex)

      Description copied from interface: `TitanRelation`
      Establishes a unidirectional edge between this relation and the given vertex for the specified label. The label must be defined `EdgeLabel.isUnidirected()`.
      Specified by:
        `setProperty` in interface `TitanRelation`

    - #### 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

    - #### 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

    - #### 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

    - #### getProperty

          public TitanVertex getProperty(EdgeLabel label)

      Description copied from interface: `TitanRelation`
      Returns the vertex associated to this relation by a unidirected edge of the given label or NULL if such does not exist.
      Specified by:
        `getProperty` in interface `TitanRelation`
      Returns:

    - #### getProperty

          public <O> O getProperty(RelationType type)

      Specified by:
        `getProperty` in interface `InternalRelation`

    - #### getPropertyKeys

          public Set<String> getPropertyKeys()

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

Copyright © 2012–2014. All rights reserved.