helliker.id3
Class MP3Comparator

java.lang.Object
  extended byhelliker.id3.MP3Comparator
All Implemented Interfaces:
java.util.Comparator

public class MP3Comparator
extends java.lang.Object
implements java.util.Comparator


Constructor Summary
MP3Comparator()
           
 
Method Summary
private  boolean accept(java.lang.String str1, java.lang.String str2)
          Returns true if the two parameters are acceptable comparison values.
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares the objects.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is an MP3Comparator
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3Comparator

public MP3Comparator()
Method Detail

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is an MP3Comparator

Specified by:
equals in interface java.util.Comparator
Parameters:
obj - the object to test
Returns:
true if the object is an MP3Comparator

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares the objects. Non-MP3File objects will always be less then an MP3File object and if neither objects are MP3Files then they are considered equal. A series of tests are conducted to determine the the outcome. First the artist is tested, then the album, then the track, then the title, then the path.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - one object to compare
o2 - another object to compare
Returns:
a positive number if o1 > o2, zero if o1 = o2, and a negative number if o1 < o2

accept

private boolean accept(java.lang.String str1,
                       java.lang.String str2)
Returns true if the two parameters are acceptable comparison values. In order to be acceptable, both parameters must not be empty and they must not be equal.

Parameters:
str1 - the first parameter
str2 - the second parameter
Returns:
true if the two parameters are acceptable comparison values


Copyright © 2004 NeurosDBM Dev Team All Rights Reserved.