public int compareTo(EventFactHandle e) { return (getStartTimestamp() < e.getStartTimestamp()) ? -1 : (getStartTimestamp() == e.getStartTimestamp() ? 0 : 1); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long rightStartTS = ((EventFactHandle) right).getStartTimestamp(); long dist = Math.abs( rightStartTS - ((LeftEndRightStartContextEntry)context).timestamp ); return this.getOperator().isNegated() ^ ( dist <= this.finalRange ); }
public boolean evaluate(InternalWorkingMemory workingMemory, final InternalReadAccessor extractor1, final InternalFactHandle handle1, final InternalReadAccessor extractor2, final InternalFactHandle handle2) { if ( extractor1.isNullValue( workingMemory, handle1.getObject() ) || extractor2.isNullValue( workingMemory, handle2.getObject() ) ) { return false; } long distStart = ((EventFactHandle) handle1).getStartTimestamp() - ((EventFactHandle) handle2).getStartTimestamp(); long distEnd = Math.abs( ((EventFactHandle) handle2).getEndTimestamp() - ((EventFactHandle) handle1).getEndTimestamp() ); return this.getOperator().isNegated() ^ (distStart > 0 && distEnd <= this.endDev); }
public boolean evaluate(InternalWorkingMemory workingMemory, final InternalReadAccessor extractor1, final InternalFactHandle handle1, final InternalReadAccessor extractor2, final InternalFactHandle handle2) { if ( extractor1.isNullValue( workingMemory, handle1.getObject() ) || extractor2.isNullValue( workingMemory, handle2.getObject() ) ) { return false; } long distStart = ((EventFactHandle) handle2).getStartTimestamp() - ((EventFactHandle) handle1).getStartTimestamp(); long distEnd = Math.abs( ((EventFactHandle) handle2).getEndTimestamp() - ((EventFactHandle) handle1).getEndTimestamp() ); return this.getOperator().isNegated() ^ (distStart > 0 && distEnd <= this.endDev); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long distStart = ((EventFactHandle) right).getStartTimestamp() - ((TemporalVariableContextEntry) context).startTS; long distEnd = Math.abs( ((TemporalVariableContextEntry) context).endTS - ((EventFactHandle) right).getEndTimestamp() ); return this.getOperator().isNegated() ^ (distStart > 0 && distEnd <= this.endDev); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long distStart = Math.abs( ((EventFactHandle) right).getStartTimestamp() - ((TemporalVariableContextEntry) context).startTS); long distEnd = ((TemporalVariableContextEntry) context).endTS - ((EventFactHandle) right).getEndTimestamp(); return this.getOperator().isNegated() ^ (distStart <= this.startDev && distEnd > 0 ); }
public boolean evaluate(InternalWorkingMemory workingMemory, final InternalReadAccessor extractor1, final InternalFactHandle handle1, final InternalReadAccessor extractor2, final InternalFactHandle handle2) { if ( extractor1.isNullValue( workingMemory, handle1.getObject() ) || extractor2.isNullValue( workingMemory, handle2.getObject() ) ) { return false; } long distStart = Math.abs(((EventFactHandle) handle1 ).getStartTimestamp() - ((EventFactHandle) handle2 ).getStartTimestamp()); long distEnd = ((EventFactHandle) handle1 ).getEndTimestamp() - ((EventFactHandle) handle2 ).getEndTimestamp(); return this.getOperator().isNegated() ^ ( distStart <= this.startDev && distEnd > 0 ); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long leftStartTS = ((EventFactHandle) left).getStartTimestamp(); long dist = Math.abs( leftStartTS - ((LeftStartRightEndContextEntry) context).timestamp ); return this.getOperator().isNegated() ^ (dist <= this.finalRange); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long distStart = Math.abs(((EventFactHandle) right ).getStartTimestamp() - ((TemporalVariableContextEntry) context).startTS); long distEnd = ((EventFactHandle) right ).getEndTimestamp() - ((TemporalVariableContextEntry) context).endTS; return this.getOperator().isNegated() ^ ( distStart <= this.startDev && distEnd > 0 ); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long distStart = ((TemporalVariableContextEntry) context).startTS - ((EventFactHandle) right).getStartTimestamp(); long distEnd = Math.abs( ((TemporalVariableContextEntry) context).endTS - ((EventFactHandle) right).getEndTimestamp() ); return this.getOperator().isNegated() ^ (distStart > 0 && distEnd <= this.endDev); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long distStart = Math.abs( ((TemporalVariableContextEntry) context).startTS - ((EventFactHandle) left).getStartTimestamp() ); long distEnd = ((EventFactHandle) left).getEndTimestamp() - ((TemporalVariableContextEntry) context).endTS; return this.getOperator().isNegated() ^ (distStart <= this.startDev && distEnd > 0 ); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long distStart = ((EventFactHandle) left).getStartTimestamp() - ((TemporalVariableContextEntry) context).startTS; long distEnd = Math.abs( ((EventFactHandle) left).getEndTimestamp() - ((TemporalVariableContextEntry) context).endTS ); return this.getOperator().isNegated() ^ (distStart > 0 && distEnd <= this.endDev); }
public boolean evaluate(InternalWorkingMemory workingMemory, final InternalReadAccessor extractor1, final InternalFactHandle handle1, final InternalReadAccessor extractor2, final InternalFactHandle handle2) { if ( extractor1.isNullValue( workingMemory, handle1.getObject() ) || extractor2.isNullValue( workingMemory, handle2.getObject() ) ) { return false; } long distStart = ((EventFactHandle) handle1).getStartTimestamp() - ((EventFactHandle) handle2).getStartTimestamp(); long distEnd = ((EventFactHandle) handle2).getEndTimestamp() - ((EventFactHandle) handle1).getEndTimestamp(); return this.getOperator().isNegated() ^ (distStart >= this.startMinDev && distStart <= this.startMaxDev && distEnd >= this.endMinDev && distEnd <= this.endMaxDev); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long distStart = Math.abs(((TemporalVariableContextEntry) context).startTS - ((EventFactHandle) left ).getStartTimestamp()); long distEnd = ((TemporalVariableContextEntry) context).endTS - ((EventFactHandle) left ).getEndTimestamp(); return this.getOperator().isNegated() ^ ( distStart <= this.startDev && distEnd > 0 ); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long distStart = ((TemporalVariableContextEntry) context).startTS - ((EventFactHandle) left).getStartTimestamp(); long distEnd = Math.abs( ((EventFactHandle) left).getEndTimestamp() -((TemporalVariableContextEntry) context).endTS ); return this.getOperator().isNegated() ^ (distStart > 0 && distEnd <= this.endDev); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long distStart = ((EventFactHandle) right).getStartTimestamp() - ((TemporalVariableContextEntry) context).startTS; long distEnd = ((TemporalVariableContextEntry) context).endTS - ((EventFactHandle) right).getEndTimestamp(); return this.getOperator().isNegated() ^ (distStart >= this.startMinDev && distStart <= this.startMaxDev && distEnd >= this.endMinDev && distEnd <= this.endMaxDev); }
public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle right) { if ( context.leftNull || context.extractor.isNullValue( workingMemory, right.getObject() ) ) { return false; } long distStart = ((TemporalVariableContextEntry) context).startTS- ((EventFactHandle) right).getStartTimestamp(); long distEnd = ((EventFactHandle) right).getEndTimestamp() - ((TemporalVariableContextEntry) context).endTS; return this.getOperator().isNegated() ^ (distStart >= this.startMinDev && distStart <= this.startMaxDev && distEnd >= this.endMinDev && distEnd <= this.endMaxDev); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long distStart = ((TemporalVariableContextEntry) context).startTS - ((EventFactHandle) left).getStartTimestamp(); long distEnd = ((EventFactHandle) left).getEndTimestamp() - ((TemporalVariableContextEntry) context).endTS; return this.getOperator().isNegated() ^ (distStart >= this.startMinDev && distStart <= this.startMaxDev && distEnd >= this.endMinDev && distEnd <= this.endMaxDev); }
public boolean evaluateCachedRight(InternalWorkingMemory workingMemory, final VariableContextEntry context, final InternalFactHandle left) { if ( context.rightNull || context.declaration.getExtractor().isNullValue( workingMemory, left.getObject() )) { return false; } long distStart = ((EventFactHandle) left).getStartTimestamp() - ((TemporalVariableContextEntry) context).startTS; long distEnd = ((TemporalVariableContextEntry) context).endTS - ((EventFactHandle) left).getEndTimestamp(); return this.getOperator().isNegated() ^ (distStart >= this.startMinDev && distStart <= this.startMaxDev && distEnd >= this.endMinDev && distEnd <= this.endMaxDev); }
public Trigger createTrigger( Activation item, WorkingMemory wm ) { long timestamp; if (eventFactHandleDecl != null) { LeftTuple leftTuple = item.getTuple(); EventFactHandle fh = (EventFactHandle) leftTuple.get(eventFactHandleDecl); timestamp = fh.getStartTimestamp(); } else { timestamp = ((InternalWorkingMemory)wm).getTimerService().getCurrentTime(); } String[] calendarNames = item.getRule().getCalendars(); Calendars calendars = ((InternalWorkingMemory) wm).getCalendars(); return createTrigger( timestamp, calendarNames, calendars ); }