examples/STComparator.st
branchdirectory_structure_refactoring
changeset 1818 2e5ed72e7dfd
parent 1636 9aa37657e198
child 2069 75d40b7b986f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/STComparator.st	Thu Nov 15 22:10:02 2012 +0000
@@ -0,0 +1,46 @@
+"{ Package: 'stx:libjava/examples' }"
+
+Object subclass:#STComparator
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Languages-Java-Examples'
+!
+
+
+!STComparator class methodsFor:'initialization'!
+
+initialize
+
+    self lookupObject: JavaLookup instance
+
+    "Created: / 13-05-2012 / 17:24:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!STComparator methodsFor:'comparing'!
+
+compare: o1 and: o2
+    ^ o1 = o2 ifTrue:[ 
+        0 
+    ] ifFalse: [
+        o1 < o2 ifTrue:[
+            -1
+        ] ifFalse:[
+            1
+        ]            
+    ]
+
+    "
+        STComparator new compare: 1 and: 1
+    "
+
+    "Created: / 21-08-2012 / 10:44:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!STComparator class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id::                                                                                                                        $'
+! !
+
+STComparator initialize!