28package com.jogamp.gluegen.cgram.types;
30import java.util.HashSet;
98 private final String origName;
99 private final HashSet<String> aliasedNames;
103 if(
null == origName ) {
104 throw new IllegalArgumentException(
"Null origName not allowed");
106 this.origName = origName;
107 this.aliasedNames=
new HashSet<String>();
108 this.name = origName;
111 this.origName = o.origName;
112 this.aliasedNames =
new HashSet<String>(o.aliasedNames);
116 public void rename(
final String newName) {
117 if(
null != newName && !name.equals(newName) ) {
118 aliasedNames.add(name);
119 aliasedNames.remove(newName);
125 if(
null != origName && !name.equals(origName) ) {
126 aliasedNames.add(origName);
131 return aliasedNames.size() > 0;
147 return "["+name+
", aliases "+aliasedNames.toString()+
", "+toString()+
"]";
151 private final String name;
154 this.name = origName;
157 public void rename(
final String newName) {
158 throw new UnsupportedOperationException();
162 throw new UnsupportedOperationException();
Set< String > getAliasedNames()
Return all aliases for this symbol, i.e.
AliasedSymbolImpl(final AliasedSymbolImpl o)
void rename(final String newName)
Rename this symbol with the given newName if not equal current-name.
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.
boolean hasAliases()
Returns true if this symbol has aliases, i.e.
String getOrigName()
Return the original-name as set at creation.
void addAliasedName(final String origName)
Add the given origName to the list of aliases if not equal current-name.
String getAliasedString()
Return this object's toString() wrapped w/ the current-name and all aliases.
AliasedSymbolImpl(final String origName)
boolean hasAliases()
Returns true if this symbol has aliases, i.e.
NoneAliasedSymbol(final String origName)
String getOrigName()
Return the original-name as set at creation.
void addAliasedName(final String origName)
Add the given origName to the list of aliases if not equal current-name.
String getAliasedString()
Return this object's toString() wrapped w/ the current-name and all aliases.
void rename(final String newName)
Rename this symbol with the given newName if not equal current-name.
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.
Set< String > getAliasedNames()
Return all aliases for this symbol, i.e.
Supports symbol aliasing, i.e.
String getAliasedString()
Return this object's toString() wrapped w/ the current-name and all aliases.
String getOrigName()
Return the original-name as set at creation.
Set< String > getAliasedNames()
Return all aliases for this symbol, i.e.
boolean hasAliases()
Returns true if this symbol has aliases, i.e.
void addAliasedName(final String origName)
Add the given origName to the list of aliases if not equal current-name.
void rename(final String newName)
Rename this symbol with the given newName if not equal current-name.
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.