@Override public int getInt(int id) { if (isOpen()) { return _getInt(id); } else { return 0; } }
/** * Returns the value of the specified statistic descriptor. */ private Number _get(StatisticDescriptorImpl stat) { switch (stat.getTypeCode()) { case StatisticDescriptorImpl.INT: return Integer.valueOf(_getInt(stat.getId())); case StatisticDescriptorImpl.LONG: return Long.valueOf(_getLong(stat.getId())); case StatisticDescriptorImpl.DOUBLE: return Double.valueOf(_getDouble(stat.getId())); default: throw new RuntimeException( String.format("unexpected stat descriptor type code: %s", Byte.valueOf(stat.getTypeCode()))); } }
/** * Returns the bits that represent the raw value of the specified statistic descriptor. */ private long _getRawBits(StatisticDescriptorImpl stat) { switch (stat.getTypeCode()) { case StatisticDescriptorImpl.INT: return _getInt(stat.getId()); case StatisticDescriptorImpl.LONG: return _getLong(stat.getId()); case StatisticDescriptorImpl.DOUBLE: return Double.doubleToRawLongBits(_getDouble(stat.getId())); default: throw new RuntimeException( String.format("unexpected stat descriptor type code: %s", Byte.valueOf(stat.getTypeCode()))); } }