1 21 package com.db4o; 22 23 24 29 public class PrimitiveIntHandler extends YInt{ 30 31 public PrimitiveIntHandler(YapStream stream) { 32 super(stream); 33 } 34 35 public YapComparable prepareComparison(Object obj) { 36 _currentInteger = ((Integer )obj); 37 _currentInt = _currentInteger.intValue(); 38 return this; 39 } 40 41 private Integer _currentInteger; 42 43 private int _currentInt; 44 45 public int compareTo(Object obj) { 46 return val(obj) - _currentInt; 47 } 48 49 public Object current() { 50 return _currentInteger; 51 } 52 53 public boolean isEqual(Object obj) { 54 return val(obj) == _currentInt; 55 } 56 57 public boolean isGreater(Object obj) { 58 return val(obj) > _currentInt; 59 } 60 61 public boolean isSmaller(Object obj) { 62 return val(obj) < _currentInt; 63 } 64 65 } 66 | Popular Tags |