-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathBTypeDef.java
More file actions
51 lines (41 loc) · 1.22 KB
/
BTypeDef.java
File metadata and controls
51 lines (41 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.util.Vector;
/******************************
* Copyright (c) 2003--2024 Kevin Lano
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
* *****************************/
public class BTypeDef extends ModelElement
{ private Vector values; // null for given sets
public BTypeDef(String name, Vector vals)
{ super(name);
values = vals;
}
public void generateJava(java.io.PrintWriter out)
{ out.print(getName()); } // not used.
public Vector getParameters()
{ return new Vector(); }
public void addParameter(Attribute att)
{ }
public Type getType()
{ return null; }
public void setType(Type t)
{ }
public String toString()
{ String res = getName();
if (values == null)
{ return res; } // but not for int, String, boolean, double
int vc = values.size();
if (vc == 0)
{ return res; }
res = res + " = {";
for (int i = 0; i < vc; i++)
{ res = res + values.get(i);
if (i < vc - 1)
{ res = res + ", "; }
}
return res + "}";
}
}