48 |
* ALL triples in the graph. |
* ALL triples in the graph. |
49 |
*/ |
*/ |
50 |
class SimpleSelector implements StatementSelector { |
class SimpleSelector implements StatementSelector { |
51 |
|
protected boolean accept(Statement s) { |
52 |
|
return true; |
53 |
|
} |
54 |
|
|
55 |
public Collection getConnections(Resource focus, int dir) { |
public Collection getConnections(Resource focus, int dir) { |
56 |
try { |
try { |
57 |
List nodes = new ArrayList(); |
List nodes = new ArrayList(); |
58 |
StmtIterator i = focus.getModel().listStatements(); |
StmtIterator i = focus.getModel().listStatements(); |
59 |
for(; i.hasNext();) { |
for(; i.hasNext();) { |
60 |
Statement stmt = i.next(); |
Statement stmt = i.next(); |
61 |
|
if(!accept(stmt)) continue; |
62 |
if(dir < 0) { |
if(dir < 0) { |
63 |
if(stmt.getObject().equals(focus)) |
if(stmt.getObject().equals(focus)) |
64 |
nodes.add(stmt); |
nodes.add(stmt); |