List of usage examples for java.util LinkedHashMap containsKey
boolean containsKey(Object key);
From source file:de.roderick.weberknecht.WebSocketHandshake.java
public byte[] getHandshake() { String path = url.getPath();//w ww . j a va 2 s . c om String host = url.getHost(); if (url.getPort() != -1) { host += ":" + url.getPort(); } LinkedHashMap<String, String> header = new LinkedHashMap<String, String>(); if (this.extraHeaders != null) { for (String fieldName : this.extraHeaders.keySet()) { // Only checks for Field names with the exact same text, // but according to RFC 2616 (HTTP) field names are case-insensitive. if (!header.containsKey(fieldName)) { header.put(fieldName, this.extraHeaders.get(fieldName)); } } } header.put("Host", host); header.put("Upgrade", "websocket"); header.put("Connection", "Upgrade"); header.put("Sec-WebSocket-Version", String.valueOf(WebSocket.getVersion())); header.put("Sec-WebSocket-Key", this.nonce); if (this.protocol != null) { header.put("Sec-WebSocket-Protocol", this.protocol); } String handshake = "GET " + path + " HTTP/1.1\r\n"; handshake += this.generateHeader(header); handshake += "\r\n"; byte[] handshakeBytes = new byte[handshake.getBytes().length]; System.arraycopy(handshake.getBytes(), 0, handshakeBytes, 0, handshake.getBytes().length); return handshakeBytes; }
From source file:marytts.modules.ModuleRegistry.java
/** * Lookup a list of modules for the given combination of type, locale and voice. * A given lookup will return a list of modules accepting the datatype as input, * ordered by specificity so that the most specific modules come first. * For each output type produced by modules, there will be only one module * producing that type, namely the most specific one found. * Specificity is ordered as follows:/*from w ww . j a v a2 s. c o m*/ * 1. most specific is the full combination of datatype, locale and voice; * 2. the combination of datatype, language-only locale and voice (i.e., for requested locale "en-US" will find modules with locale "en"); * 3. the combination of datatype and locale, ignoring voice; * 4. the combination of datatype and language-only locale, ignoring voice; * 5. least specific is the datatype, ignoring locale and voice. * @param type the type of input data * @param locale the locale * @param voice the voice to use. * @return a list of mary modules accepting the datatype and suitable for * the given locale and voice, ordered by their specificity, * or an empty list if there is no suitable module. * @throws IllegalStateException if called when registration is not yet complete. */ @SuppressWarnings("unchecked") private static List<MaryModule> get(MaryDataType type, Locale locale, Voice voice) throws IllegalStateException { if (!registrationComplete) throw new IllegalStateException("Cannot inquire about modules while registration is ongoing"); LinkedHashMap<MaryDataType, MaryModule> results = new LinkedHashMap<MaryDataType, MaryModule>(); // First, get all results: List<List<MaryModule>> listOfLists = new LinkedList<List<MaryModule>>(); listOfLists.add((List<MaryModule>) mkm.get(type, locale, voice)); Locale langOnly = locale != null ? new Locale(locale.getLanguage()) : null; boolean haveCountry = langOnly == null ? false : !langOnly.equals(locale); if (haveCountry) { listOfLists.add((List<MaryModule>) mkm.get(type, langOnly, voice)); } listOfLists.add((List<MaryModule>) mkm.get(type, locale, null)); if (haveCountry) { listOfLists.add((List<MaryModule>) mkm.get(type, langOnly, null)); } listOfLists.add((List<MaryModule>) mkm.get(type, null, null)); // Now, for each mary output type, keep only the most specific module, // and return the list ordered by the specificity of modules (most specific first): for (List<MaryModule> list : listOfLists) { if (list != null) { for (MaryModule m : list) { if (!results.containsKey(m.outputType())) results.put(m.outputType(), m); } } } List<MaryModule> returnList = new LinkedList<MaryModule>(); for (MaryDataType t : results.keySet()) { returnList.add(results.get(t)); } return returnList; }
From source file:com.opengamma.analytics.financial.interestrate.MultipleYieldCurveFinderDataBundle.java
/** * Create a MultipleYieldCurveFinderDataBundle where the number of nodes and the list of curve names correspond to all the curves (known curves and curves still to be calibrated). * This constructor is used to compute the extended Jacobian matrix when curves are calibrated in several blocks. * @param derivatives The list of instruments used in the calibration. * @param marketValues The market value of the instruments. * @param knownCurves The curves already calibrated. * @param unknownCurveNodePoints The node points of the new curves to calibrate. * @param unknownCurveInterpolators The interpolators of the new curves to calibrate. * @param useFiniteDifferenceByDefault Flag for using the finite difference computation of the Jacobian. * @param fxMatrix The FX Matrix with the required exchange rates. * @return The data bundle.//www . ja va 2 s . c o m */ public static MultipleYieldCurveFinderDataBundle withAllCurves(final List<InstrumentDerivative> derivatives, final double[] marketValues, final YieldCurveBundle knownCurves, final LinkedHashMap<String, double[]> unknownCurveNodePoints, final LinkedHashMap<String, Interpolator1D> unknownCurveInterpolators, final boolean useFiniteDifferenceByDefault, final FXMatrix fxMatrix) { // Argument checker: start ArgumentChecker.notNull(derivatives, "derivatives"); ArgumentChecker.noNulls(derivatives, "derivatives"); ArgumentChecker.notNull(marketValues, "market values null"); ArgumentChecker.notNull(unknownCurveNodePoints, "unknown curve node points"); ArgumentChecker.notNull(unknownCurveInterpolators, "unknown curve interpolators"); ArgumentChecker.notEmpty(unknownCurveNodePoints, "unknown curve node points"); ArgumentChecker.notEmpty(unknownCurveInterpolators, "unknown curve interpolators"); ArgumentChecker.isTrue(derivatives.size() == marketValues.length, "marketValues wrong length; must be one par rate per derivative (have {} values for {} derivatives", marketValues.length, derivatives.size()); ArgumentChecker.notNull(fxMatrix, "FX matrix"); if (knownCurves != null) { for (final String name : knownCurves.getAllNames()) { if (unknownCurveInterpolators.containsKey(name)) { throw new IllegalArgumentException("Curve name in known set matches one to be solved for"); } } } if (unknownCurveNodePoints.size() != unknownCurveInterpolators.size()) { throw new IllegalArgumentException("Number of unknown curves not the same as curve interpolators"); } // Argument checker: end int nbNodes = 0; if (knownCurves != null) { for (final String name : knownCurves.getAllNames()) { nbNodes += knownCurves.getCurve(name).getNumberOfParameters(); } } for (final double[] nodes : unknownCurveNodePoints.values()) { // Nodes from new curves nbNodes += nodes.length; } final List<String> names = new ArrayList<>(); if (knownCurves != null) { names.addAll(knownCurves.getAllNames()); // Names from existing curves } final Iterator<Entry<String, double[]>> nodePointsIterator = unknownCurveNodePoints.entrySet().iterator(); final Iterator<Entry<String, Interpolator1D>> unknownCurvesIterator = unknownCurveInterpolators.entrySet() .iterator(); while (nodePointsIterator.hasNext()) { // Names from new curves final Entry<String, double[]> entry1 = nodePointsIterator.next(); final Entry<String, Interpolator1D> entry2 = unknownCurvesIterator.next(); final String name1 = entry1.getKey(); if (!name1.equals(entry2.getKey())) { throw new IllegalArgumentException("Names must be the same"); } ArgumentChecker.notNull(entry1.getValue(), "curve node points for " + name1); ArgumentChecker.notNull(entry2.getValue(), "interpolator for " + name1); names.add(name1); } return new MultipleYieldCurveFinderDataBundle(derivatives, marketValues, knownCurves, unknownCurveNodePoints, unknownCurveInterpolators, useFiniteDifferenceByDefault, fxMatrix, nbNodes, names); }
From source file:org.opencb.opencga.storage.core.metadata.StudyConfiguration.java
public static LinkedHashMap<String, Integer> getReturnedSamplesPosition(StudyConfiguration studyConfiguration, LinkedHashSet<String> returnedSamples, Function<StudyConfiguration, BiMap<String, Integer>> getIndexedSamplesPosition) { LinkedHashMap<String, Integer> samplesPosition; if (returnedSamples == null || returnedSamples.isEmpty()) { BiMap<Integer, String> unorderedSamplesPosition = getIndexedSamplesPosition(studyConfiguration) .inverse();//from w ww . ja v a2s . c o m samplesPosition = new LinkedHashMap<>(unorderedSamplesPosition.size()); for (int i = 0; i < unorderedSamplesPosition.size(); i++) { samplesPosition.put(unorderedSamplesPosition.get(i), i); } } else { samplesPosition = new LinkedHashMap<>(returnedSamples.size()); int index = 0; BiMap<String, Integer> indexedSamplesId = getIndexedSamplesPosition.apply(studyConfiguration); for (String returnedSample : returnedSamples) { if (!returnedSample.isEmpty() && StringUtils.isNumeric(returnedSample)) { returnedSample = studyConfiguration.getSampleIds().inverse() .get(Integer.parseInt(returnedSample)); } if (!samplesPosition.containsKey(returnedSample)) { if (indexedSamplesId.containsKey(returnedSample)) { samplesPosition.put(returnedSample, index++); } } } // for (String sample : indexedSamplesId.keySet()) { // samplesPosition.put(sample, index++); // } } return samplesPosition; }
From source file:com.opengamma.analytics.financial.curve.sensitivity.ParameterSensitivity.java
/** * Create a copy of the sensitivity and add a given sensitivity to it. * @param other The sensitivity to add./* w ww .j av a 2 s .c o m*/ * @return The total sensitivity. */ public ParameterSensitivity plus(final ParameterSensitivity other) { ArgumentChecker.notNull(other, "Sensitivity to add"); final MatrixAlgebra algebra = MatrixAlgebraFactory.COMMONS_ALGEBRA; final LinkedHashMap<Pair<String, Currency>, DoubleMatrix1D> result = new LinkedHashMap<Pair<String, Currency>, DoubleMatrix1D>(); result.putAll(_sensitivity); for (final Map.Entry<Pair<String, Currency>, DoubleMatrix1D> entry : other.getSensitivities().entrySet()) { final Pair<String, Currency> nameCcy = entry.getKey(); if (result.containsKey(nameCcy)) { result.put(nameCcy, (DoubleMatrix1D) algebra.add(result.get(nameCcy), entry.getValue())); } else { result.put(nameCcy, entry.getValue()); } } return new ParameterSensitivity(result); }
From source file:cm.confide.ex.chips.BaseRecipientAdapter.java
private static void putOneEntry(TemporaryEntry entry, boolean isAggregatedEntry, LinkedHashMap<Long, List<RecipientEntry>> entryMap, List<RecipientEntry> nonAggregatedEntries, Set<String> existingDestinations) { if (existingDestinations.contains(entry.destination)) { return;/* w ww. j a v a 2s. c om*/ } existingDestinations.add(entry.destination); if (!isAggregatedEntry) { nonAggregatedEntries.add(RecipientEntry.constructTopLevelEntry(entry.displayName, entry.displayNameSource, entry.destination, entry.destinationType, entry.destinationLabel, entry.contactId, entry.dataId, entry.thumbnailUriString, true, entry.isGalContact)); } else if (entryMap.containsKey(entry.contactId)) { // We already have a section for the person. final List<RecipientEntry> entryList = entryMap.get(entry.contactId); entryList.add(RecipientEntry.constructSecondLevelEntry(entry.displayName, entry.displayNameSource, entry.destination, entry.destinationType, entry.destinationLabel, entry.contactId, entry.dataId, entry.thumbnailUriString, true, entry.isGalContact)); } else { final List<RecipientEntry> entryList = new ArrayList<RecipientEntry>(); entryList.add(RecipientEntry.constructTopLevelEntry(entry.displayName, entry.displayNameSource, entry.destination, entry.destinationType, entry.destinationLabel, entry.contactId, entry.dataId, entry.thumbnailUriString, true, entry.isGalContact)); entryMap.put(entry.contactId, entryList); } }
From source file:com.opengamma.analytics.financial.provider.sensitivity.multicurve.MultipleCurrencyParameterSensitivity.java
/** * Create a copy of the sensitivity and add a given sensitivity to it. * @param other The sensitivity to add.//from ww w . j a v a 2s.c o m * @return The total sensitivity. */ public MultipleCurrencyParameterSensitivity plus(final MultipleCurrencyParameterSensitivity other) { ArgumentChecker.notNull(other, "Sensitivity to add"); final MatrixAlgebra algebra = MatrixAlgebraFactory.COMMONS_ALGEBRA; final LinkedHashMap<Pair<String, Currency>, DoubleMatrix1D> result = new LinkedHashMap<>(); result.putAll(_sensitivity); for (final Map.Entry<Pair<String, Currency>, DoubleMatrix1D> entry : other.getSensitivities().entrySet()) { final Pair<String, Currency> nameCcy = entry.getKey(); if (result.containsKey(nameCcy)) { result.put(nameCcy, (DoubleMatrix1D) algebra.add(result.get(nameCcy), entry.getValue())); } else { result.put(nameCcy, entry.getValue()); } } return new MultipleCurrencyParameterSensitivity(result); }
From source file:com.espertech.esper.regression.support.PatternTestHarness.java
private int countExpectedEvents(String eventId) { int result = 0; for (EventExpressionCase descriptor : caseList.getResults()) { LinkedHashMap<String, LinkedList<EventDescriptor>> allExpectedResults = descriptor.getExpectedResults(); // If nothing at all was expected for this event, make sure nothing was received if (allExpectedResults.containsKey(eventId)) { result++;//from www .j a v a2s . c o m } } return result; }
From source file:org.kles.m3.service.M3ConnectorBuilderService.java
@Override protected Task<Void> createTask() { return new Task<Void>() { @Override// w w w .jav a 2s . c o m protected Void call() throws MAKException, InterruptedException { beginTime = System.currentTimeMillis(); updateMessage("Initialisation des donnes de " + m3Connector.getEnv().getName()); m3Connector.getMapEntityByConfiguration().entrySet().stream() .forEach((Map.Entry<M3ConfigurationInfo, M3ConfigurationDetail> key) -> { if (key.getKey().getName().equals(m3Connector.getMainConfig().getName()) && !m3Connector.getMainConfig().getName().equals("MVX")) { ArrayList<M3ClassPathEntry> l = new ArrayList<>(); for (Map.Entry<String, M3Component> component : key.getValue().getListComponent() .entrySet()) { if (m3Connector.getListComponentSelect().contains(component.getValue()) && !component.getValue().getNameComponent().equals("MVX")) { l.addAll(component.getValue().getListComponentPath()); } } key.getValue().setConfigClassPath(l); } else { key.getValue().setConfigClassPath(key.getValue().getCompleteClassPath()); } ArrayList<Path> arrayPath = new ArrayList<>(); ProcessFile fileProcessor = new ProcessFile(); fileProcessor.setExtFilter(".class"); for (M3ClassPathEntry cl1 : key.getValue().getConfigClassPath()) { try { if (new File(cl1.getPath().toOSString()).exists()) { updateMessage("Recherche d'objets dans " + cl1.getPath().toOSString()); Files.walkFileTree(Paths.get(cl1.getPath().toString()), fileProcessor); } } catch (IOException ex) { Logger.getLogger(Process.class.getName()).log(Level.SEVERE, null, ex); } arrayPath.addAll(fileProcessor.getList()); } int cpt = 0; for (Path p : arrayPath) { updateMessage("Traitement des objets de " + p.toString()); LinkedHashMap<String, SourceObject> entity = key.getValue().getMapEntity() .get(M3Utils.getPgmType(p.toFile().getAbsolutePath())); if (entity != null) { String name = FilenameUtils.getBaseName(p.toString()); if (!entity.containsKey(name)) { if (M3Utils.getPgmType(p.toFile().getAbsolutePath()).equals(Resource.DB) && name.contains("$")) { continue; } SourceObject obj = new SourceObject(); obj.setObjectPath(p); entity.put(name, obj); cpt++; } } } updateMessage(cpt + " objets trouvs appartenant la configuration " + key.getKey().getName() + "(" + key.getKey().getName() + ")"); }); updateMessage("Fin de la recherche d'objet"); Thread.sleep(2000); return null; /*beginTime = System.currentTimeMillis(); updateMessage("Initialisation des donnes"); m3Connector.getMapEntityByConfiguration().entrySet().stream().forEach((key) -> { ArrayList<Path> arrayPath = new ArrayList<>(); ProcessFile fileProcessor = new ProcessFile(); fileProcessor.setExtFilter(".class"); for (M3ClassPathEntry cl1 : key.getValue().getConfigClassPath()) { try { if (new File(cl1.getPath().toOSString()).exists()) { updateMessage("Recherche d'objets dans " + cl1.getPath().toOSString()); Files.walkFileTree(Paths.get(cl1.getPath().toString()), fileProcessor); } } catch (IOException ex) { Logger.getLogger(Process.class.getName()).log(Level.SEVERE, null, ex); } arrayPath.addAll(fileProcessor.getList()); } int cpt = 0; for (Path p : arrayPath) { updateMessage("Traitement des objets de " + p.toString()); LinkedHashMap<String, SourceObject> entity = key.getValue().getMapEntity().get(M3Utils.getPgmType(p.toFile().getAbsolutePath())); if (entity != null) { String name = FilenameUtils.getBaseName(p.toString()); if (!entity.containsKey(name)) { if (M3Utils.getPgmType(p.toFile().getAbsolutePath()).equals(Resource.DB) && name.contains("$")) { continue; } SourceObject obj = new SourceObject(); obj.setObjectPath(p); entity.put(name, obj); cpt++; } } } updateMessage(cpt + " objets trouvs appartenant la configuration " + key.getKey().getName() + "(" + key.getKey().getName() + ")"); }); updateMessage("Fin de la recherche d'objet"); Thread.sleep(2000); return null;*/ } }; }
From source file:com.allinfinance.startup.init.MenuInfoUtil.java
/** * ???/*from w w w .j ava2s . c om*/ * @param degree */ @SuppressWarnings("unchecked") public static LinkedHashMap<String, Object> setOperatorMenuWithDegree(String degree, String contextPath) { String sql = "select VALUE_ID FROM TBL_ROLE_FUNC_MAP ,TBL_ROLE_INF WHERE ROLE_ID = KEY_ID and KEY_ID = " + degree; ICommQueryDAO commQueryDAO = (ICommQueryDAO) ContextUtil.getBean("CommQueryDAO"); List<Object> funcMapList = commQueryDAO.findBySQLQuery(sql); List<Object> menuLvl1List = allMenuBean.getDataList(); LinkedHashMap<String, Object> menuIndexMap = new LinkedHashMap<String, Object>(); //????? for (int i = 0, n = menuLvl1List.size(); i < n; i++) { Map<String, Object> menuLvl1Map = (Map<String, Object>) menuLvl1List.get(i); LinkedList<Object> menuLvl2List = (LinkedList<Object>) menuLvl1Map.get(Constants.MENU_CHILDREN); for (int j = 0, m = menuLvl2List.size(); j < m; j++) { Map<String, Object> menuLvl2Map = (Map<String, Object>) menuLvl2List.get(j); LinkedList<Object> menuLvl3List = (LinkedList<Object>) menuLvl2Map.get(Constants.MENU_CHILDREN); for (int k = 0, l = menuLvl3List.size(); k < l; k++) { Map<String, Object> menuLvl3Map = (Map<String, Object>) menuLvl3List.get(k); for (int a = 0, b = funcMapList.size(); a < b; a++) { if (StringUtils.trim(funcMapList.get(a).toString()) .equals(StringUtils.trim(menuLvl3Map.get(Constants.MENU_ID).toString()))) { if (!menuIndexMap.containsKey(menuLvl1Map.get(Constants.MENU_ID).toString())) { Map<String, Object> menuLvl1HashMap = new LinkedHashMap<String, Object>(); menuLvl1HashMap.put(Constants.MENU_ID, menuLvl1Map.get(Constants.MENU_ID)); menuLvl1HashMap.put(Constants.MENU_TEXT, menuLvl1Map.get(Constants.MENU_TEXT)); menuLvl1HashMap.put(Constants.MENU_CLS, menuLvl1Map.get(Constants.MENU_CLS)); menuLvl1HashMap.put(Constants.MENU_HANDLER, Constants.MENU_LVL1_FUNC); menuLvl1HashMap.put(Constants.TOOL_BAR_TYPE, Constants.TOOL_BAR_BUTTON); menuLvl1HashMap.put(Constants.TOOLBAR_ICON, Constants.TOOLBAR_ICON_MENU); Map<String, Object> menuLvl2HashMap = new LinkedHashMap<String, Object>(); menuLvl2HashMap.put(Constants.MENU_ID, menuLvl2Map.get(Constants.MENU_ID)); menuLvl2HashMap.put(Constants.MENU_TEXT, menuLvl2Map.get(Constants.MENU_TEXT)); menuLvl2HashMap.put(Constants.MENU_PARENT_ID, menuLvl2Map.get(Constants.MENU_PARENT_ID)); menuLvl2HashMap.put(Constants.MENU_CLS, menuLvl2Map.get(Constants.MENU_CLS)); // menuLvl2HashMap.put(Constants.TOOLBAR_ICON, Constants.TOOLBAR_ICON_MENUITEM); // menuLvl2HashMap.put(Constants.TOOLBAR_ICON, menuLvl2Map.get(Constants.TOOLBAR_ICON)); Map<String, Object> menuLvl3HashMap = new LinkedHashMap<String, Object>(); menuLvl3HashMap.put(Constants.MENU_ID, menuLvl3Map.get(Constants.MENU_ID)); menuLvl3HashMap.put(Constants.MENU_TEXT, menuLvl3Map.get(Constants.MENU_TEXT)); menuLvl3HashMap.put(Constants.MENU_PARENT_ID, menuLvl3Map.get(Constants.MENU_PARENT_ID)); menuLvl3HashMap.put(Constants.MENU_LEAF, true); menuLvl3HashMap.put(Constants.MENU_URL, contextPath + menuLvl3Map.get(Constants.MENU_URL)); menuLvl3HashMap.put(Constants.MENU_CLS, menuLvl3Map.get(Constants.MENU_CLS)); menuLvl3HashMap.put(Constants.MENU_HANDLER, Constants.MENU_LVL3_FUNC); //menuLvl3HashMap.put(Constants.TOOLBAR_ICON, Constants.TOOLBAR_ICON_MENUITEM); menuLvl3HashMap.put(Constants.TOOLBAR_ICON, menuLvl3Map.get(Constants.TOOLBAR_ICON)); LinkedList<Object> menuLvl3Child = new LinkedList<Object>(); menuLvl3Child.add(menuLvl3HashMap); menuLvl2HashMap.put(Constants.MENU_CHILDREN, menuLvl3Child); menuLvl2HashMap.put(Constants.TOOL_BAR_CHILDREN, menuLvl3Child); LinkedList<Object> menuLvl2Child = new LinkedList<Object>(); menuLvl2Child.add(menuLvl2HashMap); menuLvl1HashMap.put(Constants.MENU_CHILDREN, menuLvl2Child); menuLvl1HashMap.put(Constants.TOOL_BAR_CHILDREN, menuLvl2Child); menuIndexMap.put(menuLvl1Map.get(Constants.MENU_ID).toString(), menuLvl1HashMap); } else { Map<String, Object> menuLvl1HashMap = (Map<String, Object>) menuIndexMap .get(menuLvl1Map.get(Constants.MENU_ID).toString()); LinkedList<Object> menuLvl2Child = (LinkedList<Object>) menuLvl1HashMap .get(Constants.MENU_CHILDREN); boolean hasMenu = false; for (int c = 0, d = menuLvl2Child.size(); c < d; c++) { Map<String, Object> menuLvl2HashMap = (Map<String, Object>) menuLvl2Child .get(c); if (StringUtils.trim(menuLvl2HashMap.get(Constants.MENU_ID).toString()).equals( StringUtils.trim(menuLvl2Map.get(Constants.MENU_ID).toString()))) { LinkedList<Object> menuLvl3Child = (LinkedList<Object>) menuLvl2HashMap .get(Constants.MENU_CHILDREN); Map<String, Object> menuLvl3HashMap = new LinkedHashMap<String, Object>(); menuLvl3HashMap.put(Constants.MENU_ID, menuLvl3Map.get(Constants.MENU_ID)); menuLvl3HashMap.put(Constants.MENU_TEXT, menuLvl3Map.get(Constants.MENU_TEXT)); menuLvl3HashMap.put(Constants.MENU_PARENT_ID, menuLvl3Map.get(Constants.MENU_PARENT_ID)); menuLvl3HashMap.put(Constants.MENU_LEAF, true); menuLvl3HashMap.put(Constants.MENU_URL, contextPath + menuLvl3Map.get(Constants.MENU_URL)); menuLvl3HashMap.put(Constants.MENU_CLS, menuLvl3Map.get(Constants.MENU_CLS)); menuLvl3HashMap.put(Constants.MENU_HANDLER, Constants.MENU_LVL3_FUNC); //menuLvl3HashMap.put(Constants.TOOLBAR_ICON, Constants.TOOLBAR_ICON_MENUITEM); menuLvl3HashMap.put(Constants.TOOLBAR_ICON, menuLvl3Map.get(Constants.TOOLBAR_ICON)); menuLvl3Child.add(menuLvl3HashMap); menuLvl2HashMap.put(Constants.MENU_CHILDREN, menuLvl3Child); menuLvl2HashMap.put(Constants.TOOL_BAR_CHILDREN, menuLvl3Child); menuLvl2Child.set(c, menuLvl2HashMap); hasMenu = true; break; } } if (!hasMenu) { Map<String, Object> menuLvl2HashMap = new HashMap<String, Object>(); menuLvl2HashMap.put(Constants.MENU_ID, menuLvl2Map.get(Constants.MENU_ID)); menuLvl2HashMap.put(Constants.MENU_TEXT, menuLvl2Map.get(Constants.MENU_TEXT)); menuLvl2HashMap.put(Constants.MENU_PARENT_ID, menuLvl2Map.get(Constants.MENU_PARENT_ID)); menuLvl2HashMap.put(Constants.MENU_CLS, menuLvl2Map.get(Constants.MENU_CLS)); // menuLvl2HashMap.put(Constants.TOOLBAR_ICON, Constants.TOOLBAR_ICON_MENUITEM); // menuLvl2HashMap.put(Constants.TOOLBAR_ICON, menuLvl2Map.get(Constants.TOOLBAR_ICON)); LinkedList<Object> menuLvl3Child = new LinkedList<Object>(); Map<String, Object> menuLvl3HashMap = new LinkedHashMap<String, Object>(); menuLvl3HashMap.put(Constants.MENU_ID, menuLvl3Map.get(Constants.MENU_ID)); menuLvl3HashMap.put(Constants.MENU_TEXT, menuLvl3Map.get(Constants.MENU_TEXT)); menuLvl3HashMap.put(Constants.MENU_PARENT_ID, menuLvl3Map.get(Constants.MENU_PARENT_ID)); menuLvl3HashMap.put(Constants.MENU_LEAF, true); menuLvl3HashMap.put(Constants.MENU_URL, contextPath + menuLvl3Map.get(Constants.MENU_URL)); menuLvl3HashMap.put(Constants.MENU_CLS, menuLvl3Map.get(Constants.MENU_CLS)); menuLvl3HashMap.put(Constants.MENU_HANDLER, Constants.MENU_LVL3_FUNC); //menuLvl3HashMap.put(Constants.TOOLBAR_ICON, Constants.TOOLBAR_ICON_MENUITEM); menuLvl3HashMap.put(Constants.TOOLBAR_ICON, menuLvl3Map.get(Constants.TOOLBAR_ICON)); menuLvl3Child.add(menuLvl3HashMap); menuLvl2HashMap.put(Constants.MENU_CHILDREN, menuLvl3Child); menuLvl2HashMap.put(Constants.TOOL_BAR_CHILDREN, menuLvl3Child); menuLvl2Child.add(menuLvl2HashMap); } menuLvl1HashMap.put(Constants.MENU_CHILDREN, menuLvl2Child); menuLvl1HashMap.put(Constants.TOOL_BAR_CHILDREN, menuLvl2Child); menuIndexMap.put(menuLvl1Map.get(Constants.MENU_ID).toString(), menuLvl1HashMap); } } } } } } return menuIndexMap; }