public class PersistedAtomManager extends Object implements AtomManager
AtomManager
with a twist: this AtomManager will only return
RandomVariableAtoms
that were persisted in the Database
at instantiation.
All other types of Atoms are returned normally.
Constructor and Description |
---|
PersistedAtomManager(Database db)
Constructs a PersistedAtomManager with a built-in set of all the database's
persisted RandomVariableAtoms.
|
Modifier and Type | Method and Description |
---|---|
ResultList |
executeQuery(DatabaseQuery query)
Calls
Database.executeQuery(DatabaseQuery) on the
encapsulated Database. |
GroundAtom |
getAtom(Predicate p,
GroundTerm... arguments)
Returns the GroundAtom for the given Predicate and GroundTerms.
|
Iterable<RandomVariableAtom> |
getPersistedRVAtoms() |
boolean |
isClosed(StandardPredicate predicate)
Calls
Database.isClosed(StandardPredicate) on the
encapsulated Database. |
public PersistedAtomManager(Database db)
db
- the Database to query for all getAtom() calls.public GroundAtom getAtom(Predicate p, GroundTerm... arguments)
AtomManager
This method must call Database.getAtom(Predicate, GroundTerm...)
to actually retrieve the GroundAtom.
getAtom
in interface AtomManager
p
- the Predicate of the Atomarguments
- the GroundTerms of the Atompublic ResultList executeQuery(DatabaseQuery query)
AtomManager
Database.executeQuery(DatabaseQuery)
on the
encapsulated Database.executeQuery
in interface AtomManager
query
- the query to executepublic boolean isClosed(StandardPredicate predicate)
AtomManager
Database.isClosed(StandardPredicate)
on the
encapsulated Database.isClosed
in interface AtomManager
predicate
- the predicate to checkpublic Iterable<RandomVariableAtom> getPersistedRVAtoms()