com.thinkaurelius.titan.core

## Enum Multiplicity

- java.lang.Object
- - java.lang.Enum<Multiplicity>
  - - com.thinkaurelius.titan.core.Multiplicity

- All Implemented Interfaces:
    Serializable, Comparable<Multiplicity>

      public enum Multiplicity
      extends Enum<Multiplicity>

  The multiplicity of edges between vertices for a given label. Multiplicity here is understood in the same sense as for UML class diagrams
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `MANY2ONE` There can only be a single out-edge of this label for a given vertex but multiple in-edges (i.e.
    `MULTI` The given edge label specifies a multi-graph, meaning that the multiplicity is not constrained and that there may be multiple edges of this label between any given pair of vertices.
    `ONE2MANY` There can only be a single in-edge of this label for a given vertex but multiple out-edges (i.e.
    `ONE2ONE` There can be only a single in and out-edge of this label for a given vertex (i.e.
    `SIMPLE` The given edge label specifies a simple graph, meaning that the multiplicity is not constrained but that there can only be at most a single edge of this label between a given pair of vertices.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Multiplicity` | `convert(Cardinality cardinality)`
    `Cardinality` | `getCardinality()`
    `boolean` | `isConstrained()` Whether this multiplicity imposes any constraint on the number of edges that may exist between a pair of vertices.
    `boolean` | `isConstrained(com.tinkerpop.blueprints.Direction direction)`
    `boolean` | `isUnique(com.tinkerpop.blueprints.Direction direction)` If this multiplicity implies edge uniqueness in the given direction for any given vertex.
    `static Multiplicity` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static Multiplicity[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

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

- - ### Enum Constant Detail

    - #### MULTI

          public static final Multiplicity MULTI

      The given edge label specifies a multi-graph, meaning that the multiplicity is not constrained and that there may be multiple edges of this label between any given pair of vertices.

    - #### SIMPLE

          public static final Multiplicity SIMPLE

      The given edge label specifies a simple graph, meaning that the multiplicity is not constrained but that there can only be at most a single edge of this label between a given pair of vertices.

    - #### ONE2MANY

          public static final Multiplicity ONE2MANY

      There can only be a single in-edge of this label for a given vertex but multiple out-edges (i.e. in-unique)

    - #### MANY2ONE

          public static final Multiplicity MANY2ONE

      There can only be a single out-edge of this label for a given vertex but multiple in-edges (i.e. out-unique)

    - #### ONE2ONE

          public static final Multiplicity ONE2ONE

      There can be only a single in and out-edge of this label for a given vertex (i.e. unique in both directions).

  - ### Method Detail

    - #### values

          public static Multiplicity[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Multiplicity c : Multiplicity.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Multiplicity valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### isConstrained

          public boolean isConstrained()

      Whether this multiplicity imposes any constraint on the number of edges that may exist between a pair of vertices.
      Returns:

    - #### isConstrained

          public boolean isConstrained(com.tinkerpop.blueprints.Direction direction)

    - #### isUnique

          public boolean isUnique(com.tinkerpop.blueprints.Direction direction)

      If this multiplicity implies edge uniqueness in the given direction for any given vertex.
      Parameters:
        `direction` -
      Returns:

    - #### convert

          public static Multiplicity convert(Cardinality cardinality)

    - #### getCardinality

          public Cardinality getCardinality()

Copyright © 2012–2014. All rights reserved.