home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
samples.z
/
StringLengthSort.wxc
< prev
next >
Wrap
Text File
|
1997-01-28
|
2KB
|
78 lines
Save Format v2.0(1)
@begin ClassFile "StringLengthSort"
Exported 1;
Abstract 0;
Interface 0;
PackageName "";
Language "Java";
@begin UserFunction "compare(Object a, Object b)"
GencodeSrcLine 11;
FunctionName "StringLengthSort::compare(Object a, Object b)";
@end;
@begin UserFunction "Prototype for compare(Object a, Object b)"
Private 1;
GencodeSrcLine -1;
FunctionName "StringLengthSort::Prototype for compare(Object a, Object b)";
@end;
@begin HPPPrefixBlock
@begin-code HPPPrefix
// add your custom import statements here
import powersoft.jcm.util.*;
@end-code;
GencodeSrcLine 6;
@end;
@begin ClassContentsBlock
@begin-code ClassContents
// add your data members here
@end-code;
GencodeSrcLine 27;
@end;
@begin-code BaseClassList
extends Object implements CompareRoutine
@end-code;
@begin-code GeneratedClassContents
@end-code;
@begin-code Code "StringLengthSort::compare(Object a, Object b)"
//****************************
/*
* This class was created to implement a new compare
* routine for a SortableVector.
*
* compare method returns:
* a negative number if a < b
* zero if a == b
* a positive number if a > b
*/
public int compare(Object a, Object b)
//****************************
{
return ((String)a).length() - ((String)b).length();
}
@end-code;
@begin-code Code "StringLengthSort::Prototype for compare(Object a, Object b)"
public:
int compare(Object a, Object b);
@end-code;
@end;