home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 September / dppcpro0998.iso / Rwc / Sybase / Install.exe / samples.z / StringLengthSort.wxc < prev    next >
Encoding:
Text File  |  1998-03-25  |  1.8 KB  |  83 lines

  1. Save Format v2.3(19971110)
  2. @begin ClassFile "StringLengthSort"
  3.  
  4.  @begin Object "Powersoft Java AWT 1.02::powersoft.painter.Class"
  5.   DesignName StringLengthSort;
  6.   @begin ClassProperties
  7.    Exported 1;
  8. @begin-code BaseClassList
  9.  
  10. extends Object implements CompareRoutine
  11.  
  12. @end-code;
  13.    @begin CPMethod "compare"
  14.     @begin CPPrototype "Prototype for compareMethod"
  15. @begin-code SourceCode "Prototype for compareMethod"
  16.  
  17.         // Not used for Java classes
  18.  
  19. @end-code;
  20.     @end;
  21.     @begin CPDefinition "compareMethod"
  22. @begin-code SourceCode "compareMethod"
  23.  
  24.     //
  25.     // compareMethod
  26.     //
  27.  
  28.     public int compare(Object a, Object b)
  29.     {
  30.         return ((String) a).length() - ((String) b).length();
  31.     }
  32.  
  33. @end-code;
  34.     @end;
  35.    @end;
  36.   @end;
  37.   @begin CodeBlocks
  38.    @begin CodeBlock "HppPrefix"
  39.     FunctionScope 1;
  40. @begin-code SourceCode "Imports()"
  41.  
  42. // add your custom import statements here
  43. import powersoft.powerj.util.*;
  44.  
  45.  
  46. //  This class was created to implement a new compare routine
  47. //  for the SortableVector.  The compare method is defined in the
  48. //  CompareRoutine interface and must return an integer.
  49. //
  50. //  compare returns:
  51. //  a negative number if a < b
  52. //  zero              if a == b
  53. //  a positive number if a > b
  54.  
  55. @end-code;
  56.    @end;
  57.    @begin CodeBlock "ClassContents"
  58.     FunctionScope 1;
  59. @begin-code SourceCode "Data Members()"
  60.  
  61.     // add your data members here
  62.  
  63. @end-code;
  64.    @end;
  65.    @begin CodeBlock "GeneratedClassContents"
  66.     FunctionScope 1;
  67. @begin-code SourceCode "GeneratedClassContents()"
  68.  
  69.  
  70. @end-code;
  71.    @end;
  72.    @begin CodeBlock "CppPrefix"
  73.     FunctionScope 6;
  74.     GeneratedFunction 1;
  75. @begin-code SourceCode "Not Applicable for Java()"
  76.  
  77.  
  78. @end-code;
  79.    @end;
  80.   @end;
  81.  @end;
  82. @end;
  83.