examples/STComparator.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 19 Jan 2013 23:19:12 +0000
branchrefactoring-vmdata
changeset 1985 7c5a14d663ba
parent 1818 2e5ed72e7dfd
child 2069 75d40b7b986f
permissions -rw-r--r--
Temporary commit. JavaNativeMethod refactored to use new-style native methods. Java VM does not boot at this point.

"{ 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!