2 * Program Understanding / Assignment Tracing for JavaScript
\r
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
\r
7 * Hyukmin Kwon <hyukmin0530@samsung.com>
\r
8 * Woongsik Choi <woongsik76.choi@samsung.com>
\r
10 * Licensed under the Apache License, Version 2.0 (the "License");
\r
11 * you may not use this file except in compliance with the License.
\r
12 * You may obtain a copy of the License at
\r
14 * http://www.apache.org/licenses/LICENSE-2.0
\r
16 * Unless required by applicable law or agreed to in writing, software
\r
17 * distributed under the License is distributed on an "AS IS" BASIS,
\r
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
19 * See the License for the specific language governing permissions and
\r
20 * limitations under the License.
\r
25 package org.tizen.web.assignmenttracing.core.environment;
\r
27 import org.tizen.web.assignmenttracing.core.CFGNode;
\r
30 * This class represents enclosing switch.
\r
32 * @author Hyukmin Kwon <hyukmin0530@samsung.com>
\r
34 public class SwitchElement extends EnvironmentElement {
\r
35 private CFGNode breakTarget = null;
\r
36 private CFGNode prevOfSwitchBody = null;
\r
37 private CFGNode prevOfCaseExprChain = null;
\r
38 private CFGNode defaultNode = null;
\r
42 * @param breakTarget Break target CFGNode
\r
43 * @param prevOfSwitchBody Previous CFGNode of switch body
\r
45 public SwitchElement(CFGNode breakTarget, CFGNode prevOfSwitchBody) {
\r
46 this.breakTarget = breakTarget;
\r
47 this.prevOfSwitchBody = prevOfSwitchBody;
\r
51 public EnvironmentElement getCopy() {
\r
52 SwitchElement copy = new SwitchElement(breakTarget, prevOfSwitchBody);
\r
53 copy.setPrevOfCaseExprChain(prevOfCaseExprChain);
\r
54 copy.setDefaultNode(defaultNode);
\r
59 * Returns break target CFGNode
\r
62 public CFGNode getBreakTarget() {
\r
67 * Returns previous CFGNode of switch body
\r
70 public CFGNode getPrevOfCaseExprChain() {
\r
71 return prevOfCaseExprChain;
\r
75 * Set previous CFGNode of switch body
\r
76 * @param latestCaseExpr
\r
78 public void setPrevOfCaseExprChain(CFGNode latestCaseExpr) {
\r
79 this.prevOfCaseExprChain = latestCaseExpr;
\r
83 * Returns CFGNode of default statement
\r
86 public CFGNode getDefaultNode() {
\r
91 * Set CFGNode of default statement
\r
92 * @param defaultNode
\r
94 public void setDefaultNode(CFGNode defaultNode) {
\r
95 this.defaultNode = defaultNode;
\r