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; }
protected Collection<Triple> getTriplesForSubject( Object subj ) { Collection<Triple> coll = store.getAll( tripleFactory.newTriple( subj, Variable.v, Variable.v ) ); Iterator<Triple> iter = coll.iterator(); while ( iter.hasNext() ) { if ( (iter.next().getProperty()).equals(TripleStore.TYPE) ) { iter.remove(); } } return coll; }
public Set<String> keySet() { Set<String> set = new HashSet<String>(); for ( Triple t : getTriplesForSubject( getObject() ) ) { set.add( (String) t.getProperty() ); } return set; }
public Set<String> keySet() { Set<String> set = new HashSet<String>(); for ( Triple t : getSchemaTriplesForSubject( getObject() ) ) { if ( t.getProperty().equals( TripleStore.TYPE ) ) { set.add( t.getValue().toString() ); } } return set; }
public Set<Entry<String, Object>> entrySet() { Set<Entry<String, Object>> set = new HashSet<Entry<String, Object>>(); for ( Triple t : getTriplesForSubject( getObject() ) ) { set.add( TraitProxy.buildEntry( (String) t.getProperty(), t.getValue() ) ); } return set; }
public boolean containsValue( Object value ) { for ( Triple t : getSchemaTriplesForSubject(getObject()) ) { if (t.getProperty().equals( TripleStore.TYPE ) ) { return store.contains( tripleFactory.newTriple( t.getValue(), TripleStore.PROXY, value ) ); } } return false; }
if ( t1.getProperty() != Variable.v && ! t1.getProperty().equals( t2.getProperty() ) ) { 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; }