public int hashCodeOf(Object object) { Triple t = ( Triple ) object; final int prime = 31; int result = 1; result = prime * result + t.getInstance().hashCode(); result = prime * result + t.getProperty().hashCode(); return result; }
Triple t2 = ( Triple ) object2; if ( t1.getInstance() != Variable.v ) { if ( t1.getInstance() == null ) { return false; } else if ( t1.getInstance() instanceof String ) { if ( ! t1.getInstance().equals( t2.getInstance() ) ) { return false; } else if ( t1.getInstance() != t2.getInstance() ) { return false;
public Collection<Triple> getAll(final Triple triple) { List<Triple> list = new ArrayList<Triple>(); if ( triple.getInstance() != Variable.v && triple.getProperty() != Variable.v ) { Triple t = get( triple ); if ( t != null ) {
public boolean remove(final Triple triple) { final int hashCode = this.comparator.hashCodeOf( triple ); final int index = indexOf( hashCode, this.table.length ); TripleImpl previous = (TripleImpl) this.table[index]; TripleImpl current = previous; Triple key = new TripleImpl( triple.getInstance(), triple.getProperty(), Variable.v ); while ( current != null ) { final TripleImpl next = (TripleImpl) current.getNext(); if ( hashCode == this.comparator.hashCodeOf( current ) && this.comparator.equal( key, current ) ) { if ( ( current.getValue() == null && triple.getValue() == null ) || ( current.getValue() != null && current.getValue().equals( triple.getValue() ) ) ) { if ( previous == current ) { this.table[index] = next; } else { previous.setNext( next ); } current.setNext( null ); this.size--; return true; } } previous = current; current = next; } return false; }