Finds relations based on their type. @param type the type of relation being sought. @return the list of all relations in this RelationSet that have the required type.
(String type)
| 267 | * have the required type. |
| 268 | */ |
| 269 | public Collection<Relation> getRelations(String type) { |
| 270 | List<Relation> res = new ArrayList<Relation>(); |
| 271 | BitSet rels = indexByType.get(type); |
| 272 | if(rels != null) { |
| 273 | for(int relPos = 0; relPos <= maxID; relPos++) { |
| 274 | if(rels.get(relPos)) res.add(indexById.get(relPos)); |
| 275 | } |
| 276 | } |
| 277 | return res; |
| 278 | } |
| 279 | |
| 280 | public Relation get(Integer id) { |
| 281 | return indexById.get(id); |
no test coverage detected