de.scheisseichfindemalkeinen.database
Class DownloadComparator

java.lang.Object
  extended by de.scheisseichfindemalkeinen.database.DownloadComparator
All Implemented Interfaces:
java.util.Comparator

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

This class is for sorting of the download-queue


Field Summary
static int BY_BOTH_CONTAINER_URL_FIRST
          Sort first by container url, then by directory
static int BY_BOTH_DIRECTORY_FIRST
          Sort first by directory, then by container url
static int BY_CONTAINER_URL_ONLY
          Sort only by container url
static int BY_TARGET_DIRECTORY_ONLY
          Sort only by directory
static int NO_SORT
          Do not Sort
 
Constructor Summary
DownloadComparator(int compareBy)
          Constructor
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

NO_SORT

public static final int NO_SORT
Do not Sort

See Also:
Constant Field Values

BY_BOTH_CONTAINER_URL_FIRST

public static final int BY_BOTH_CONTAINER_URL_FIRST
Sort first by container url, then by directory

See Also:
Constant Field Values

BY_BOTH_DIRECTORY_FIRST

public static final int BY_BOTH_DIRECTORY_FIRST
Sort first by directory, then by container url

See Also:
Constant Field Values

BY_CONTAINER_URL_ONLY

public static final int BY_CONTAINER_URL_ONLY
Sort only by container url

See Also:
Constant Field Values

BY_TARGET_DIRECTORY_ONLY

public static final int BY_TARGET_DIRECTORY_ONLY
Sort only by directory

See Also:
Constant Field Values
Constructor Detail

DownloadComparator

public DownloadComparator(int compareBy)
Constructor

Parameters:
compareBy - How to sort
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator