21 package org.matsim.core.utils.misc;
23 import org.apache.logging.log4j.LogManager;
24 import org.apache.logging.log4j.Logger;
38 private static Integer []
cache;
46 if ( i < MAX_VALUE && i >= MIN_VALUE) {
50 return Integer.valueOf(i);
53 synchronized private static void init() {
55 log.warn(
"IntegerCache has already been initialized.");
59 log.info(
"Initializing IntegerCache ...");
60 cache =
new Integer [MAX_VALUE -
MIN_VALUE];
61 for (
int i = 0; i < (MAX_VALUE -
MIN_VALUE); i++) {
62 cache[i] = Integer.valueOf(i - MIN_VALUE);
static final int MAX_VALUE
static Integer getInteger(final int i)
synchronized static void init()
static final int MIN_VALUE
static boolean initialized