org.cip4.jdflib.util
Class MyInteger

java.lang.Object
  extended by org.cip4.jdflib.util.MyInteger
All Implemented Interfaces:
Comparator<MyInteger>

public class MyInteger
extends Object
implements Comparator<MyInteger>

very simple and fast mutable integer class

Author:
Dr. Rainer Prosi, Heidelberger Druckmaschinen AG

Field Summary
 int i
          the int value of this
 
Constructor Summary
MyInteger(int _i)
           
 
Method Summary
 int compare(MyInteger o1, MyInteger o2)
           
 boolean equals(Object obj)
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

i

public int i
the int value of this

Constructor Detail

MyInteger

public MyInteger(int _i)
Parameters:
_i - the initial integer to set this to
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Returns:
the value of int as a string
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<MyInteger>
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

compare

public int compare(MyInteger o1,
                   MyInteger o2)
Specified by:
compare in interface Comparator<MyInteger>
Parameters:
o1 - the first MyInteger
o2 - the secondMyInteger
Returns:
o1-o2
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


Copyright © 2013. All Rights Reserved.