public class DefaultEqualizerModel extends AbstractEqualizerModel
EqualizerModel. It ensures that the initial values of the
categories are within the Range and that there are no duplicate category names.| Modifier and Type | Field and Description |
|---|---|
static Range |
DEFAULT_RANGE
The default range of this model:
[0, 100] |
protected List<EqualizerCategory> |
equalizerCategories |
| Constructor and Description |
|---|
DefaultEqualizerModel(Collection<EqualizerCategory> equalizerCategories)
Creates a new DefaultEqualizerModel object using the given list of
EqualizerCategorys. |
DefaultEqualizerModel(Collection<EqualizerCategory> equalizerCategories,
Range range)
Creates a new DefaultEqualizerModel object using the given list of
EqualizerCategorys and the given
Range. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkValueWithinRange(int value)
Checks if value is within the range of the model.
|
List<EqualizerCategory> |
getEqualizerCategories()
Getter for the
EqualizerCategorys of this model. |
String |
getEqualizerCategory(int index)
Getter for the category name at the specified index.
|
int |
getEqualizerCategoryCount()
Getter for the total amount of available categories.
|
Range |
getRange()
Getter for the range this equalizer model covers (boundaries included).
|
int |
getValueAt(int index)
Getter for the current value at the specified index.
|
void |
setValueAt(int index,
int value)
Setter for the a new value at the specified index.
|
addEqualizerModelListener, fireEqualizerModelEvent, removeEqualizerModelListenerpublic static final Range DEFAULT_RANGE
[0, 100]protected final List<EqualizerCategory> equalizerCategories
public DefaultEqualizerModel(Collection<EqualizerCategory> equalizerCategories)
EqualizerCategorys. Simply
delegates to DefaultEqualizerModel(java.util.Collection, de.cismet.commons.gui.equalizer.Range) using
the DEFAULT_RANGE.equalizerCategories - the EqualizerCategorys of this modelDefaultEqualizerModel(java.util.Collection, de.cismet.commons.gui.equalizer.Range)public DefaultEqualizerModel(Collection<EqualizerCategory> equalizerCategories, Range range)
EqualizerCategorys and the given
Range. null is not permitted for any parameter value and results in an
IllegalArgumentException. Additionally, IllegalArgumentException will also be thrown if the
category collection is empty or if any of the initial values of the categories is not within Range
or there are duplicate category names.Iterator is responsible for the indexing of
available categories. This means that the first element of the Iterator will be available at index
0 while the last element returned by the Iterator will be available at index
collection.size() - 1.equalizerCategories - the EqualizerCategorys of this modelrange - the Range of the values of this model's categoriesIllegalArgumentException - if any argument is null, if the category collection is empty, if
there are duplicate category names or if any initial value is not within
Rangepublic void checkValueWithinRange(int value)
value - value to checkIllegalArgumentException - if value is not within range of the modelpublic List<EqualizerCategory> getEqualizerCategories()
EqualizerCategorys of this model. Returns a deep clone of the categories and not the
internal collection itself.public Range getRange()
EqualizerModelRange this model coverspublic String getEqualizerCategory(int index)
EqualizerModelIndexOutOfBoundsException if index is
< 0 or >= EqualizerModel.getEqualizerCategoryCount().index - the category indexpublic int getEqualizerCategoryCount()
EqualizerModelpublic int getValueAt(int index)
EqualizerModelIndexOutOfBoundsException if index is
< 0 or >= EqualizerModel.getEqualizerCategoryCount().index - the category indexpublic void setValueAt(int index,
int value)
EqualizerModelRange of this
model. Otherwise an IllegalArgumentException shall be thrown. Shall throw
IndexOutOfBoundsException if index is < 0 or >=
EqualizerModel.getEqualizerCategoryCount().index - the category indexvalue - the new valueCopyright © 2012–2026 cismet GmbH. All rights reserved.