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