/** * Creates and initializes three new <code>HashMap</code> objects that map the strings returned by * the SAX parser to <code>Integer</code> objects. The strings returned by the parser will match * the strings that are array elements in this <code>XmlReaderContentHandler</code> object's * <code>properties</code>, <code>colDef</code>, or <code>data</code> fields. For each array * element in these fields, there is a corresponding constant defined. It is to these constants * that the strings are mapped. In the <code>HashMap</code> objects, the string is the key, and * the integer is the value. * * <p>The purpose of the mapping is to make comparisons faster. Because comparing numbers is more * efficient than comparing strings, the strings returned by the parser are mapped to integers, * which can then be used in a <code>switch</code> statement. */ private void initMaps() { int items, i; propMap = new HashMap<>(); items = properties.length; for (i = 0; i < items; i++) { propMap.put(properties[i], Integer.valueOf(i)); } colDefMap = new HashMap<>(); items = colDef.length; for (i = 0; i < items; i++) { colDefMap.put(colDef[i], Integer.valueOf(i)); } dataMap = new HashMap<>(); items = data.length; for (i = 0; i < items; i++) { dataMap.put(data[i], Integer.valueOf(i)); } // Initialize connection map here typeMap = new HashMap<>(); }
GSSNameImpl(GSSManagerImpl gssManager, GSSNameSpi mechElement) { this.gssManager = gssManager; appNameStr = printableName = mechElement.toString(); appNameType = printableNameType = mechElement.getStringNameType(); this.mechElement = mechElement; elements = new HashMap<Oid, GSSNameSpi>(1); elements.put(mechElement.getMechanism(), this.mechElement); }
public static HashMap<ObjectName, DynamicMBean> getPlatformDynamicMBeans() { HashMap<ObjectName, DynamicMBean> map = new HashMap<>(); DiagnosticCommandMBean diagMBean = getDiagnosticCommandMBean(); if (diagMBean != null) { map.put(Util.newObjectName(HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME), diagMBean); } return map; }
TagData getTag(int sig) { TagData t = tags.get(sig); if (t == null) { byte[] tagData = LCMS.getTagNative(profile.getNativePtr(), sig); if (tagData != null) { t = new TagData(sig, tagData); tags.put(sig, t); } } return t; }
public synchronized GSSNameSpi getElement(Oid mechOid) throws GSSException { GSSNameSpi retVal = elements.get(mechOid); if (retVal == null) { if (appNameStr != null) { retVal = gssManager.getNameElement(appNameStr, appNameType, mechOid); } else { retVal = gssManager.getNameElement(appNameBytes, appNameType, mechOid); } elements.put(mechOid, retVal); } return retVal; }