com.googlecode.sarasvati.mem
Class MemGraphRepository

java.lang.Object
  extended by com.googlecode.sarasvati.mem.MemGraphRepository
All Implemented Interfaces:
GraphRepository<MemGraph>

public class MemGraphRepository
extends Object
implements GraphRepository<MemGraph>

A Graph Repository which can either store graphs in a global/static or local/per-repository cache.

Author:
Paul Lorenz

Field Summary
static MemGraphRepository INSTANCE
           
 
Constructor Summary
MemGraphRepository()
           
MemGraphRepository(boolean useGlobalCache)
           
 
Method Summary
 void addGraph(MemGraph graph)
          Adds a graph to the repository.
 List<MemGraph> getGraphs()
          Returns all graphs accessible via this repository.
 List<MemGraph> getGraphs(String name)
          Returns all graphs with the given name.
 MemGraph getLatestGraph(String name)
          Returns The newest Graph with the given name, or null if none is found.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final MemGraphRepository INSTANCE
Constructor Detail

MemGraphRepository

public MemGraphRepository()

MemGraphRepository

public MemGraphRepository(boolean useGlobalCache)
Method Detail

addGraph

public void addGraph(MemGraph graph)
Description copied from interface: GraphRepository
Adds a graph to the repository. Used by the GraphLoader.

Specified by:
addGraph in interface GraphRepository<MemGraph>
Parameters:
graph - The graph to add to the repository.

getGraphs

public List<MemGraph> getGraphs(String name)
Description copied from interface: GraphRepository
Returns all graphs with the given name.

Specified by:
getGraphs in interface GraphRepository<MemGraph>
Parameters:
name - The name to match
Returns:
All graphs with the given name

getGraphs

public List<MemGraph> getGraphs()
Description copied from interface: GraphRepository
Returns all graphs accessible via this repository.

Specified by:
getGraphs in interface GraphRepository<MemGraph>
Returns:
All graphs accessible via this repository.

getLatestGraph

public MemGraph getLatestGraph(String name)
Description copied from interface: GraphRepository
Returns The newest Graph with the given name, or null if none is found.

Specified by:
getLatestGraph in interface GraphRepository<MemGraph>
Parameters:
name - The graph name
Returns:
The newest Graph with the given name, or null if none is found.