- Common ways to obtain Resource
private void myMethod () {Resource r =
Statement st;st.getContext()
Statement st;st.getSubject()
Statement statement;(Resource) statement.getObject()
- Smart code suggestions by Codota
}
public int compareTo(Object o) { Intersection other = (Intersection)o; int result = size() - other.size(); if (result == 0) { // equal size Iterator thisIter = getMembers().iterator(); Iterator otherIter = other.getMembers().iterator(); while (result == 0 && thisIter.hasNext()) { Resource thisRes = (Resource)thisIter.next(); Resource otherRes = (Resource)otherIter.next(); result = thisRes.compareTo(otherRes); } } return result; }
/** * Compares this Statement with the supplied object. * * @throws ClassCastException if o is not of type Statement * @see java.lang.Comparable **/ public int compareTo(Object o) { if (this == o) { return 0; } Statement other = (Statement)o; int result = 0; result = _object.compareTo(other.getObject()); if (result == 0) { // objects are equal result = _subject.compareTo(other.getSubject()); } if (result == 0) { // subjects and objects are equal result = _predicate.compareTo(other.getPredicate()); } return result; }