EMMA Coverage Report (generated Tue Jul 10 07:50:22 IST 2012)
[all classes][org.wso2.siddhi.query.api.stream]

COVERAGE SUMMARY FOR SOURCE FILE [JoinStream.java]

nameclass, %method, %block, %line, %
JoinStream.java100% (3/3)31%  (5/16)56%  (116/209)36%  (9.7/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class JoinStream100% (1/1)12%  (1/8)19%  (18/93)29%  (7/24)
constructQueryEventStreamList (Map, List): List 0%   (0/1)0%   (0/12)0%   (0/2)
getLeftStream (): Stream 0%   (0/1)0%   (0/3)0%   (0/1)
getOnCompare (): Condition 0%   (0/1)0%   (0/3)0%   (0/1)
getRightStream (): Stream 0%   (0/1)0%   (0/3)0%   (0/1)
getStreamIds (): List 0%   (0/1)0%   (0/48)0%   (0/10)
getTrigger (): JoinStream$EventTrigger 0%   (0/1)0%   (0/3)0%   (0/1)
getType (): JoinStream$Type 0%   (0/1)0%   (0/3)0%   (0/1)
JoinStream (Stream, JoinStream$Type, Stream, Condition, JoinStream$EventTrigg... 100% (1/1)100% (18/18)100% (7/7)
     
class JoinStream$EventTrigger100% (1/1)50%  (2/4)81%  (39/48)90%  (1.8/2)
valueOf (String): JoinStream$EventTrigger 0%   (0/1)0%   (0/5)0%   (0/1)
values (): JoinStream$EventTrigger [] 0%   (0/1)0%   (0/4)0%   (0/1)
<static initializer> 100% (1/1)100% (34/34)100% (2/2)
JoinStream$EventTrigger (String, int): void 100% (1/1)100% (5/5)100% (1/1)
     
class JoinStream$Type100% (1/1)50%  (2/4)87%  (59/68)86%  (0.9/1)
valueOf (String): JoinStream$Type 0%   (0/1)0%   (0/5)0%   (0/1)
values (): JoinStream$Type [] 0%   (0/1)0%   (0/4)0%   (0/1)
<static initializer> 100% (1/1)100% (54/54)100% (1/1)
JoinStream$Type (String, int): void 100% (1/1)100% (5/5)100% (1/1)

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*/
18package org.wso2.siddhi.query.api.stream;
19 
20import org.wso2.siddhi.query.api.query.QueryEventStream;
21import org.wso2.siddhi.query.api.condition.Condition;
22import org.wso2.siddhi.query.api.definition.StreamDefinition;
23 
24import java.util.ArrayList;
25import java.util.List;
26import java.util.Map;
27 
28public class JoinStream implements Stream {
29 
30    private Stream leftStream;
31    private Type type;
32    private Stream rightStream;
33    private Condition onCompare;
34    private EventTrigger trigger;
35 
36    public enum EventTrigger {
37        LEFT,RIGHT,ALL
38    }
39    public JoinStream(Stream leftStream, Type type,
40                      Stream rightStream, Condition onCompare, EventTrigger trigger) {
41        this.leftStream = leftStream;
42        this.type = type;
43        this.rightStream = rightStream;
44        this.onCompare = onCompare;
45        this.trigger = trigger;
46    }
47 
48    public Stream getLeftStream() {
49        return leftStream;
50    }
51 
52    public Type getType() {
53        return type;
54    }
55 
56    public Stream getRightStream() {
57        return rightStream;
58    }
59 
60    public Condition getOnCompare() {
61        return onCompare;
62    }
63 
64    public EventTrigger getTrigger() {
65        return trigger;
66    }
67 
68    @Override
69    public List<String> getStreamIds() {
70        List<String> list = new ArrayList<String>();
71        for (String streamId : leftStream.getStreamIds()) {
72            if (!list.contains(streamId)) {
73                list.add(streamId);
74            }
75        }
76        for (String streamId : rightStream.getStreamIds()) {
77            if (!list.contains(streamId)) {
78                list.add(streamId);
79            }
80        }
81        return list;
82    }
83 
84    @Override
85    public List<QueryEventStream> constructQueryEventStreamList(
86            Map<String, StreamDefinition> streamDefinitionMap,
87            List<QueryEventStream> queryEventStreams) {
88        List<QueryEventStream> queryEventStreamList = leftStream.constructQueryEventStreamList(streamDefinitionMap, queryEventStreams);
89        return rightStream.constructQueryEventStreamList(streamDefinitionMap, queryEventStreamList);
90    }
91 
92 
93    public enum Type {JOIN, INNER_JOIN, LEFT_OUTER_JOIN, RIGHT_OUTER_JOIN, FULL_OUTER_JOIN}
94}

[all classes][org.wso2.siddhi.query.api.stream]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov