forked from apache/incubator-kie-drools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Left and Right Tuples aligned with Super Cache improvements a…
…pache#5648 (apache#5649) * -BetaConstraints no longer depends on ReteEvaluator. * -Trying to separate BetaMemory so BetaConstraints can go in -base. * -Refactoring Tuples around concrete classes. * -Centralise and improve super cache handling fix. -Improve NodeTypeEnums to contain more information (at no cost) and replace as many instanceof as possible. * -Move Super Cache helper methods into standalone class SuperCacheFixer. * -Remove RightTuple interface. * -Refactory creation to a Factory with switch for different implementations. * -Added missing headers. -Remove unecessary if statement with printout. -Removed incorrectly added maven module. * minor semplifications --------- Co-authored-by: mariofusco <mario.fusco@gmail.com>
- Loading branch information
1 parent
4487801
commit d94c2cc
Showing
267 changed files
with
4,612 additions
and
5,456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
drools-base/src/main/java/org/drools/core/reteoo/ObjectTypeNodeId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.drools.core.reteoo; | ||
|
||
public class ObjectTypeNodeId { | ||
|
||
public static final ObjectTypeNodeId DEFAULT_ID = new ObjectTypeNodeId(-1, 0); | ||
|
||
private final int otnId; | ||
private final int id; | ||
|
||
public ObjectTypeNodeId(int otnId, int id) { | ||
this.otnId = otnId; | ||
this.id = id; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ObjectTypeNode.Id[" + otnId + "#" + id + "]"; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (!(o instanceof ObjectTypeNodeId)) { | ||
return false; | ||
} | ||
|
||
ObjectTypeNodeId otherId = (ObjectTypeNodeId) o; | ||
return id == otherId.id && otnId == otherId.otnId; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return 31 * otnId + 37 * id; | ||
} | ||
|
||
public boolean before(ObjectTypeNodeId otherId) { | ||
return otherId != null && (otnId < otherId.otnId || (otnId == otherId.otnId && id < otherId.id)); | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.