/** * Gives Literals, URIReference and BlankNodes an order. * * @param object the RDF object to compare. * @return -1 if Literal or URIReference otherwise performance comparTo. */ public int compareTo(java.lang.Object object) { if (object instanceof Literal) { return -1; } else if (object instanceof URI) { return -1; } else if (object instanceof BNode) { // FIXME: this is ugly and I sincerely hope we can figure out a better // way to implement comparisons by Java reference value return toString().compareTo(((BNode)object).toString()); } else { throw new ClassCastException("Not an RDF node"); } }