KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > code > flow > LocalFlowInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.corext.refactoring.code.flow;
12
13 import org.eclipse.jdt.core.dom.IVariableBinding;
14
15 class LocalFlowInfo extends FlowInfo {
16
17     private int fVariableId;
18
19     public LocalFlowInfo(IVariableBinding binding, int localAccessMode, FlowContext context) {
20         super(NO_RETURN);
21         fVariableId= binding.getVariableId();
22         if (context.considerAccessMode()) {
23             createAccessModeArray(context);
24             fAccessModes[fVariableId - context.getStartingIndex()]= localAccessMode;
25             context.manageLocal(binding);
26         }
27     }
28     
29     public LocalFlowInfo(LocalFlowInfo info, int localAccessMode, FlowContext context) {
30         super(NO_RETURN);
31         fVariableId= info.fVariableId;
32         if (context.considerAccessMode()) {
33             createAccessModeArray(context);
34             fAccessModes[fVariableId - context.getStartingIndex()]= localAccessMode;
35         }
36     }
37     
38     public void setWriteAccess(FlowContext context) {
39         if (context.considerAccessMode()) {
40             fAccessModes[fVariableId - context.getStartingIndex()]= FlowInfo.WRITE;
41         }
42     }
43 }
44
45
Popular Tags