sofya.graphs
Class GraphCache.CachedGraph

java.lang.Object
  extended by sofya.graphs.GraphCache.CachedGraph
Enclosing class:
GraphCache

public static class GraphCache.CachedGraph
extends java.lang.Object

Container class used to encapsulate a cached graph and its associated status for passing to external users of the cache.


Method Summary
 Graph getGraph()
          Gets the graph retrieved from the cache.
 boolean isComplete()
          Reports whether the graph has been marked as complete.
 boolean isFresh()
          Reports whether the graph has been marked as fresh.
 void setComplete(boolean isComplete)
          Sets whether a graph is complete.
 void setFresh(boolean isFresh)
          Sets whether a graph is fresh.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGraph

public Graph getGraph()
Gets the graph retrieved from the cache.

Returns:
The graph which was retrieved from the cache.

isComplete

public boolean isComplete()
Reports whether the graph has been marked as complete.

Only graphs marked as complete are cached to disk! This is a safety measure to avoid corrupting algorithms which may depend on object identity to function correctly. It may be relaxed in the future.

Returns:
true if the graph is considered complete

setComplete

public void setComplete(boolean isComplete)
Sets whether a graph is complete.

Only graphs marked as complete are cached to disk! This is a safety measure to avoid corrupting algorithms which may depend on object identity to function correctly. It may be relaxed in the future.

Parameters:
isComplete - true to mark the graph as complete, false otherwise.

isFresh

public boolean isFresh()
Reports whether the graph has been marked as fresh.

This flag may be set internally to indicate that a graph was constructed automatically by the type inference module. This is used, for example, by the CFGBuilder to return the graph from the cache the first time it is requested, even if by a buildCFG method.

Returns:
trueIf the graph has not been requested externally since it was constructed.

setFresh

public void setFresh(boolean isFresh)
Sets whether a graph is fresh.

A graph should be considered fresh only if it has not been requested externally since it was constructed.

Parameters:
isFresh - true to mark the graph as fresh, false otherwise.