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:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<AudioFormat>, java.util.Collection<AudioFormat>, java.util.List<AudioFormat>, java.util.RandomAccess, java.util.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, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, size, subList, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode |
Methods inherited from class java.util.AbstractCollection |
containsAll, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode |
AudioFormatSet
public AudioFormatSet()
AudioFormatSet
public AudioFormatSet(java.util.Collection<AudioFormat> c)
add
public boolean add(AudioFormat elem)
- Specified by:
add
in interface java.util.Collection<AudioFormat>
- Specified by:
add
in interface java.util.List<AudioFormat>
- Specified by:
add
in interface java.util.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 java.util.List<AudioFormat>
- Overrides:
add
in class ArraySet<AudioFormat>
set
public AudioFormat set(int index,
AudioFormat element)
- Specified by:
set
in interface java.util.List<AudioFormat>
- Overrides:
set
in class ArraySet<AudioFormat>