1 19 package org.netbeans.tax.decl; 20 21 import java.util.*; 22 23 import org.netbeans.tax.*; 24 25 public class MixedType extends ChoiceType { 26 27 31 public MixedType () { 32 super (); 33 } 34 35 public MixedType (Collection col) { 36 super (col); 37 } 38 39 public MixedType (MixedType mixedType) { 40 super (mixedType); 41 } 42 43 44 46 public Object clone () { 47 return new MixedType (this); 48 } 49 50 51 55 57 public boolean allowText () { 58 return true; 59 } 60 61 63 public boolean allowElements () { 64 return hasChildren (); 65 } 66 67 69 public String toString () { 70 Iterator it = getTypes ().iterator (); 71 StringBuffer sb = new StringBuffer (); 72 while (it.hasNext ()) { 73 TreeElementDecl.ContentType next = (TreeElementDecl.ContentType) it.next (); 74 sb.append (" | ").append (next.toString ()); } 76 if (sb.length () > 0) sb.delete (0,3); 77 78 return "( #PCDATA" + ( hasChildren () ? " | " + sb.toString () : "" ) + " )" + getMultiplicity (); } 80 81 83 public String getName () { 84 return (!!! hasChildren ()) ? Util.THIS.getString ("NAME_PCDATA") : Util.THIS.getString ("NAME_MIX") + getMultiplicity (); 85 } 86 87 } 88 | Popular Tags |