/** * Add an value -> object pair to the object index. * @param value The value. * @param object The object. * @param ci The constraint indexer. */ public void addObject(Object value, Object object, ConstraintIndexer ci) { getIndexedMemory(ci).addObject(value, object); }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((BetaMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Add an value -> object pair to the tuple index. * @param value The value. * @param tuple The tuple. * @param ci The constraint indexer. */ public void addTuple(Object value, Tuple tuple, ConstraintIndexer ci) { getIndexedMemory(ci).addTuple(value, tuple); }
/** * Get the indexed objects per tuple. * @param tuple The indexed tuple. * @param ci The constraint indexer. */ public Set getObjects(Tuple tuple, ConstraintIndexer ci) { IndexedConstraintMemory mem = getIndexedMemory(ci); Object value = mem.getTupleValue(tuple); return mem.getObjects(value); }
/** * Get the indexed tuples per object. * @param object The indexed object. * @param ci The constraint indexer. */ public Set getTuples(Object object, ConstraintIndexer ci) { IndexedConstraintMemory mem = getIndexedMemory(ci); Object value = mem.getObjectValue(object); return mem.getTuples(value); }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((CollectMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Remove an value -> object pair from the tuple index. * @param object The object. * @param ci The constraint indexer. */ public void removeTuple(Tuple tuple, ConstraintIndexer ci) { getIndexedMemory(ci).removeTuple(tuple); }
/** * Propagate a change of a tuple in the result memory. */ protected void propagateModification(Tuple left, Object right, int tupleindex, OAVAttributeType type, Object oldvalue, Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { Tuple tuple = mem.getTuple(state, left, right); ITupleConsumerNode[] tcs = tconsumers; for(int j=0; tcs!=null && j<tcs.length; j++) tcs[j].modifyTuple(tuple, tupleindex, type, oldvalue, newvalue, state, mem, agenda); }
/** * Remove an object from the object index. * @param object The object. * @param ci The constraint indexer. */ public void removeObject(Object object, ConstraintIndexer ci) { getIndexedMemory(ci).removeObject(object); }
/** * Remove a tuple from the memory. * @param left The tuple. * @param bmem The beta memory. */ public void removeTuple(Tuple left, BetaMemory bmem) { bmem.removeTuple(left, this); }
/** * Notification when a rule has been removed. * @param rule The removed rule. */ public void ruleRemoved(IRule rule) { node.removeRule(rule); }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((BetaMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Get the indexed objects per tuple. * @param tuple The indexed tuple. * @param ci The constraint indexer. */ public Set getObjects(Tuple tuple, ConstraintIndexer ci) { IndexedConstraintMemory mem = getIndexedMemory(ci); Object value = mem.getTupleValue(tuple); return mem.getObjects(value); }
/** * Get the indexed tuples per object. * @param object The indexed object. * @param ci The constraint indexer. */ public Set getTuples(Object object, ConstraintIndexer ci) { IndexedConstraintMemory mem = getIndexedMemory(ci); Object value = mem.getObjectValue(object); return mem.getTuples(value); }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((CollectMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Add an value -> object pair to the object index. * @param value The value. * @param object The object. * @param ci The constraint indexer. */ public void addObject(Object value, Object object, ConstraintIndexer ci) { getIndexedMemory(ci).addObject(value, object); }
/** * Add an value -> object pair to the tuple index. * @param value The value. * @param tuple The tuple. * @param ci The constraint indexer. */ public void addTuple(Object value, Tuple tuple, ConstraintIndexer ci) { getIndexedMemory(ci).addTuple(value, tuple); }
/** * Remove an value -> object pair from the tuple index. * @param object The object. * @param ci The constraint indexer. */ public void removeTuple(Tuple tuple, ConstraintIndexer ci) { getIndexedMemory(ci).removeTuple(tuple); }
/** * Propagate a change of a tuple in the result memory. */ protected void propagateModification(Tuple left, Object right, int tupleindex, OAVAttributeType type, Object oldvalue, Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { Tuple tuple = mem.getTuple(state, left, right); ITupleConsumerNode[] tcs = tconsumers; for(int j=0; tcs!=null && j<tcs.length; j++) tcs[j].modifyTuple(tuple, tupleindex, type, oldvalue, newvalue, state, mem, agenda); }
/** * Remove an object from the object index. * @param object The object. * @param ci The constraint indexer. */ public void removeObject(Object object, ConstraintIndexer ci) { getIndexedMemory(ci).removeObject(object); }