Class EmptyMemory
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.process.computer.util.EmptyMemory
 
- 
- All Implemented Interfaces:
- Memory,- Memory.Admin
 
 public final class EmptyMemory extends Object implements Memory.Admin - Author:
- Marko A. Rodriguez (http://markorodriguez.com)
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.computer.MemoryMemory.Admin, Memory.Exceptions
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String key, Object value)Set the value of the provided key.MemoryasImmutable()booleanexists(String key)Whether the key exists in the memory.<R> Rget(String key)Get the value associated with the provided key.intgetIteration()Get the current iteration number.longgetRuntime()Get the amount of milliseconds theGraphComputerhas been executing thus far.static EmptyMemoryinstance()Set<String>keys()The set of keys currently associated with this memory.voidset(String key, Object value)voidsetIteration(int iteration)voidsetRuntime(long runtime)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.computer.MemoryasMap, isInitialIteration
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.computer.Memory.AdminincrIteration
 
- 
 
- 
- 
- 
Method Detail- 
instancepublic static EmptyMemory instance() 
 - 
setIterationpublic void setIteration(int iteration) - Specified by:
- setIterationin interface- Memory.Admin
 
 - 
setRuntimepublic void setRuntime(long runtime) - Specified by:
- setRuntimein interface- Memory.Admin
 
 - 
asImmutablepublic Memory asImmutable() - Specified by:
- asImmutablein interface- Memory.Admin
 
 - 
keyspublic Set<String> keys() Description copied from interface:MemoryThe set of keys currently associated with this memory.
 - 
getpublic <R> R get(String key) throws IllegalArgumentException Description copied from interface:MemoryGet the value associated with the provided key.- Specified by:
- getin interface- Memory
- Type Parameters:
- R- the type of the value
- Parameters:
- key- the key of the value
- Returns:
- the value
- Throws:
- IllegalArgumentException- is thrown if the key does not exist
 
 - 
setpublic void set(String key, Object value) throws IllegalArgumentException, IllegalStateException - Specified by:
- setin interface- Memory
- Throws:
- IllegalArgumentException
- IllegalStateException
 
 - 
addpublic void add(String key, Object value) throws IllegalArgumentException, IllegalStateException Description copied from interface:MemorySet the value of the provided key. This is typically called in setup() and/or terminate() of theVertexProgram. If this is called during execute(), there is no guarantee as to the ultimately stored value as call order is indeterminate. It is up to the implementation to determine the states in which this method can be called.- Specified by:
- addin interface- Memory
- Parameters:
- key- they key to set a value for
- value- the value to set for the key
- Throws:
- IllegalArgumentException
- IllegalStateException
 
 - 
getIterationpublic int getIteration() Description copied from interface:MemoryGet the current iteration number.- Specified by:
- getIterationin interface- Memory
- Returns:
- the current iteration
 
 - 
getRuntimepublic long getRuntime() Description copied from interface:MemoryGet the amount of milliseconds theGraphComputerhas been executing thus far.- Specified by:
- getRuntimein interface- Memory
- Returns:
- the total time in milliseconds
 
 
- 
 
-