public boolean matches(Statement statement) { boolean matchesSubject = statement.getSubject().equals( this.getSubject()) || this.getSubject() instanceof Variable; boolean matchesPredicate = statement.getPredicate().equals( this.getPredicate()) || this.getPredicate() instanceof Variable; boolean matchesObject = statement.getObject().equals(this.getObject()) || this.getObject() instanceof Variable; return matchesSubject && matchesPredicate && matchesObject; }
@Override public boolean matches(Statement statement) { boolean matchesSubject = statement.getSubject().equals(this.getSubject()) || this.getSubject() instanceof Variable; boolean matchesPredicate = statement.getPredicate().equals(this.getPredicate()) || this.getPredicate() instanceof Variable; boolean matchesObject = statement.getObject().equals(this.getObject()) || this.getObject() instanceof Variable; return matchesSubject && matchesPredicate && matchesObject; }
@Override public boolean equals(Object o) { return ((o instanceof Statement) && (this.getSubject().equals(((Statement)o).getSubject())) && (this.getPredicate().equals(((Statement)o).getPredicate())) && (this.getObject() .equals(((Statement)o).getObject()))); }
@Override public boolean equals(Object o) { return ((o instanceof Statement) && (this.getSubject().equals(((Statement) o).getSubject())) && (this.getPredicate().equals(((Statement) o).getPredicate())) && (this .getObject().equals(((Statement) o).getObject()))); }
public ClosableIterator<T> asClosableIterator() { ClosableIterator<Statement> it = this.model.findStatements(this.triplePattern.getSubject(), this.triplePattern.getPredicate(), this.triplePattern.getObject() ); ProjectingIterator.projection proj = null; switch (this.triplePattern.extract) { case SUBJECT: proj = ProjectingIterator.projection.Subject; break; case PREDICATE: proj = ProjectingIterator.projection.Predicate; break; case OBJECT: proj = ProjectingIterator.projection.Object; break; } return new ConvertingClosableIterator<T>( new ProjectingIterator<Node>(it, proj), this.model, this.returnType); }