01: /*
02: * Sun Public License Notice
03: *
04: * The contents of this file are subject to the Sun Public License
05: * Version 1.0 (the "License"). You may not use this file except in
06: * compliance with the License. A copy of the License is available at
07: * http://www.sun.com/
08: *
09: * The Original Code is NetBeans. The Initial Developer of the Original
10: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11: * Microsystems, Inc. All Rights Reserved.
12: */
13:
14: package org.netbeans.editor.ext.html.dtd;
15:
16: import java.util.Iterator;
17: import java.util.Set;
18:
19: /**
20: * The event fired to all registered interfaces when some DTD is invalidated.
21: *
22: * @author Petr Nejedly
23: * @version 1.0
24: */
25: public class InvalidateEvent {
26:
27: private Set identifiers;
28:
29: /**
30: * Create new InvalidateEvent for given Set of instances of String
31: * representing public identifiers of DTDs to invalidate
32: */
33: public InvalidateEvent(Set identifiers) {
34: this .identifiers = identifiers;
35: }
36:
37: /**
38: * Get the iterator of instances of String representing public identifiers
39: * of the invalidated DTDs. Usable for classes holding more DTDs.
40: */
41: public Iterator getIdentifierIterator() {
42: return identifiers.iterator();
43: }
44:
45: /**
46: * Test if given public identifier is invalidated by this event. Usable for
47: * classes holding only one DTD.
48: */
49: public boolean isInvalidatedIdentifier(String identifier) {
50: return identifiers.contains(identifier);
51: }
52: }
|