1 7 8 package javax.sound.sampled; 9 10 19 public abstract class CompoundControl extends Control { 20 21 22 24 25 27 28 31 private Control [] controls; 32 33 34 35 37 38 44 protected CompoundControl(Type type, Control [] memberControls) { 45 46 super(type); 47 this.controls = memberControls; 48 } 49 50 51 52 54 55 59 public Control [] getMemberControls() { 60 61 Control [] localArray = new Control [controls.length]; 62 63 for (int i = 0; i < controls.length; i++) { 64 localArray[i] = controls[i]; 65 } 66 67 return localArray; 68 } 69 70 71 73 74 78 public String toString() { 79 80 StringBuffer buf = new StringBuffer (); 81 for (int i = 0; i < controls.length; i++) { 82 if (i != 0) { 83 buf.append(", "); 84 if ((i + 1) == controls.length) { 85 buf.append("and "); 86 } 87 } 88 buf.append(controls[i].getType()); 89 } 90 91 return new String (getType() + " Control containing " + buf + " Controls."); 92 } 93 94 95 97 98 107 public static class Type extends Control.Type { 108 109 110 112 114 115 119 protected Type(String name) { 120 super(name); 121 } 122 } 124 } | Popular Tags |