public final class EmptyMemory extends Object implements Memory.Admin
Memory.Admin, Memory.Exceptions
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
Object value)
Set the value of the provided key.
|
Memory |
asImmutable() |
boolean |
exists(String key)
Whether the key exists in the memory.
|
<R> R |
get(String key)
Get the value associated with the provided key.
|
int |
getIteration()
Get the current iteration number.
|
long |
getRuntime()
Get the amount of milliseconds the
GraphComputer has been executing thus far. |
static EmptyMemory |
instance() |
Set<String> |
keys()
The set of keys currently associated with this memory.
|
void |
set(String key,
Object value) |
void |
setIteration(int iteration) |
void |
setRuntime(long runtime) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
incrIteration
asMap, isInitialIteration
public static EmptyMemory instance()
public void setIteration(int iteration)
setIteration
in interface Memory.Admin
public void setRuntime(long runtime)
setRuntime
in interface Memory.Admin
public Memory asImmutable()
asImmutable
in interface Memory.Admin
public Set<String> keys()
Memory
public <R> R get(String key) throws IllegalArgumentException
Memory
get
in interface Memory
R
- the type of the valuekey
- the key of the valueIllegalArgumentException
- is thrown if the key does not existpublic void set(String key, Object value) throws IllegalArgumentException, IllegalStateException
set
in interface Memory
IllegalArgumentException
IllegalStateException
public void add(String key, Object value) throws IllegalArgumentException, IllegalStateException
Memory
VertexProgram
. 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.add
in interface Memory
key
- they key to set a value forvalue
- the value to set for the keyIllegalArgumentException
IllegalStateException
public int getIteration()
Memory
getIteration
in interface Memory
public long getRuntime()
Memory
GraphComputer
has been executing thus far.getRuntime
in interface Memory
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.