/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }
/** * Makes an instance for the given value. This may (but does not * necessarily) return an already-allocated instance. * * @param value the {@code int} value * @return {@code non-null;} the appropriate instance */ public static CstInteger make(int value) { /* * Note: No need to synchronize, since we don't make any sort * of guarantee about ==, and it's okay to overwrite existing * entries too. */ int idx = (value & 0x7fffffff) % cache.length; CstInteger obj = cache[idx]; if ((obj != null) && (obj.getValue() == value)) { return obj; } obj = new CstInteger(value); cache[idx] = obj; return obj; }