org.opensubsystems.core.util
Class FileLengthComparator

java.lang.Object
  extended by org.opensubsystems.core.util.FileLengthComparator
All Implemented Interfaces:
java.util.Comparator

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

Comparator to compare length of files so that the files will be sorted from the smallest one to the largest one.

Version:
$Id: FileLengthComparator.java,v 1.6 2007/02/21 06:14:26 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.2 2004/12/18 06:18:25 bastafidli

Constructor Summary
FileLengthComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compare lengths two files represented by File Objects.
static java.util.Comparator getInstance()
          Get shared comparator instance.
 
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
 

Constructor Detail

FileLengthComparator

public FileLengthComparator()
Method Detail

getInstance

public static java.util.Comparator getInstance()
Get shared comparator instance.

Returns:
FileLengthComparator - shared comparator instance

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compare lengths two files represented by File Objects.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - - File #1
o2 - - File #2
Returns:
int - -1 if o1 < o2, 0 if o1 == o2 1 if o1 > o2


Copyright © 2003 - 2006 OpenSubsystems s.r.o.