com.antelmann.cddb
Class CDSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<CDID>
com.antelmann.cddb.CDSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<CDID>, Collection<CDID>, Set<CDID>
public class CDSet
- extends HashSet<CDID>
A helper class to manage a CD collection with the ability to
import/export the set to/from a file.
The elements of this set need are to be exclusively
CDID instances.
This class does not support customized user annotations;
for that purpose, simply wrap this class into whatever you like
to add additional information (e.g. including how many instances
of the same CD are in your collection, as this class is a set).
This is just a raw set of unique CDs. You may consider using a
CDCollection.
This class is not thread-save nor synchronized.
- Author:
- Holger Antelmann
- See Also:
CDID,
CDCollection,
Serialized Form
|
Constructor Summary |
CDSet()
|
|
Method Summary |
void |
exportToFile(File file)
exports all CDID entries into a file. |
void |
importFromFile(File file)
imports CDID entries from a file; each entry is added to the
current set (if not already present) |
CDSet
public CDSet()
importFromFile
public void importFromFile(File file)
throws IOException
- imports CDID entries from a file; each entry is added to the
current set (if not already present)
- Throws:
IOException- See Also:
exportToFile(File)
exportToFile
public void exportToFile(File file)
throws IOException
- exports all CDID entries into a file.
The CDID entries are represented as separate lines ('\n' terminated),
while each line contains the query string from the CDID.
An existing file at the specified location will be overwritten
if the file attributes permit this.
- Throws:
IOException- See Also:
CDID.getQueryString()
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads