| 1 | package net.digitaltsunami.word.trie.event; |
| 2 | |
| 3 | import java.util.EventObject; |
| 4 | |
| 5 | import net.digitaltsunami.word.trie.CharTrieNode; |
| 6 | |
| 7 | /** |
| 8 | * Event dispatched when a non-terminus node or character is added. |
| 9 | * |
| 10 | * @author dhagberg |
| 11 | */ |
| 12 | public class NodeAddedEvent extends EventObject { |
| 13 | |
| 14 | private static final long serialVersionUID = 1091049728144325287L; |
| 15 | |
| 16 | /** |
| 17 | * Create a new event and store the source for which the event will be |
| 18 | * dispatched. |
| 19 | * |
| 20 | * @param source |
| 21 | * causing event to be created. |
| 22 | */ |
| 23 | public NodeAddedEvent(CharTrieNode source) { |
| 24 | super(source); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Return the node that caused the event to be dispatched. |
| 29 | * |
| 30 | * @return source that caused event to be dispatched. |
| 31 | */ |
| 32 | public CharTrieNode getNode() { |
| 33 | return (CharTrieNode) getSource(); |
| 34 | } |
| 35 | } |