@Test public void testHashAndEqualsAndValue() { String doc1 = "<div id=1><p class=one>One</p><p class=one>One</p><p class=one>Two</p><p class=two>One</p></div>" + "<div id=2><p class=one>One</p><p class=one>One</p><p class=one>Two</p><p class=two>One</p></div>"; Document doc = Jsoup.parse(doc1); Elements els = doc.select("p"); assertEquals(8, els.size()); Element e0 = els.get(0); Element e1 = els.get(1); Element e2 = els.get(2); Element e3 = els.get(3); Element e4 = els.get(4); Element e5 = els.get(5); Element e6 = els.get(6); Element e7 = els.get(7); assertEquals(e0, e0); assertTrue(e0.hasSameValue(e1)); assertTrue(e0.hasSameValue(e4)); assertTrue(e0.hasSameValue(e5)); assertFalse(e0.equals(e2)); assertFalse(e0.hasSameValue(e2)); assertFalse(e0.hasSameValue(e3)); assertFalse(e0.hasSameValue(e6)); assertFalse(e0.hasSameValue(e7)); assertEquals(e0.hashCode(), e0.hashCode()); assertFalse(e0.hashCode() == (e2.hashCode())); assertFalse(e0.hashCode() == (e3).hashCode()); assertFalse(e0.hashCode() == (e6).hashCode()); assertFalse(e0.hashCode() == (e7).hashCode()); }
public Elements select(String cssQuery) { return Selector.select(cssQuery, this); }
Element extends Node { public Elements select(String cssQuery) { return Selector.select(cssQuery, this); } }
Element extends Node { public Elements select(String cssQuery) { return Selector.select(cssQuery, this); } Element(String tag);  Element(Tag tag, String baseUri, Attributes attributes);  Element(Tag tag, String baseUri); }
Element extends Node { public Elements select(String cssQuery) { return Selector.select(cssQuery, this); } Element(String tag);  Element(Tag tag, String baseUri, Attributes attributes);  Element(Tag tag, String baseUri); @Override Attributes attributes(); @Override String baseUri(); @Override int childNodeSize(); @Override String nodeName(); String tagName(); Element tagName(String tagName); Tag tag(); boolean isBlock(); String id(); Element attr(String attributeKey, String attributeValue); Element attr(String attributeKey, boolean attributeValue); Map<String, String> dataset(); @Override final Element parent(); Elements parents(); Element child(int index); Elements children(); List<TextNode> textNodes(); List<DataNode> dataNodes(); Elements select(String cssQuery); boolean is(String cssQuery); boolean is(Evaluator evaluator); Element appendChild(Node child); Element appendTo(Element parent); Element prependChild(Node child); Element insertChildren(int index, Collection<? extends Node> children); Element insertChildren(int index, Node... children); Element appendElement(String tagName); Element prependElement(String tagName); Element appendText(String text); Element prependText(String text); Element append(String html); Element prepend(String html); @Override Element before(String html); @Override Element before(Node node); @Override Element after(String html); @Override Element after(Node node); Element empty(); @Override Element wrap(String html); String cssSelector(); Elements siblingElements(); Element nextElementSibling(); Element previousElementSibling(); Element firstElementSibling(); int elementSiblingIndex(); Element lastElementSibling(); Elements getElementsByTag(String tagName); Element getElementById(String id); Elements getElementsByClass(String className); Elements getElementsByAttribute(String key); Elements getElementsByAttributeStarting(String keyPrefix); Elements getElementsByAttributeValue(String key, String value); Elements getElementsByAttributeValueNot(String key, String value); Elements getElementsByAttributeValueStarting(String key, String valuePrefix); Elements getElementsByAttributeValueEnding(String key, String valueSuffix); Elements getElementsByAttributeValueContaining(String key, String match); Elements getElementsByAttributeValueMatching(String key, Pattern pattern); Elements getElementsByAttributeValueMatching(String key, String regex); Elements getElementsByIndexLessThan(int index); Elements getElementsByIndexGreaterThan(int index); Elements getElementsByIndexEquals(int index); Elements getElementsContainingText(String searchText); Elements getElementsContainingOwnText(String searchText); Elements getElementsMatchingText(Pattern pattern); Elements getElementsMatchingText(String regex); Elements getElementsMatchingOwnText(Pattern pattern); Elements getElementsMatchingOwnText(String regex); Elements getAllElements(); String text(); String ownText(); Element text(String text); boolean hasText(); String data(); String className(); Set<String> classNames(); Element classNames(Set<String> classNames); boolean hasClass(String className); Element addClass(String className); Element removeClass(String className); Element toggleClass(String className); String val(); Element val(String value); String html(); @Override T html(T appendable); Element html(String html); String toString(); @Override Element clone(); }
Element extends Node { public Elements select(String cssQuery) { return Selector.select(cssQuery, this); } Element(String tag);  Element(Tag tag, String baseUri, Attributes attributes);  Element(Tag tag, String baseUri); @Override Attributes attributes(); @Override String baseUri(); @Override int childNodeSize(); @Override String nodeName(); String tagName(); Element tagName(String tagName); Tag tag(); boolean isBlock(); String id(); Element attr(String attributeKey, String attributeValue); Element attr(String attributeKey, boolean attributeValue); Map<String, String> dataset(); @Override final Element parent(); Elements parents(); Element child(int index); Elements children(); List<TextNode> textNodes(); List<DataNode> dataNodes(); Elements select(String cssQuery); boolean is(String cssQuery); boolean is(Evaluator evaluator); Element appendChild(Node child); Element appendTo(Element parent); Element prependChild(Node child); Element insertChildren(int index, Collection<? extends Node> children); Element insertChildren(int index, Node... children); Element appendElement(String tagName); Element prependElement(String tagName); Element appendText(String text); Element prependText(String text); Element append(String html); Element prepend(String html); @Override Element before(String html); @Override Element before(Node node); @Override Element after(String html); @Override Element after(Node node); Element empty(); @Override Element wrap(String html); String cssSelector(); Elements siblingElements(); Element nextElementSibling(); Element previousElementSibling(); Element firstElementSibling(); int elementSiblingIndex(); Element lastElementSibling(); Elements getElementsByTag(String tagName); Element getElementById(String id); Elements getElementsByClass(String className); Elements getElementsByAttribute(String key); Elements getElementsByAttributeStarting(String keyPrefix); Elements getElementsByAttributeValue(String key, String value); Elements getElementsByAttributeValueNot(String key, String value); Elements getElementsByAttributeValueStarting(String key, String valuePrefix); Elements getElementsByAttributeValueEnding(String key, String valueSuffix); Elements getElementsByAttributeValueContaining(String key, String match); Elements getElementsByAttributeValueMatching(String key, Pattern pattern); Elements getElementsByAttributeValueMatching(String key, String regex); Elements getElementsByIndexLessThan(int index); Elements getElementsByIndexGreaterThan(int index); Elements getElementsByIndexEquals(int index); Elements getElementsContainingText(String searchText); Elements getElementsContainingOwnText(String searchText); Elements getElementsMatchingText(Pattern pattern); Elements getElementsMatchingText(String regex); Elements getElementsMatchingOwnText(Pattern pattern); Elements getElementsMatchingOwnText(String regex); Elements getAllElements(); String text(); String ownText(); Element text(String text); boolean hasText(); String data(); String className(); Set<String> classNames(); Element classNames(Set<String> classNames); boolean hasClass(String className); Element addClass(String className); Element removeClass(String className); Element toggleClass(String className); String val(); Element val(String value); String html(); @Override T html(T appendable); Element html(String html); String toString(); @Override Element clone();  }