package sig.modules.utils; import java.util.Arrays; import sig.TextUtils; public class SemiValidInteger { final public static int ERROR_VALUE = Integer.MIN_VALUE; String[] values; int bossHP=Integer.MAX_VALUE; boolean initialized=true; int trustedslot = -1; public SemiValidInteger(String[] vals) { this.values = vals; ConvertNegativeValues(vals); } public SemiValidInteger(String[] vals, Integer bossHP, boolean initialized) { this.bossHP=bossHP; this.values=vals; this.initialized=initialized; ConvertNegativeValues(vals); } public SemiValidInteger(String[] vals, Integer bossHP, boolean initialized, int trustedslot) { this.bossHP=bossHP; this.values=vals; this.initialized=initialized; this.trustedslot=trustedslot; ConvertNegativeValues(vals); } private void ConvertNegativeValues(String[] vals) { for (int i=0;iInteger.MAX_VALUE) { System.out.println("Double: "+d+" Val:"+vals[i]); vals[i] = Integer.toString((int)(d-((double)Integer.MAX_VALUE*2))-2); } } } System.out.print("Test values: "+Arrays.toString(vals)); } public int getValidInteger() { if (initialized && trustedslot!=-1) { if (TextUtils.isNumeric(values[trustedslot]) && TextUtils.isInteger(values[trustedslot], 10) && values[trustedslot].length()