Class RecordedDatabase
java.lang.Object
org.projog.core.predicate.builtin.db.RecordedDatabase
Provides a mechanism to associate a term with a key.
Multiple terms can be associated with the same key.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SortedMap<PredicateKey, RecordedDatabase.Chain> private final List<PredicateKey> private final AtomicLongprivate final SortedMap<Long, RecordedDatabase.Link> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) IntegerNumberadd(PredicateKey key, Term value, boolean addLast) Associates a value with a key.private voidaddReference(IntegerNumber reference, RecordedDatabase.Link link, boolean addLast) private RecordedDatabase.ChaincreateChain(PredicateKey key) private RecordedDatabase.LinkcreateLink(RecordedDatabase.Chain chain, Term value, boolean addLast) private IntegerNumber(package private) booleangetAll()getChain(PredicateKey key) private RecordedDatabase.Chainprivate booleanremoveReference(Long reference)
-
Field Details
-
referenceCtr
-
references
-
keys
-
chains
-
-
Constructor Details
-
RecordedDatabase
public RecordedDatabase()
-
-
Method Details
-
add
Associates a value with a key.- Parameters:
key- the key to associate the value withvalue- the value to store- Returns:
- reference for the newly added value
-
getAll
-
getChain
-
erase
- Parameters:
reference- the reference of the term to remove- Returns:
trueif a term was removed elsefalse(i.e. if there was no term associated with the specifiedreference)
-
getOrCreateChain
-
createChain
-
createLink
-
createReference
-
addReference
-
removeReference
-