protected boolean slowContains( Triple t ) { for ( Triple element : elements ) { if ( t.matches( element ) ) { return true; } } return false; }
@Override public boolean containsBySameValueAs( Triple t ) { int i = size; while (i > 0) if (t.matches( elements[--i])) return true; return false; }
@Override public boolean containsBySameValueAs( Triple t ) { int i = size; while (i > 0) if (t.matches( elements[--i])) return true; return false; }
protected boolean slowContains( Triple t ) { for ( Triple element : elements ) { if ( t.matches( element ) ) { return true; } } return false; }
@Override public boolean test(Triple t) { return tMatch.matches(t); }
protected int findSlotBySameValueAs( Triple key ) { int index = initialIndexFor( key ); while (true) { Object current = keys[index]; if (current == null) return index; if (key.matches( (Triple) current )) return ~index; if (--index < 0) index += capacity; } }
protected int findSlotBySameValueAs( Triple key ) { int index = initialIndexFor( key ); while (true) { Object current = keys[index]; if (current == null) return index; if (key.matches( (Triple) current )) return ~index; if (--index < 0) index += capacity; } }
protected boolean slowContains( Triple t ) { TripleBunch s = bunchMap.get( getIndexField( t ) ); if (s == null) return false; else { Iterator<Triple> it = s.iterator(); while (it.hasNext()) if (t.matches( it.next() )) return true; return false; } }
protected boolean slowContains( Triple t ) { TripleBunch s = bunchMap.get( getIndexField( t ) ); if (s == null) return false; else { Iterator<Triple> it = s.iterator(); while (it.hasNext()) if (t.matches( it.next() )) return true; return false; } }
@Override protected ExtendedIterator<Triple> graphBaseFind(Triple m) { List<Triple> results = new ArrayList<>(); for ( Triple t : triples ) if ( t.matches(m.getMatchSubject(), m.getMatchPredicate(), m.getMatchObject()) ) results.add(t); return WrappedIterator.create(results.iterator()); } }
private boolean matches(Triple t, Node s, Node p, Node o) { s = nullAsAny(s); p = nullAsAny(p); o = nullAsAny(o); return t.matches(s, p, o); }
private void testMatches( String pattern, String triple ) { assertTrue( NodeCreateUtils.createTriple( pattern ).matches( NodeCreateUtils.createTriple( triple ) ) ); }
private void testMatches( String pattern, String triple ) { assertTrue( NodeCreateUtils.createTriple( pattern ).matches( NodeCreateUtils.createTriple( triple ) ) ); }
public void testMatchFails( String pattern, String triple ) { assertFalse( NodeCreateUtils.createTriple( pattern ).matches( NodeCreateUtils.createTriple( triple ) ) ); }
public void testMatchFails( String pattern, String triple ) { assertFalse( NodeCreateUtils.createTriple( pattern ).matches( NodeCreateUtils.createTriple( triple ) ) ); }
public void testMatchesNodes() { assertTrue( NodeCreateUtils.createTriple( "S P O" ).matches( node("S" ), node( "P" ), node( "O" ) ) ); assertTrue( NodeCreateUtils.createTriple( "?? P O" ).matches( node("Z" ), node( "P" ), node( "O" ) ) ); assertTrue( NodeCreateUtils.createTriple( "S ?? O" ).matches( node("S" ), node( "Q" ), node( "O" ) ) ); assertTrue( NodeCreateUtils.createTriple( "S P ??" ).matches( node("S" ), node( "P" ), node( "I" ) ) ); /* */ assertFalse( NodeCreateUtils.createTriple( "S P O" ).matches( node("Z" ), node( "P" ), node( "O" ) ) ); assertFalse( NodeCreateUtils.createTriple( "S P O" ).matches( node("S" ), node( "Q" ), node( "O" ) ) ); assertFalse( NodeCreateUtils.createTriple( "S P O" ).matches( node("Z" ), node( "P" ), node( "I" ) ) ); }
public void testMatchesNodes() { assertTrue( NodeCreateUtils.createTriple( "S P O" ).matches( node("S" ), node( "P" ), node( "O" ) ) ); assertTrue( NodeCreateUtils.createTriple( "?? P O" ).matches( node("Z" ), node( "P" ), node( "O" ) ) ); assertTrue( NodeCreateUtils.createTriple( "S ?? O" ).matches( node("S" ), node( "Q" ), node( "O" ) ) ); assertTrue( NodeCreateUtils.createTriple( "S P ??" ).matches( node("S" ), node( "P" ), node( "I" ) ) ); /* */ assertFalse( NodeCreateUtils.createTriple( "S P O" ).matches( node("Z" ), node( "P" ), node( "O" ) ) ); assertFalse( NodeCreateUtils.createTriple( "S P O" ).matches( node("S" ), node( "Q" ), node( "O" ) ) ); assertFalse( NodeCreateUtils.createTriple( "S P O" ).matches( node("Z" ), node( "P" ), node( "I" ) ) ); }