com.thinkaurelius.titan.core

## Interface VertexList

- All Superinterfaces:
    Iterable<TitanVertex>
  All Known Subinterfaces:
    VertexListInternal
  All Known Implementing Classes:
    VertexArrayList, VertexLongList

      public interface VertexList
      extends Iterable<TitanVertex>

  List of `TitanVertex`s.

  Basic interface for a list of vertices which supports retrieving individuals vertices or iterating over all of them, but does not support modification.

  VertexList is returned by `TitanVertexQuery`. Depending on how the query was executed that returned this VertexList, getting vertex ids might be significantly faster than retrieving vertex objects.
  Author:
    Matthias Bröcheler (http://www.matthiasb.com)

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TitanVertex` | `get(int pos)` Returns the vertex at a given position in the list.
    `long` | `getID(int pos)` Returns the id of the vertex at the specified position
    `com.carrotsearch.hppc.LongArrayList` | `getIDs()` Returns a list of ids of all vertices in this list of vertices in the same order of the original vertex list.
    `boolean` | `isSorted()` Whether this list of vertices is sorted by id in increasing order.
    `int` | `size()` Returns the number of vertices in this list.
    `void` | `sort()` Sorts this list according to vertex ids in increasing order.
    `VertexList` | `subList(int fromPosition, int length)` Returns a sub list of this list of vertices from the given position with the given number of vertices.

    - ### Methods inherited from interface java.lang.Iterable

      `iterator`

- - ### Method Detail

    - #### size

          int size()

      Returns the number of vertices in this list.
      Returns:
        Number of vertices in the list.

    - #### get

          TitanVertex get(int pos)

      Returns the vertex at a given position in the list.
      Parameters:
        `pos` - Position for which to retrieve the vertex.
      Returns:
        TitanVertex at the given position

    - #### sort

          void sort()

      Sorts this list according to vertex ids in increasing order. If the list is already sorted, invoking this method incurs no cost.
      Throws:
        `UnsupportedOperationException` - If not all vertices in this list have an id

    - #### isSorted

          boolean isSorted()

      Whether this list of vertices is sorted by id in increasing order.
      Returns:

    - #### subList

          VertexList subList(int fromPosition,
                           int length)

      Returns a sub list of this list of vertices from the given position with the given number of vertices.
      Parameters:
        `fromPosition` -
        `length` -
      Returns:

    - #### getIDs

          com.carrotsearch.hppc.LongArrayList getIDs()

      Returns a list of ids of all vertices in this list of vertices in the same order of the original vertex list.

      Uses an efficient primitive variable-sized array.
      Returns:
        A list of idAuthorities of all vertices in this list of vertices in the same order of the original vertex list.
      See Also:
        `AbstractLongList`

    - #### getID

          long getID(int pos)

      Returns the id of the vertex at the specified position
      Parameters:
        `pos` - The position of the vertex in the list
      Returns:
        The id of that vertex

Copyright © 2012–2014. All rights reserved.