@Test public void testEqualsObject() { final LeftTupleSource ts = new MockTupleSource( 1 ); final ObjectSource os = new MockObjectSource( 2 ); InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); BuildContext buildContext = new BuildContext( kBase ); final BetaNode j1 = new JoinNode( 1, ts, os, EmptyBetaConstraints.getInstance(), buildContext ); final BetaNode j2 = new JoinNode( 2, ts, os, EmptyBetaConstraints.getInstance(), buildContext ); final BetaNode n1 = new NotNode( 3, ts, os, EmptyBetaConstraints.getInstance(), buildContext ); final BetaNode n2 = new NotNode( 4, ts, os, EmptyBetaConstraints.getInstance(), buildContext ); assertEquals( j1, j1 ); assertEquals( j2, j2 ); assertEquals( j1, j2 ); assertEquals( n1, n1 ); assertEquals( n2, n2 ); assertEquals( n1, n2 ); assertFalse( j1.equals( n1 ) ); assertFalse( j1.equals( n2 ) ); assertFalse( n1.equals( j1 ) ); assertFalse( n1.equals( j2 ) ); }
@Override public boolean equals(Object object) { if (this == object) { return true; } if ( object == null || !(object instanceof BetaNode) || this.hashCode() != object.hashCode() ) { return false; } BetaNode other = (BetaNode) object; return this.getClass() == other.getClass() && this.constraints.equals( other.constraints ) && this.rightInputIsPassive == other.rightInputIsPassive && areNullSafeEquals(this.leftListenedProperties, other.leftListenedProperties) && areNullSafeEquals(this.rightListenedProperties, other.rightListenedProperties) && this.leftInput.getId() == other.leftInput.getId() && this.rightInput.getId() == other.rightInput.getId(); }
BetaNode extends LeftTupleSource implements
        LeftTupleSinkNode,
        ObjectSinkNode,
        RightTupleSink,
        MemoryFactory { @Override public boolean equals(Object object) { if (this == object) { return true; } if ( object == null || !(object instanceof BetaNode) || this.hashCode() != object.hashCode() ) { return false; } BetaNode other = (BetaNode) object; return this.getClass() == other.getClass() && this.constraints.equals( other.constraints ) && this.rightInputIsPassive == other.rightInputIsPassive && areNullSafeEquals(this.leftListenedProperties, other.leftListenedProperties) && areNullSafeEquals(this.rightListenedProperties, other.rightListenedProperties) && this.leftInput.getId() == other.leftInput.getId() && this.rightInput.getId() == other.rightInput.getId(); } }
BetaNode extends LeftTupleSource implements
        LeftTupleSinkNode,
        ObjectSinkNode,
        RightTupleSink,
        MemoryFactory { @Override public boolean equals(Object object) { if (this == object) { return true; } if ( object == null || !(object instanceof BetaNode) || this.hashCode() != object.hashCode() ) { return false; } BetaNode other = (BetaNode) object; return this.getClass() == other.getClass() && this.constraints.equals( other.constraints ) && this.rightInputIsPassive == other.rightInputIsPassive && areNullSafeEquals(this.leftListenedProperties, other.leftListenedProperties) && areNullSafeEquals(this.rightListenedProperties, other.rightListenedProperties) && this.leftInput.getId() == other.leftInput.getId() && this.rightInput.getId() == other.rightInput.getId(); } BetaNode(); protected  BetaNode(final int id,
             final LeftTupleSource leftInput,
             final ObjectSource rightInput,
             final BetaConstraints constraints,
             final BuildContext context); }
BetaNode extends LeftTupleSource implements
        LeftTupleSinkNode,
        ObjectSinkNode,
        RightTupleSink,
        MemoryFactory { @Override public boolean equals(Object object) { if (this == object) { return true; } if ( object == null || !(object instanceof BetaNode) || this.hashCode() != object.hashCode() ) { return false; } BetaNode other = (BetaNode) object; return this.getClass() == other.getClass() && this.constraints.equals( other.constraints ) && this.rightInputIsPassive == other.rightInputIsPassive && areNullSafeEquals(this.leftListenedProperties, other.leftListenedProperties) && areNullSafeEquals(this.rightListenedProperties, other.rightListenedProperties) && this.leftInput.getId() == other.leftInput.getId() && this.rightInput.getId() == other.rightInput.getId(); } BetaNode(); protected  BetaNode(final int id,
             final LeftTupleSource leftInput,
             final ObjectSource rightInput,
             final BetaConstraints constraints,
             final BuildContext context); @Override void setPartitionId(BuildContext context, RuleBasePartitionId partitionId ); void initInferredMask(); ObjectSource unwrapRightInput(); void readExternal(ObjectInput in); void writeExternal(ObjectOutput out); void assertObject( final InternalFactHandle factHandle,
                              final PropagationContext pctx,
                              final InternalWorkingMemory wm ); void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory wm); void doDeleteRightTuple(final RightTuple rightTuple,
                                   final InternalWorkingMemory wm,
                                   final BetaMemory memory); void doUpdateRightTuple(final RightTuple rightTuple,
                                    final InternalWorkingMemory wm,
                                    final BetaMemory memory); boolean isRightInputIsRiaNode(); boolean isRightInputPassive(); ObjectSource getRightInput(); void setRightInput( ObjectSource rightInput ); FastIterator getRightIterator( TupleMemory memory ); FastIterator getRightIterator(TupleMemory memory, RightTuple rightTuple); FastIterator getLeftIterator(TupleMemory memory); RightTuple getFirstRightTuple(final Tuple leftTuple,
                                         final TupleMemory memory,
                                         final InternalFactHandle factHandle,
                                         final FastIterator it); LeftTuple getFirstLeftTuple(final RightTuple rightTuple,
                                       final TupleMemory memory,
                                       final FastIterator it); static Tuple getFirstTuple(TupleMemory memory, FastIterator it); boolean isIndexedUnificationJoin(); BetaNodeFieldConstraint[] getConstraints(); BetaConstraints getRawConstraints(); void networkUpdated(UpdateContext updateContext); List<String> getRules(); @Override ObjectTypeNode getObjectTypeNode(); void attach(BuildContext context); void byPassModifyToBetaNode(final InternalFactHandle factHandle,
                                        final ModifyPreviousTuples modifyPreviousTuples,
                                        final PropagationContext context,
                                        final InternalWorkingMemory workingMemory); static BetaMemory getBetaMemory(BetaNode node, InternalWorkingMemory wm); boolean isObjectMemoryEnabled(); boolean isLeftTupleMemoryEnabled(); void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled); Memory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm); String toString(); void dumpMemory(final InternalWorkingMemory workingMemory); @Override boolean equals(Object object); LeftTupleSinkNode getNextLeftTupleSinkNode(); void setNextLeftTupleSinkNode(final LeftTupleSinkNode next); LeftTupleSinkNode getPreviousLeftTupleSinkNode(); void setPreviousLeftTupleSinkNode(final LeftTupleSinkNode previous); ObjectSinkNode getNextObjectSinkNode(); void setNextObjectSinkNode(final ObjectSinkNode next); ObjectSinkNode getPreviousObjectSinkNode(); void setPreviousObjectSinkNode(final ObjectSinkNode previous); RightTuple createRightTuple(InternalFactHandle handle,
                                       RightTupleSink sink,
                                       PropagationContext context); static BetaMemory getBetaMemoryFromRightInput( final BetaNode betaNode, final InternalWorkingMemory workingMemory ); BitMask getRightDeclaredMask(); void setRightDeclaredMask(BitMask rightDeclaredMask); BitMask getRightInferredMask(); BitMask getRightNegativeMask(); ObjectTypeNode.Id getRightInputOtnId(); void setRightInputOtnId(ObjectTypeNode.Id rightInputOtnId); }
