private void appendResourceOrVariable(StringBuffer s, ResourceOrVariable n) { if (n.isVariable()) { appendVariable(s, n.getVariable()); } else { RDFTerm r = n.getResource(); if (r instanceof BlankNode) { s.append("_:").append(r.toString().replace("@", ".")); } else { s.append(r.toString()); } } }
private void appendResourceOrVariable(StringBuffer s, ResourceOrVariable n) { if (n.isVariable()) { appendVariable(s, n.getVariable()); } else { RDFTerm r = n.getResource(); if (r instanceof BlankNode) { s.append("_:").append(r.toString().replace("@", ".")); } else { s.append(r.toString()); } } }
@Override public int hashCode() { return (isVariable() ? 13 * getVariable().hashCode() + 7 : 13 * getResource().hashCode() + 7); } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof ResourceOrVariable)) { return false; } final ResourceOrVariable other = (ResourceOrVariable) obj; if (this.isVariable() != other.isVariable()) { return false; } if (this.isVariable()) { if (!this.getVariable().equals(other.getVariable())) { return false; } } else { if (!this.getResource().equals(other.getResource())) { return false; } } return true; }
@Override public int hashCode() { return (isVariable() ? 13 * getVariable().hashCode() + 7 : 13 * getResource().hashCode() + 7); } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof ResourceOrVariable)) { return false; } final ResourceOrVariable other = (ResourceOrVariable) obj; if (this.isVariable() != other.isVariable()) { return false; } if (this.isVariable()) { if (!this.getVariable().equals(other.getVariable())) { return false; } } else { if (!this.getResource().equals(other.getResource())) { return false; } } return true; }