org.tritonus.share.sampled
Class AudioFormatSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.tritonus.share.ArraySet<AudioFormat>
org.tritonus.share.sampled.AudioFormatSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<AudioFormat>, Collection<AudioFormat>, List<AudioFormat>, RandomAccess, Set<AudioFormat>
public class AudioFormatSet
- extends ArraySet<AudioFormat>
A set where the elements are uniquely referenced by
AudioFormats.equals rather than their object reference.
No 2 equal AudioFormats can exist in the set.
This class provide convenience methods like
getAudioFormat(AudioFormat) and
matches(AudioFormat).
The contains(Object elem) and get(Object elem)
fail, if elem is not an instance of AudioFormat.
You shouldn't use the ArrayList specific functions
like those that take index parameters.
It is not possible to add null elements.
Currently, the methods equals(.,.) and matches(.,.) of
class AudioFormats are used. Let's hope that they will
be integrated into AudioFormat.
- See Also:
- Serialized Form
| Methods inherited from class java.util.ArrayList |
addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize |
| Methods inherited from interface java.util.Set |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
EMPTY_FORMAT_ARRAY
protected static final AudioFormat[] EMPTY_FORMAT_ARRAY
AudioFormatSet
public AudioFormatSet()
AudioFormatSet
public AudioFormatSet(Collection<AudioFormat> c)
add
public boolean add(AudioFormat elem)
- Specified by:
add in interface Collection<AudioFormat>- Specified by:
add in interface List<AudioFormat>- Specified by:
add in interface Set<AudioFormat>- Overrides:
add in class ArraySet<AudioFormat>
contains
public boolean contains(AudioFormat elem)
get
public AudioFormat get(AudioFormat elem)
getAudioFormat
public AudioFormat getAudioFormat(AudioFormat elem)
matches
public AudioFormat matches(AudioFormat elem)
- Checks whether this Set contains an AudioFormat
that matches
elem.
The first matching format is returned. If no element
matches elem, null is returned.
- See Also:
AudioFormats.matches(AudioFormat, AudioFormat)
toAudioFormatArray
public AudioFormat[] toAudioFormatArray()
add
public void add(int index,
AudioFormat element)
- Specified by:
add in interface List<AudioFormat>- Overrides:
add in class ArraySet<AudioFormat>
set
public AudioFormat set(int index,
AudioFormat element)
- Specified by:
set in interface List<AudioFormat>- Overrides:
set in class ArraySet<AudioFormat>
Copyright © 2012. All Rights Reserved.