/** * Compares the specified object with this map for equality. * Returns true if the given object is also a map and the two Maps * represent the same mappings. More formally, two maps t1 and t2 represent * the same mappings if t1.entrySet().equals(t2.entrySet()). * * This ensures that the equals method works properly across different * implementations of the Map interface. * * @param o The object to be compared for equality with this map. * @return True if the specified object is equal to this map. */ @Override public boolean equals( Object o ) { return o instanceof java.util.Map<?,?> && entrySet().equals( ((Map<?,?>) o).entrySet() ); }
/** * Compares the specified object with this map for equality. * Returns true if the given object is also a map and the two Maps * represent the same mappings. More formally, two maps t1 and t2 represent * the same mappings if t1.entrySet().equals(t2.entrySet()). * * This ensures that the equals method works properly across different * implementations of the Map interface. * * @param o The object to be compared for equality with this map. * @return True if the specified object is equal to this map. */ @Override public boolean equals( Object o ) { return o instanceof java.util.Map<?,?> && entrySet().equals( ((Map<?,?>) o).entrySet() ); }
/** * Returns the hash code value for this map. The hash code of a map is * defined to be the sum of the hashCodes of each entry in the map's * entrySet view. This ensures that t1.equals(t2) implies * that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, * as required by the general contract of Object.hashCode */ @Override public int hashCode() { int hc = 0; for ( Map.Entry<From, To> fromToEntry : entrySet() ) { hc ^= fromToEntry.hashCode(); } return hc; }
/** * Returns the hash code value for this map. The hash code of a map is * defined to be the sum of the hashCodes of each entry in the map's * entrySet view. This ensures that t1.equals(t2) implies * that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, * as required by the general contract of Object.hashCode */ @Override public int hashCode() { int hc = 0; for ( Map.Entry<From, To> fromToEntry : entrySet() ) { hc ^= fromToEntry.hashCode(); } return hc; }
/** * Set the internal rule from a precomputed state. */ @Override public void setRuleStore(Object ruleStore) { RuleStore rs = (RuleStore)ruleStore; predicatePatterns = rs.predicatePatterns; wildcardRule = rs.wildcardRule; isMonotonic = rs.isMonotonic; // Clone the RETE network to this engine RETERuleContext context = new RETERuleContext(infGraph, this); Map<RETENode, RETENode> netCopy = new HashMap<>(); clauseIndex = new OneToManyMap<>(); for ( Map.Entry<Node, RETENode> entry : rs.clauseIndex.entrySet() ) { clauseIndex.put( entry.getKey(), entry.getValue().clone( netCopy, context ) ); } }
/** * Set the internal rule from a precomputed state. */ @Override public void setRuleStore(Object ruleStore) { RuleStore rs = (RuleStore)ruleStore; predicatePatterns = rs.predicatePatterns; wildcardRule = rs.wildcardRule; isMonotonic = rs.isMonotonic; // Clone the RETE network to this engine RETERuleContext context = new RETERuleContext(infGraph, this); Map<RETENode, RETENode> netCopy = new HashMap<>(); clauseIndex = new OneToManyMap<>(); for ( Map.Entry<Node, RETENode> entry : rs.clauseIndex.entrySet() ) { clauseIndex.put( entry.getKey(), entry.getValue().clone( netCopy, context ) ); } }
for (Map.Entry<Node, Node> ent : predicatePatterns.entrySet()) {
for (Map.Entry<Node, Node> ent : predicatePatterns.entrySet()) {
boolean s3s4 = false; for ( Map.Entry<String, String> e : map0.entrySet() )
boolean s3s4 = false; for ( Map.Entry<String, String> e : map0.entrySet() )