public class MemoryTermStore<T extends ReasonerTerm> extends Object implements TermStore<T,RandomVariableAtom>
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PREFIX |
static int |
INITIAL_SIZE_DEFAULT |
static String |
INITIAL_SIZE_KEY
Initial size for the memory store.
|
Constructor and Description |
---|
MemoryTermStore() |
MemoryTermStore(int initialSize) |
Modifier and Type | Method and Description |
---|---|
void |
add(GroundRule rule,
T term)
Add a term to the store that was generated from the given ground rule.
|
void |
clear()
Remove any existing terms and prepare for a new set.
|
void |
close()
Close down the term store, it will not be used any more.
|
RandomVariableAtom |
createLocalVariable(RandomVariableAtom atom)
Create a variable local to a specific term.
|
void |
ensureCapacity(int capacity)
Ensure that the underlying stuctures can have the required term capacity.
|
void |
ensureVariableCapacity(int capacity)
Ensure that the underlying stuctures can have the required variable capacity.
|
T |
get(int index) |
Iterator<T> |
iterator() |
Iterator<T> |
noWriteIterator()
Get an iterator over the terms in the store that does not write to disk.
|
void |
shuffle() |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final String CONFIG_PREFIX
public static final String INITIAL_SIZE_KEY
public static final int INITIAL_SIZE_DEFAULT
public MemoryTermStore()
public MemoryTermStore(int initialSize)
public void add(GroundRule rule, T term)
TermStore
add
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public void clear()
TermStore
clear
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public void close()
TermStore
close
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public T get(int index)
get
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public int size()
size
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public void ensureCapacity(int capacity)
TermStore
ensureCapacity
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public Iterator<T> iterator()
iterator
in interface Iterable<T extends ReasonerTerm>
public Iterator<T> noWriteIterator()
TermStore
noWriteIterator
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public RandomVariableAtom createLocalVariable(RandomVariableAtom atom)
TermStore
createLocalVariable
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public void ensureVariableCapacity(int capacity)
TermStore
ensureVariableCapacity
in interface TermStore<T extends ReasonerTerm,RandomVariableAtom>
public void shuffle()
Copyright © 2020 University of California, Santa Cruz. All rights reserved.