core
Class Extensions

java.lang.Object
  extended by core.Extensions
All Implemented Interfaces:
java.io.Serializable

public class Extensions
extends java.lang.Object
implements java.io.Serializable

This class maintains the extensions that will assist in filtering file types. Filtering of file types takes place when duplicates are searched for. This class will parse a string for types to filter. If the parsing fails the extensions to filter are set to null

See Also:
Serialized Form

Field Summary
static java.lang.String[] ALL_ITUNES_MEDIA_FORMATS
          Both iTunes audio and video formats combined
static java.lang.String[] DEFAULT_FORMATS
          The default iTunesDSM files to filter
static java.lang.String[] ITUNES_AUDIO_FORMATS
          All of the file types that iTunes accepts as audio files
static java.lang.String[] ITUNES_VIDEO_FORMATS
          All of the file types that iTunes as video files
 
Constructor Summary
Extensions()
          Creates a default extensions object
Extensions(java.lang.String[] ext)
          Contructs an Extensions object with a set of known file type extensions
 
Method Summary
static boolean equals(java.lang.String[] anArray, java.lang.String[] testArray)
          Returns a boolean as to whether the two given arrays are equal.
 java.lang.String[] getExtensions()
          Returns the extensions
 void setExtensions(java.lang.String str)
          Sets the file extensions to a given string.
 void setExtensions(java.lang.String[] ext)
          Sets the array of extensions to a known array of extensions
 java.lang.String toString()
          Returns a formatted string of extensions for display
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ITUNES_AUDIO_FORMATS

public static final java.lang.String[] ITUNES_AUDIO_FORMATS
All of the file types that iTunes accepts as audio files


ITUNES_VIDEO_FORMATS

public static final java.lang.String[] ITUNES_VIDEO_FORMATS
All of the file types that iTunes as video files


ALL_ITUNES_MEDIA_FORMATS

public static final java.lang.String[] ALL_ITUNES_MEDIA_FORMATS
Both iTunes audio and video formats combined


DEFAULT_FORMATS

public static final java.lang.String[] DEFAULT_FORMATS
The default iTunesDSM files to filter

Constructor Detail

Extensions

public Extensions()
Creates a default extensions object


Extensions

public Extensions(java.lang.String[] ext)
Contructs an Extensions object with a set of known file type extensions

Parameters:
ext - the array of file extensions to set the Extensions to.
Method Detail

setExtensions

public void setExtensions(java.lang.String str)
Sets the file extensions to a given string. The string is input and the parsed. If the parsing fails the extensions are set to null.

Parameters:
str - the string to parse for extensions

setExtensions

public void setExtensions(java.lang.String[] ext)
Sets the array of extensions to a known array of extensions

Parameters:
ext - the new array of extensions

getExtensions

public java.lang.String[] getExtensions()
Returns the extensions

Returns:
returns the extensions. Will return null if they have not been set or if parsing the extensions failed.

toString

public java.lang.String toString()
Returns a formatted string of extensions for display

Overrides:
toString in class java.lang.Object
Returns:
the formatted string of extensions

equals

public static boolean equals(java.lang.String[] anArray,
                             java.lang.String[] testArray)
Returns a boolean as to whether the two given arrays are equal.

Parameters:
anArray - the first array to test if it is equal to testArray
testArray - the second array to test if it is equal to anArray
Returns:
the boolean as to whether or not the two arrays are equal