/** * Returns the number of "prefix" components that this pattern has in common * with the pattern p passed as parameter. By "prefix" components we mean the * components at the beginning of the pattern. */ public int getPrefixMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; for (int i = 0; i < minLen; i++) { String l = this.partList.get(i); String r = p.partList.get(i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
/** * Returns the number of "tail" components that this pattern has in common * with the pattern p passed as parameter. By "tail" components we mean the * components at the end of the pattern. */ public int getTailMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; // loop from the end to the front for (int i = 1; i <= minLen; i++) { String l = this.partList.get(lSize - i); String r = p.partList.get(rSize - i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
public boolean fullPathMatch(ElementPath path) { if (path.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), path.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
@Override public boolean equals(Object o) { if ((o == null) || !(o instanceof ElementSelector)) { return false; } ElementSelector r = (ElementSelector) o; if (r.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), r.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
/** * Returns the number of "tail" components that this pattern has in common * with the pattern p passed as parameter. By "tail" components we mean the * components at the end of the pattern. */ public int getTailMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; // loop from the end to the front for (int i = 1; i <= minLen; i++) { String l = this.partList.get(lSize - i); String r = p.partList.get(rSize - i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
/** * Returns the number of "prefix" components that this pattern has in common * with the pattern p passed as parameter. By "prefix" components we mean the * components at the beginning of the pattern. */ public int getPrefixMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; for (int i = 0; i < minLen; i++) { String l = this.partList.get(i); String r = p.partList.get(i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
/** * Returns the number of "prefix" components that this pattern has in common * with the pattern p passed as parameter. By "prefix" components we mean the * components at the beginning of the pattern. */ public int getPrefixMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; for (int i = 0; i < minLen; i++) { String l = this.partList.get(i); String r = p.partList.get(i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
/** * Returns the number of "prefix" components that this pattern has in common * with the pattern p passed as parameter. By "prefix" components we mean the * components at the beginning of the pattern. * @param p element path * @return the number of "prefix" components in common with p */ public int getPrefixMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; for (int i = 0; i < minLen; i++) { String l = this.partList.get(i); String r = p.partList.get(i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
/** * Returns the number of "prefix" components that this pattern has in common * with the pattern p passed as parameter. By "prefix" components we mean the * components at the beginning of the pattern. */ public int getPrefixMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; for (int i = 0; i < minLen; i++) { String l = this.partList.get(i); String r = p.partList.get(i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
/** * Returns the number of "tail" components that this pattern has in common * with the pattern p passed as parameter. By "tail" components we mean the * components at the end of the pattern. */ public int getTailMatchLength(ElementPath p) { if (p == null) { return 0; } int lSize = this.partList.size(); int rSize = p.partList.size(); // no match possible for empty sets if ((lSize == 0) || (rSize == 0)) { return 0; } int minLen = (lSize <= rSize) ? lSize : rSize; int match = 0; // loop from the end to the front for (int i = 1; i <= minLen; i++) { String l = this.partList.get(lSize - i); String r = p.partList.get(rSize - i); if (equalityCheck(l, r)) { match++; } else { break; } } return match; }
public boolean fullPathMatch(ElementPath path) { if (path.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), path.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
public boolean fullPathMatch(ElementPath path) { if (path.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), path.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
public boolean fullPathMatch(ElementPath path) { if (path.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), path.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
public boolean fullPathMatch(ElementPath path) { if (path.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), path.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
public boolean fullPathMatch(ElementPath path) { if (path.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), path.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
@Override public boolean equals(Object o) { if ((o == null) || !(o instanceof ElementSelector)) { return false; } ElementSelector r = (ElementSelector) o; if (r.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), r.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
@Override public boolean equals(Object o) { if ((o == null) || !(o instanceof ElementSelector)) { return false; } ElementSelector r = (ElementSelector) o; if (r.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), r.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
@Override public boolean equals(Object o) { if ((o == null) || !(o instanceof ElementSelector)) { return false; } ElementSelector r = (ElementSelector) o; if (r.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), r.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
@Override public boolean equals(Object o) { if ((o == null) || !(o instanceof ElementSelector)) { return false; } ElementSelector r = (ElementSelector) o; if (r.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), r.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }
@Override public boolean equals(Object o) { if ((o == null) || !(o instanceof ElementSelector)) { return false; } ElementSelector r = (ElementSelector) o; if (r.size() != size()) { return false; } int len = size(); for (int i = 0; i < len; i++) { if (!equalityCheck(get(i), r.get(i))) { return false; } } // if everything matches, then the two patterns are equal return true; }