0N/A/*
2362N/A * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.sound.sampled;
0N/A
0N/A/**
0N/A * A <code>CompoundControl</code>, such as a graphic equalizer, provides control
0N/A * over two or more related properties, each of which is itself represented as
0N/A * a <code>Control</code>.
0N/A *
0N/A * @author Kara Kytle
0N/A * @since 1.3
0N/A */
0N/Apublic abstract class CompoundControl extends Control {
0N/A
0N/A
0N/A // TYPE DEFINES
0N/A
0N/A
0N/A // INSTANCE VARIABLES
0N/A
0N/A
0N/A /**
0N/A * The set of member controls.
0N/A */
0N/A private Control[] controls;
0N/A
0N/A
0N/A
0N/A // CONSTRUCTORS
0N/A
0N/A
0N/A /**
0N/A * Constructs a new compound control object with the given parameters.
0N/A *
0N/A * @param type the type of control represented this compound control object
0N/A * @param memberControls the set of member controls
0N/A */
0N/A protected CompoundControl(Type type, Control[] memberControls) {
0N/A
0N/A super(type);
0N/A this.controls = memberControls;
0N/A }
0N/A
0N/A
0N/A
0N/A // METHODS
0N/A
0N/A
0N/A /**
0N/A * Returns the set of member controls that comprise the compound control.
0N/A * @return the set of member controls.
0N/A */
0N/A public Control[] getMemberControls() {
0N/A
0N/A Control[] localArray = new Control[controls.length];
0N/A
0N/A for (int i = 0; i < controls.length; i++) {
0N/A localArray[i] = controls[i];
0N/A }
0N/A
0N/A return localArray;
0N/A }
0N/A
0N/A
0N/A // ABSTRACT METHOD IMPLEMENTATIONS: CONTROL
0N/A
0N/A
0N/A /**
0N/A * Provides a string representation of the control
0N/A * @return a string description
0N/A */
0N/A public String toString() {
0N/A
0N/A StringBuffer buf = new StringBuffer();
0N/A for (int i = 0; i < controls.length; i++) {
0N/A if (i != 0) {
0N/A buf.append(", ");
0N/A if ((i + 1) == controls.length) {
0N/A buf.append("and ");
0N/A }
0N/A }
0N/A buf.append(controls[i].getType());
0N/A }
0N/A
0N/A return new String(getType() + " Control containing " + buf + " Controls.");
0N/A }
0N/A
0N/A
0N/A // INNER CLASSES
0N/A
0N/A
0N/A /**
0N/A * An instance of the <code>CompoundControl.Type</code> inner class identifies one kind of
0N/A * compound control. Static instances are provided for the
0N/A * common types.
0N/A *
0N/A * @author Kara Kytle
0N/A * @since 1.3
0N/A */
0N/A public static class Type extends Control.Type {
0N/A
0N/A
0N/A // TYPE DEFINES
0N/A
0N/A // CONSTRUCTOR
0N/A
0N/A
0N/A /**
0N/A * Constructs a new compound control type.
0N/A * @param name the name of the new compound control type
0N/A */
0N/A protected Type(String name) {
0N/A super(name);
0N/A }
0N/A } // class Type
0N/A
0N/A} // class CompoundControl