home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2008 March / MAC_easy_03_08.iso / Software / Shareware / Isolator-3.3.dmg / Docs / Source Code / LessThanAboutOne.m < prev    next >
Encoding:
Text File  |  2008-06-04  |  575 b   |  34 lines

  1. //
  2. //  LessThanAboutOne.m
  3. //  Isolator
  4. //
  5. //  Created by Ben Willmore on 13/02/2007.
  6. //  Copyright 2007 __MyCompanyName__. All rights reserved.
  7. //
  8.  
  9. #import "LessThanAboutOne.h"
  10.  
  11. const float kSlop = 0.02;
  12.  
  13. @implementation LessThanAboutOne
  14.  
  15. + (Class)transformedValueClass;
  16. {
  17.     return [NSNumber class];
  18. }
  19.  
  20. + (BOOL)allowsReverseTransformation;
  21. {
  22.     return NO;   
  23. }
  24.  
  25. - (id)transformedValue:(id)value;
  26. {
  27.     if ([value compare:[NSNumber numberWithFloat:(1.0-kSlop)]]==NSOrderedAscending)
  28.         return [NSNumber numberWithBool:YES];
  29.     else
  30.         return [NSNumber numberWithBool:NO];
  31. }
  32.  
  33. @end
  34.