Login   Register  
PHP Classes

Comparator Tools: Compare and sort objects of many types

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (27)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2010-09-08 (4 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 410 All time: 5,845 This week: 1,493Up
Version License PHP version Categories  
comparator-tools 0.9BSD License5.1PHP 5, Data types, Language
Description Author  

This package can be used to Sort and compare objects of many types.

It defines the comparable interface that is implemented by several different objects meant to compare common types of values like as files by any of their attributes such as name, size, creation or modification time.

Additionally it provides classes that take advantage of objects that implement the Comparable interface to sort arrays of objects.

Innovation Award  
PHP Programming Innovation award nominee
October 2010
Number 2

Prize: One subscription to the PDF edition of the PHP Architect magazine
Most sorting algorithms determine the order by which a set of elements is stored by comparing pairs of elements.

This package implements a comparable interface that can be implemented by any objects of any classes that you may need to be sorted.

Manuel Lemos
Picture of Fabian Schmengler
Name: Fabian Schmengler is available for providing paid consulting. Contact Fabian Schmengler .
Classes: 5 packages by
Country: Germany Germany
Age: 31
All time rank: 114773 in Germany Germany
Week rank: 447 Up12 in Germany Germany Up
Innovation award
Innovation award
Nominee: 4x

  Files folder image Files  
File Role Description
Files folder imageIterators (1 file)
Files folder imageComparators (10 files)
Files folder imageexample (6 files)
Plain text file license.txt Lic. BSD License
Accessible without login Plain text file readme.txt Doc. Documentation
Plain text file comparatortools.lib.php Aux. library loader, include this file to use the package
Plain text file ComparatorTool.php Class abstract tool class
Plain text file ObjectArrayModifier.php Class tool class for other array modifications (diff, intersect, unique)
Plain text file ObjectSorter.php Class tool class for sorting
Plain text file Comparable.php Class comparable interface
Plain text file Comparator.php Class comparator interface
Plain text file ComparatorException.php Class comparator exception
Plain text file functions.inc Aux. procedural interface (osort, orsort etc.)

  Files folder image Files  /  Iterators  
File Role Description
  Plain text file ObjectSortingIterator.php Class ObjectSorter functionality for iterators

  Files folder image Files  /  Comparators  
File Role Description
  Plain text file ComparableComparator.php Class comparator for Comparable interface
  Plain text file ObjectComparator.php Class comparator for object identity
  Plain text file ReverseComparator.php Class decorator class to revert comparator outcome
  Plain text file SplFileInfoComparator.php Class abstract comparator for SplFileInfo objects
  Plain text file SplFileInfoComparatorATime.php Class compare SplFileInfo objects by access time
  Plain text file SplFileInfoComparatorCTime.php Class compare SplFileInfo objects by creation time
  Plain text file SplFileInfoComparatorMTime.php Class compare SplFileInfo objects by modification time
  Plain text file SplFileInfoComparatorName.php Class compare SplFileInfo objects by file name
  Plain text file SplFileInfoComparatorSize.php Class compare SplFileInfo objects by file size
  Plain text file SplFileInfoComparatorType.php Class compare SplFileInfo objects by file type

  Files folder image Files  /  example  
File Role Description
  Plain text file ExampleComparator.php Example an implementation of the Comparator interface, used by the examples
  Plain text file ExampleData.php Example an implementation of the Comparable interface, used by the examples
  Plain text file randomdata.inc Example generation of a randomized object array
  Plain text file sort.php Example some sorting
  Plain text file sort_procedural.php Example same example but with the procedural interface
  Plain text file advanced.php Example more examples

 Version Control Unique User Downloads Download Rankings  
 0%Total:410All time:5,845
 This week:0This week:1,493Up