private static int asInt(Object obj){
		if(obj == null){
			return 0;
		}else if(obj instanceof Number){
			return ((Number)obj).intValue();
		}else if(obj instanceof Character){
			return ((Character)obj).charValue();
		}else if(obj instanceof Boolean){
			return ((Boolean)obj).booleanValue()?1:0;
		}else if(obj instanceof String){
			try{
				return Integer.parseInt((String)obj);
			}catch(NumberFormatException e){}
		}
		return 0;
	}