@Override public int hashCode() { int hc = 0; int len = size(); for (int i = 0; i < len; i++) { // make Pattern comparisons case insensitive // http://jira.qos.ch/browse/LBCORE-76 hc ^= get(i).toLowerCase().hashCode(); } return hc; }
String first = null; if(selector.size() > 1) { first = selector.get(0);
private boolean isSuffixPattern(ElementSelector p) { return (p.size() > 1) && p.get(0).equals(KLEENE_STAR); }
@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; }
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 int hashCode() { int hc = 0; int len = size(); for (int i = 0; i < len; i++) { // make Pattern comparisons case insensitive // http://jira.qos.ch/browse/LBCORE-76 hc ^= get(i).toLowerCase(Locale.US).hashCode(); } return hc; }
@Override public int hashCode() { int hc = 0; int len = size(); for (int i = 0; i < len; i++) { // make Pattern comparisons case insensitive // http://jira.qos.ch/browse/LBCORE-76 hc ^= get(i).toLowerCase().hashCode(); } return hc; }
@Override public int hashCode() { int hc = 0; int len = size(); for (int i = 0; i < len; i++) { // make Pattern comparisons case insensitive // http://jira.qos.ch/browse/LBCORE-76 hc ^= get(i).toLowerCase().hashCode(); } return hc; }
@Override public int hashCode() { int hc = 0; int len = size(); for (int i = 0; i < len; i++) { // make Pattern comparisons case insensitive // http://jira.qos.ch/browse/LBCORE-76 hc ^= get(i).toLowerCase().hashCode(); } return hc; }
@Override public int hashCode() { int hc = 0; int len = size(); for (int i = 0; i < len; i++) { // make Pattern comparisons case insensitive // http://jira.qos.ch/browse/LBCORE-76 hc ^= get(i).toLowerCase().hashCode(); } return hc; }
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; }
@Test public void test5() { ElementSelector p = new ElementSelector("//a"); assertEquals(1, p.size()); assertEquals("a", p.get(0)); }
@Test public void test1() { ElementSelector p = new ElementSelector("a"); assertEquals(1, p.size()); assertEquals("a", p.peekLast()); assertEquals("a", p.get(0)); }
@Test public void testSuffix() { ElementSelector p = new ElementSelector("a/"); assertEquals(1, p.size()); assertEquals("a", p.peekLast()); assertEquals("a", p.get(0)); }