1 | /* |
2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. |
3 | * |
4 | * WSO2 Inc. licenses this file to you under the Apache License, |
5 | * Version 2.0 (the "License"); you may not use this file except |
6 | * in compliance with the License. |
7 | * You may obtain a copy of the License at |
8 | * |
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | * |
11 | * Unless required by applicable law or agreed to in writing, |
12 | * software distributed under the License is distributed on an |
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | * KIND, either express or implied. See the License for the |
15 | * specific language governing permissions and limitations |
16 | * under the License. |
17 | */ |
18 | package org.wso2.siddhi.core.statemachine.pattern; |
19 | |
20 | import org.wso2.siddhi.core.stream.packer.pattern.PatternStreamPacker; |
21 | import org.wso2.siddhi.core.stream.recevier.pattern.PatternSingleStreamReceiver; |
22 | import org.wso2.siddhi.query.api.stream.SingleStream; |
23 | |
24 | public class PatternState { |
25 | |
26 | private SingleStream singleStream; |
27 | private int stateNumber; |
28 | private PatternState nextState ; |
29 | private PatternState nextEveryState ; |
30 | |
31 | private boolean first = false; |
32 | private boolean last = false; |
33 | |
34 | private PatternSingleStreamReceiver patternSingleStreamReceiver; |
35 | private PatternStreamPacker patternStreamPacker; |
36 | |
37 | public PatternState(int stateNumber, SingleStream singleStream) { |
38 | this.stateNumber = stateNumber; |
39 | this.singleStream = singleStream; |
40 | } |
41 | |
42 | public SingleStream getSingleStream() { |
43 | return singleStream; |
44 | } |
45 | |
46 | public void setSingleStream(SingleStream singleStream) { |
47 | this.singleStream = singleStream; |
48 | } |
49 | |
50 | public int getStateNumber() { |
51 | return stateNumber; |
52 | } |
53 | |
54 | public void setStateNumber(int stateNumber) { |
55 | this.stateNumber = stateNumber; |
56 | } |
57 | |
58 | public boolean isLast() { |
59 | return last; |
60 | } |
61 | |
62 | public void setLast(boolean last) { |
63 | this.last = last; |
64 | } |
65 | |
66 | |
67 | public void setFirst(boolean first) { |
68 | this.first = first; |
69 | } |
70 | |
71 | public boolean isFirst() { |
72 | return first; |
73 | } |
74 | |
75 | public PatternState getNextState() { |
76 | return nextState; |
77 | } |
78 | |
79 | public void setNextState(PatternState nextState) { |
80 | this.nextState = nextState; |
81 | } |
82 | |
83 | public PatternState getNextEveryState() { |
84 | return nextEveryState; |
85 | } |
86 | |
87 | public void setNextEveryState(PatternState nextEveryState) { |
88 | this.nextEveryState = nextEveryState; |
89 | } |
90 | |
91 | public void setPatternSingleStreamReceiver( |
92 | PatternSingleStreamReceiver patternSingleStreamReceiver) { |
93 | this.patternSingleStreamReceiver = patternSingleStreamReceiver; |
94 | } |
95 | |
96 | public PatternSingleStreamReceiver getPatternSingleStreamReceiver() { |
97 | return patternSingleStreamReceiver; |
98 | } |
99 | |
100 | public void setPatternStreamPacker(PatternStreamPacker patternStreamPacker) { |
101 | this.patternStreamPacker = patternStreamPacker; |
102 | } |
103 | |
104 | public PatternStreamPacker getPatternStreamPacker() { |
105 | return patternStreamPacker; |
106 | } |
107 | } |