Skip to content

Commit bc204d4

Browse files
committed
#23 move SequenceHandler to a package
1 parent 454e16e commit bc204d4

5 files changed

Lines changed: 48 additions & 11 deletions

File tree

src/main/java/unquietcode/tools/esm/GenericStateMachine.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ this software and associated documentation files (the "Software"), to deal in
2626
import unquietcode.tools.esm.routing.StateRouter;
2727
import unquietcode.tools.esm.sequences.Pattern;
2828
import unquietcode.tools.esm.sequences.PatternBuilder;
29+
import unquietcode.tools.esm.sequences.SequenceHandler;
2930

3031
import java.util.*;
3132
import java.util.concurrent.*;

src/main/java/unquietcode/tools/esm/ProgrammableStateMachine.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ this software and associated documentation files (the "Software"), to deal in
2525

2626
import unquietcode.tools.esm.sequences.Pattern;
2727
import unquietcode.tools.esm.sequences.PatternBuilder;
28+
import unquietcode.tools.esm.sequences.SequenceHandler;
2829

2930
import java.util.List;
3031

src/main/java/unquietcode/tools/esm/SequenceHandler.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,12 @@ this software and associated documentation files (the "Software"), to deal in
2323

2424
package unquietcode.tools.esm;
2525

26-
import java.util.List;
27-
2826
/**
27+
* @deprecated use {@link unquietcode.tools.esm.sequences.SequenceHandler} instead
28+
*
2929
* @author Ben Fagin
3030
* @version 2013-07-08
3131
*/
32+
@Deprecated
3233
@FunctionalInterface
33-
public interface SequenceHandler<T> {
34-
35-
/**
36-
* Handle a match of the given sequence.
37-
*
38-
* @param pattern the pattern which was matched
39-
*/
40-
void onMatch(List<T> pattern);
41-
}
34+
public interface SequenceHandler<T> extends unquietcode.tools.esm.sequences.SequenceHandler<T> { }

src/main/java/unquietcode/tools/esm/WrappedStateMachine.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ this software and associated documentation files (the "Software"), to deal in
2626
import unquietcode.tools.esm.routing.StateRouter;
2727
import unquietcode.tools.esm.sequences.Pattern;
2828
import unquietcode.tools.esm.sequences.PatternBuilder;
29+
import unquietcode.tools.esm.sequences.SequenceHandler;
2930

3031
import java.util.*;
3132
import java.util.concurrent.Future;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*******************************************************************************
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2018 Benjamin Fagin
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10+
the Software, and to permit persons to whom the Software is furnished to do so,
11+
subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
******************************************************************************/
23+
24+
package unquietcode.tools.esm.sequences;
25+
26+
import java.util.List;
27+
28+
/**
29+
* @author Ben Fagin
30+
* @version 2013-07-08
31+
*/
32+
@FunctionalInterface
33+
public interface SequenceHandler<T> {
34+
35+
/**
36+
* Handle a match of the given sequence.
37+
*
38+
* @param pattern the pattern which was matched
39+
*/
40+
void onMatch(List<T> pattern);
41+
}

0 commit comments

Comments
 (0)