home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Headers / misckit / MiscSortedStorage.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-23  |  1.2 KB  |  52 lines

  1. //
  2. //    MiscSortedStorage.h -- a MiscStorage which keeps the elements sorted
  3. //        Written by Doug McClure Copyright (c) 1994 by Doug McClure.
  4. //                Version 1.0.  All rights reserved.
  5. //
  6. //        This notice may not be removed from this source code.
  7. //
  8. //    This object is included in the MiscKit by permission from the author
  9. //    and its use is governed by the MiscKit license, found in the file
  10. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  11. //    for a list of all applicable permissions and restrictions.
  12. //    
  13.  
  14. #import <appkit/appkit.h>
  15. #import <misckit/MiscProtocols.h>
  16. #import <misckit/MiscStorage.h>
  17.  
  18. #ifndef Misc_ASCENDING
  19. #define Misc_ASCENDING    1
  20. #define Misc_DESCENDING    (-1)
  21. #endif
  22.  
  23. @interface MiscSortedStorage : MiscStorage
  24. {
  25.   BOOL ignoreCase;
  26.   int sortOrder;
  27.  
  28. @private
  29.   BOOL sorted;
  30.   BOOL sortEnabled;
  31. }
  32.  
  33. /* Access instance variables methods */
  34.  
  35. - (BOOL)sorted;
  36. - (BOOL)sortEnabled;
  37. - (int)sortOrder;
  38.  
  39. /* Setting instance variables methods */
  40.  
  41. - setSortEnabled:(BOOL)sort;
  42. - setSortOrder:(int)order;
  43.  
  44. /* New accessing, inserting, sorting methods */
  45.  
  46. - (int)compare:(void *)elementA to:(void *)elementB caseCheck:(BOOL)flag;
  47. - insertElementBySort:(void *)anElement;
  48. - (void *)lastElement;
  49. - sort;
  50.  
  51. @end
  52.