com.thinkaurelius.titan.graphdb.transaction.vertexcache

## Interface VertexCache

- All Known Implementing Classes:
    GuavaVertexCache, LRUVertexCache

      public interface VertexCache

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(InternalVertex vertex, long id)` Adds the given vertex with the given id to the cache.
    `void` | `close()` Closes the cache which allows the cache to release allocated memory.
    `boolean` | `contains(long id)` Checks whether the cache contains a vertex with the given id
    `InternalVertex` | `get(long id, Retriever<Long,InternalVertex> retriever)` Returns the vertex with the given id or null if it is not in the cache
    `List<InternalVertex>` | `getAllNew()` Returns an iterable over all new vertices in the cache

- - ### Method Detail

    - #### contains

          boolean contains(long id)

      Checks whether the cache contains a vertex with the given id
      Parameters:
        `id` - Vertex id
      Returns:
        true if a vertex with the given id is contained, else false

    - #### get

          InternalVertex get(long id,
                           Retriever<Long,InternalVertex> retriever)

      Returns the vertex with the given id or null if it is not in the cache
      Parameters:
        `id` -
      Returns:

    - #### add

          void add(InternalVertex vertex,
                 long id)

      Adds the given vertex with the given id to the cache. The given vertex may already be in the cache. In other words, this method may be called to ensure that a vertex is still in the cache.
      Parameters:
        `vertex` -
        `id` -
      Throws:
        `IllegalArgumentException` - if the vertex is null or the id negative

    - #### getAllNew

          List<InternalVertex> getAllNew()

      Returns an iterable over all new vertices in the cache
      Returns:

    - #### close

          void close()

      Closes the cache which allows the cache to release allocated memory. Calling any of the other methods after closing a cache has undetermined behavior.

Copyright © 2012–2014. All rights reserved.