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.sequence; |
19 | |
20 | import org.wso2.siddhi.core.stream.packer.sequence.SequenceStreamPacker; |
21 | import org.wso2.siddhi.core.stream.recevier.sequence.SequenceSingleStreamReceiver; |
22 | import org.wso2.siddhi.query.api.stream.SingleStream; |
23 | |
24 | public class SequenceState { |
25 | |
26 | private SingleStream singleStream; |
27 | private int stateNumber; |
28 | // private List<SequenceState> nextStates = new ArrayList<SequenceState>(); |
29 | private SequenceState nextState =null; |
30 | |
31 | private boolean first = false; |
32 | private boolean last = false; |
33 | |
34 | private SequenceSingleStreamReceiver sequenceSingleStreamReceiver; |
35 | private SequenceStreamPacker sequenceStreamPacker; |
36 | |
37 | public SequenceState(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 | |
76 | public SequenceSingleStreamReceiver getSequenceSingleStreamReceiver() { |
77 | return sequenceSingleStreamReceiver; |
78 | } |
79 | |
80 | public void setSequenceSingleStreamReceiver( |
81 | SequenceSingleStreamReceiver sequenceSingleStreamReceiver) { |
82 | this.sequenceSingleStreamReceiver = sequenceSingleStreamReceiver; |
83 | } |
84 | |
85 | public SequenceStreamPacker getSequenceStreamPacker() { |
86 | return sequenceStreamPacker; |
87 | } |
88 | |
89 | public void setSequenceStreamPacker(SequenceStreamPacker sequenceStreamPacker) { |
90 | this.sequenceStreamPacker = sequenceStreamPacker; |
91 | } |
92 | |
93 | public SequenceState getNextState() { |
94 | return nextState; |
95 | } |
96 | |
97 | public void setNextState(SequenceState nextState) { |
98 | this.nextState = nextState; |
99 | } |
100 | } |