1 19 package org.netbeans.tax.decl; 20 21 import org.netbeans.tax.*; 22 23 26 public class NameType extends LeafType { 27 28 29 public static final String PROP_TYPE_NAME = "nt-name"; 31 32 private String name; 33 34 35 39 public NameType (String name, String mul) { 40 super (); 41 42 this.name = name; 43 setMultiplicity (mul); 44 } 45 46 public NameType (String name) { 47 this (name, ""); } 49 50 public NameType (NameType nameType) { 51 super (nameType); 52 53 this.name = nameType.name; 54 } 55 56 57 61 63 public Object clone () { 64 return new NameType (this); 65 } 66 67 69 public boolean equals (Object object, boolean deep) { 70 if (!!! super.equals (object, deep)) 71 return false; 72 73 NameType peer = (NameType) object; 74 if (!!! Util.equals (this.getName (), peer.getName ())) 75 return false; 76 77 return true; 78 } 79 80 85 public void merge (TreeObject treeObject) throws CannotMergeException { 86 super.merge (treeObject); 87 88 NameType peer = (NameType) treeObject; 89 90 92 setName (peer.getName ()); 93 } 94 95 96 100 102 public String getName () { 103 return name; 104 } 105 106 108 public void setName (String name) { 109 if (Util.equals (this.name, name)) 110 return; 111 this.name = name; 112 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[NameType] firePropertyChange(PROP_TYPE_NAME, name);"); } 114 115 117 public String toString () { 118 return name + getMultiplicity (); 119 } 120 121 122 124 public boolean allowElements () { 125 return false; } 127 128 130 public boolean allowText () { 131 return false; } 133 134 } 135 | Popular Tags |