int myHashCode() { check(REHASHING); if ( bound!=null ) impossible(); myHash = 0; Iterator<AnonStatement> ss = occursIn.iterator(); while (ss.hasNext()) { AnonStatement ass = ss.next(); myHash += ass.myHashCode(this); } hash[myHashLevel] = myHash; return myHash; } void bind(AnonResource pair) {
private int prepare(Graph otherm) { ClosableIterator<Triple> ss = GraphUtil.findAll( m ); myHashLevel = 0; int hash = 0; try { while ( ss.hasNext() ) { Triple s = ss.next(); AnonStatement ass = new AnonStatement(s); if ( ass.pattern == NOVARS ) { if ( !otherm.contains( s ) ) return -1; } else { hash += ass.myHashCode(ass.vars[0]); for (int i=0;i<ass.vars.length;i++) { ass.vars[i].occursIn.add(ass); for (int j=i+1;j<ass.vars.length;j++) { ass.vars[i].friends.add(ass.vars[j]); ass.vars[j].friends.add(ass.vars[i]); } } } } return hash==-1?1:hash; } finally { ss.close(); } } private Bucket smallestBucket() {
StatementWrapper( AnonStatement s ) { wrapHash = s.myHashCode(AnonResource.this); statement = s; }
static public int hashCode(Graph g) { ClosableIterator<Triple> ci = GraphUtil.findAll( g ); int hash = 0; GraphMatcher gm = new GraphMatcher(g); while ( ci.hasNext() ) { Triple t = ci.next(); hash += gm.new AnonStatement(t).myHashCode(null); } return hash; } /**