001 package railo.commons.lang.types; 002 003 /** 004 * Integer Type that can be modified 005 */ 006 public class RefIntegerImpl implements RefInteger { 007 008 private int value; 009 010 /** 011 * @param value 012 */ 013 public RefIntegerImpl(int value) { 014 this.value=value; 015 } 016 public RefIntegerImpl() { 017 } 018 019 /** 020 * @param value 021 */ 022 public void setValue(int value) { 023 this.value = value; 024 } 025 026 /** 027 * operation plus 028 * @param value 029 */ 030 public void plus(int value) { 031 this.value+=value; 032 } 033 034 /** 035 * operation minus 036 * @param value 037 */ 038 public void minus(int value) { 039 this.value-=value; 040 } 041 042 /** 043 * @return returns value as integer 044 */ 045 public Integer toInteger() { 046 return Integer.valueOf(value); 047 } 048 /** 049 * @return returns value as integer 050 */ 051 public Double toDouble() { 052 return new Double(value); 053 } 054 055 056 /** 057 * @see railo.commons.lang.types.RefInteger#toDoubleValue() 058 */ 059 public double toDoubleValue() { 060 return value; 061 } 062 063 /** 064 * @see railo.commons.lang.types.RefInteger#toInt() 065 */ 066 public int toInt() { 067 return value; 068 } 069 070 071 /** 072 * @see java.lang.Object#toString() 073 */ 074 public String toString() { 075 return String.valueOf(value); 076 } 077 }