1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package gov.nasa.pds.tools.dict;
18
19 import gov.nasa.pds.tools.label.Identifier;
20
21 /***
22 * @author pramirez
23 * @version $Revision: 3461 $
24 *
25 */
26 public class Alias {
27 private String context;
28 private Identifier identifier;
29
30 public Alias(String identifier) {
31 this("", new Identifier(identifier));
32 }
33
34 public Alias(Identifier identifier) {
35 this("", identifier);
36 }
37
38 public Alias(String context, String identifier) {
39 this(context, new Identifier(identifier));
40 }
41
42 public Alias(String context, Identifier identifier) {
43 this.context = context;
44 this.identifier = identifier;
45 }
46
47 public boolean hasContext() {
48 return ("".equals(context)) ? false : true;
49 }
50
51 public String getContext() {
52 return context;
53 }
54
55 public Identifier getIdentifier() {
56 return identifier;
57 }
58
59 public String toString() {
60 if (!"".equals(context))
61 return context + "." + identifier.toString();
62 return identifier.toString();
63 }
64 }