ComparatorThe book has now been published and the content of this chapter has likely changed substanstially.
An object or function whos purpose is to compare two items.
Encapsulate the comparison logic in a method or object that is then passed as an argument to another object or method for later exectution.
It is often used in block based languages such as Smalltalk and Ruby when sorting collections.
Copyright © 2003-2008 Gerard Meszaros all rights reserved