BetaNode extends LeftTupleSource implements
        LeftTupleSinkNode,
        ObjectSinkNode,
        RightTupleSink,
        MemoryFactory { @Override public boolean equals(Object object) { if (this == object) { return true; } if ( object == null || !(object instanceof BetaNode) || this.hashCode() != object.hashCode() ) { return false; } BetaNode other = (BetaNode) object; return this.getClass() == other.getClass() && this.constraints.equals( other.constraints ) && this.rightInputIsPassive == other.rightInputIsPassive && areNullSafeEquals(this.leftListenedProperties, other.leftListenedProperties) && areNullSafeEquals(this.rightListenedProperties, other.rightListenedProperties) && this.leftInput.getId() == other.leftInput.getId() && this.rightInput.getId() == other.rightInput.getId(); } BetaNode(); protected  BetaNode(final int id,
             final LeftTupleSource leftInput,
             final ObjectSource rightInput,
             final BetaConstraints constraints,
             final BuildContext context); @Override void setPartitionId(BuildContext context, RuleBasePartitionId partitionId ); void initInferredMask(); ObjectSource unwrapRightInput(); void readExternal(ObjectInput in); void writeExternal(ObjectOutput out); void assertObject( final InternalFactHandle factHandle,
                              final PropagationContext pctx,
                              final InternalWorkingMemory wm ); void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory wm); void doDeleteRightTuple(final RightTuple rightTuple,
                                   final InternalWorkingMemory wm,
                                   final BetaMemory memory); void doUpdateRightTuple(final RightTuple rightTuple,
                                    final InternalWorkingMemory wm,
                                    final BetaMemory memory); boolean isRightInputIsRiaNode(); boolean isRightInputPassive(); ObjectSource getRightInput(); void setRightInput( ObjectSource rightInput ); FastIterator getRightIterator( TupleMemory memory ); FastIterator getRightIterator(TupleMemory memory, RightTuple rightTuple); FastIterator getLeftIterator(TupleMemory memory); RightTuple getFirstRightTuple(final Tuple leftTuple,
                                         final TupleMemory memory,
                                         final InternalFactHandle factHandle,
                                         final FastIterator it); LeftTuple getFirstLeftTuple(final RightTuple rightTuple,
                                       final TupleMemory memory,
                                       final FastIterator it); static Tuple getFirstTuple(TupleMemory memory, FastIterator it); boolean isIndexedUnificationJoin(); BetaNodeFieldConstraint[] getConstraints(); BetaConstraints getRawConstraints(); void networkUpdated(UpdateContext updateContext); List<String> getRules(); @Override ObjectTypeNode getObjectTypeNode(); void attach(BuildContext context); void byPassModifyToBetaNode(final InternalFactHandle factHandle,
                                        final ModifyPreviousTuples modifyPreviousTuples,
                                        final PropagationContext context,
                                        final InternalWorkingMemory workingMemory); static BetaMemory getBetaMemory(BetaNode node, InternalWorkingMemory wm); boolean isObjectMemoryEnabled(); boolean isLeftTupleMemoryEnabled(); void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled); Memory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm); String toString(); void dumpMemory(final InternalWorkingMemory workingMemory); @Override boolean equals(Object object); LeftTupleSinkNode getNextLeftTupleSinkNode(); void setNextLeftTupleSinkNode(final LeftTupleSinkNode next); LeftTupleSinkNode getPreviousLeftTupleSinkNode(); void setPreviousLeftTupleSinkNode(final LeftTupleSinkNode previous); ObjectSinkNode getNextObjectSinkNode(); void setNextObjectSinkNode(final ObjectSinkNode next); ObjectSinkNode getPreviousObjectSinkNode(); void setPreviousObjectSinkNode(final ObjectSinkNode previous); RightTuple createRightTuple(InternalFactHandle handle,
                                       RightTupleSink sink,
                                       PropagationContext context); static BetaMemory getBetaMemoryFromRightInput( final BetaNode betaNode, final InternalWorkingMemory workingMemory ); BitMask getRightDeclaredMask(); void setRightDeclaredMask(BitMask rightDeclaredMask); BitMask getRightInferredMask(); BitMask getRightNegativeMask(); ObjectTypeNode.Id getRightInputOtnId(); void setRightInputOtnId(ObjectTypeNode.Id rightInputOtnId);  }