MCPcopy Create free account
hub / github.com/GateNLP/gate-core / clear

Method clear

src/main/java/gate/relations/RelationSet.java:139–155  ·  view source on GitHub ↗

Empties the relation set

()

Source from the content-addressed store, hash-verified

137 * Empties the relation set
138 */
139 @Override
140 public void clear() {
141
142 // clearing the indexes won't fire the events so we fire the events
143 // first and then clear the indexes, hopefully we won't end up with
144 // any weird side effects from this but I can't think of a
145 // safer/better way of doing it other than calling delete on each
146 // relation which would be horribly inefficient
147 for(Relation r : indexById.values()) {
148 fireRelationRemoved(new RelationSetEvent(this,
149 RelationSetEvent.RELATION_REMOVED, r));
150 }
151
152 indexByType.clear();
153 indexesByMember.clear();
154 indexById.clear();
155 }
156
157 /**
158 * The number of relations in this set.

Callers 1

deleteRelationMethod · 0.45

Calls 2

fireRelationRemovedMethod · 0.95
valuesMethod · 0.45

Tested by

no test coverage detected