KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > importer > rose > builder > UnitTreeNode


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: UnitTreeNode.java,v 1.2 2005/06/08 06:20:36 nickb Exp $
16  */

17 package org.eclipse.emf.importer.rose.builder;
18
19 import java.util.ArrayList JavaDoc;
20 import java.util.List JavaDoc;
21
22 import org.eclipse.emf.common.util.EList;
23 import org.eclipse.emf.importer.rose.parser.RoseNode;
24
25
26 public class UnitTreeNode
27 {
28   protected String JavaDoc name;
29   protected String JavaDoc quid;
30   protected String JavaDoc roseFileName;
31   protected String JavaDoc ecoreFileName;
32   protected List JavaDoc nodes;
33   protected EList extent;
34   protected RoseNode roseNode;
35
36   public UnitTreeNode(String JavaDoc name, String JavaDoc quid, String JavaDoc fileName)
37   {
38     this.name = name;
39     this.quid = quid;
40     roseFileName = fileName;
41     int index = roseFileName.lastIndexOf(".");
42     if (index != -1)
43     {
44       ecoreFileName = roseFileName.substring(0, index + 1) + "ecore";
45     }
46     else
47     {
48       ecoreFileName = roseFileName + ".ecore";
49     }
50
51     nodes = new ArrayList JavaDoc();
52   }
53
54   public RoseNode getRoseNode()
55   {
56     return roseNode;
57   }
58
59   public void setRoseNode(RoseNode roseNode)
60   {
61     this.roseNode = roseNode;
62   }
63
64   public String JavaDoc getRoseFileName()
65   {
66     return roseFileName;
67   }
68
69   public String JavaDoc getEcoreFileName()
70   {
71     return ecoreFileName;
72   }
73
74   public String JavaDoc getQUID()
75   {
76     return quid;
77   }
78
79   public String JavaDoc getName()
80   {
81     return name;
82   }
83
84   public void setRoseFileName(String JavaDoc roseFileName)
85   {
86     this.roseFileName = roseFileName;
87   }
88
89   public void setEcoreFileName(String JavaDoc ecoreFileName)
90   {
91     this.ecoreFileName = ecoreFileName;
92   }
93
94   public void setName(String JavaDoc name)
95   {
96     this.name = name;
97   }
98
99   public void setQUID(String JavaDoc quid)
100   {
101     this.quid = quid;
102   }
103
104   public void addNode(UnitTreeNode node)
105   {
106     nodes.add(node);
107   }
108
109   public List JavaDoc getNodes()
110   {
111     return nodes;
112   }
113
114   public void setExtent(EList extent)
115   {
116     this.extent = extent;
117   }
118
119   public EList getExtent()
120   {
121     return extent;
122   }
123 }
124
Popular Tags