List of usage examples for java.util LinkedHashMap keySet
public Set<K> keySet()
From source file:com.amalto.workbench.utils.XSDAnnotationsStructure.java
public boolean getRetrieveFKinfos() { LinkedHashMap<String, String> appInfos = getAppInfos("X_Retrieve_FKinfos");//$NON-NLS-1$ Set<String> keys = appInfos.keySet(); for (Iterator<String> iter = keys.iterator(); iter.hasNext();) { String key = iter.next(); return "true".equals(appInfos.get(key));//$NON-NLS-1$ }/* w w w . ja v a 2 s . c o m*/ //Starting from 5.0 onwards, always resolve FKInfos by default if (log.isDebugEnabled()) { log.debug(Messages.XSDAnnotationsStructure_DebugInfo); } return true; }
From source file:com.amalto.workbench.utils.XSDAnnotationsStructure.java
public boolean setDescriptions(LinkedHashMap<String, String> descriptions) { boolean somethingChanged = false; Set<String> isoCodes = descriptions.keySet(); for (Iterator<String> iter = isoCodes.iterator(); iter.hasNext();) { String code = iter.next(); String description = descriptions.get(code); somethingChanged = somethingChanged | setDescription(code, description); }/*from www . ja v a2 s . c o m*/ hasChanged = hasChanged | somethingChanged; return somethingChanged; }
From source file:com.amalto.workbench.utils.XSDAnnotationsStructure.java
/**************************************************************************** * X_Deny_LogicalDelete/*from w w w. ja va 2 s . c om*/ ****************************************************************************/ public TreeMap<String, String> getDenyLogicalDelete() { TreeMap<String, String> writeAccesses = new TreeMap<String, String>(); LinkedHashMap<String, String> appInfos = getAppInfos("X_Deny_LogicalDelete");//$NON-NLS-1$ Set<String> keys = appInfos.keySet(); for (Iterator<String> iter = keys.iterator(); iter.hasNext();) { String key = iter.next(); writeAccesses.put(key, appInfos.get(key)); } return writeAccesses; }
From source file:com.amalto.workbench.utils.XSDAnnotationsStructure.java
/**************************************************************************** * X_Deny_PhysicalDelete//from w ww . j a va2s . c o m ****************************************************************************/ public TreeMap<String, String> getDenyPhysicalDelete() { TreeMap<String, String> writeAccesses = new TreeMap<String, String>(); LinkedHashMap<String, String> appInfos = getAppInfos("X_Deny_PhysicalDelete");//$NON-NLS-1$ Set<String> keys = appInfos.keySet(); for (Iterator<String> iter = keys.iterator(); iter.hasNext();) { String key = iter.next(); writeAccesses.put(key, appInfos.get(key)); } return writeAccesses; }
From source file:com.thingsee.tracker.MainActivity.java
private void loadTrackers() { Log.d("Tracker", "loadTrackers()"); new KiiQueryTrackersAsyncTask(new KiiQueryTrackersAsyncTask.AsyncResponseQueryTrackers() { @Override//w w w. j ava 2 s . c o m public void processFinish(LinkedHashMap<String, TrackerModel> trackers) { for (String key : trackers.keySet()) { TrackerModel trackerModel = trackers.get(key); addTracker(trackerModel); Log.d("Tracker", "added Tracker, key:" + key + " name:" + trackerModel.getName() + " token:" + trackerModel.getThing().getCurrentAccessToken()); } trackersLoaded = true; } }, CommonConstants.KII_CLOUD_APP_ID, CommonConstants.KII_CLOUD_APP_KEY, getCurrentAccountAccessToken()) .execute(); }
From source file:gate.util.reporting.PRTimeReporter.java
/** * Calculates the sub totals at each level. * * @param reportContainer//from w w w . ja va 2 s .c o m * An Object of type LinkedHashMap<String, Object> containing the * processing elements (with time in milliseconds) in hierarchical * structure. * * @return An Object containing modified hierarchical structure of processing * elements with totals and All others embedded in it. */ @SuppressWarnings("unchecked") @Override public Object calculate(Object reportContainer) { LinkedHashMap<String, Object> globalStore = (LinkedHashMap<String, Object>) reportContainer; Iterator<String> iter = globalStore.keySet().iterator(); int total = 0; while (iter.hasNext()) { String key = iter.next(); total = getTotal((LinkedHashMap<String, Object>) (globalStore.get(key))); globalTotal.put(key, Integer.toString(total)); } return globalStore; }
From source file:net.sf.maltcms.chromaui.normalization.spi.charts.PeakGroupBoxPlot.java
public List<JFreeChart> createChart() { List<JFreeChart> charts = new ArrayList<>(); LinkedHashSet<ITreatmentGroupDescriptor> treatmentGroups = new LinkedHashSet<>( project.getTreatmentGroups()); List<CategoryPlot> plots = new LinkedList<>(); for (IPeakGroupDescriptor pgd : pgdl) { LinkedHashMap<ITreatmentGroupDescriptor, HashSet<IPeakAnnotationDescriptor>> map = new LinkedHashMap<>(); for (ITreatmentGroupDescriptor itgd : treatmentGroups) { map.put(itgd, new LinkedHashSet<IPeakAnnotationDescriptor>()); }// ww w .j av a 2 s . c o m List<IPeakAnnotationDescriptor> descriptors = pgd.getPeakAnnotationDescriptors(); DefaultBoxAndWhiskerCategoryDataset baw = new DefaultBoxAndWhiskerCategoryDataset(); for (IPeakAnnotationDescriptor ipad : descriptors) { ITreatmentGroupDescriptor treatmentGroup = ipad.getChromatogramDescriptor().getTreatmentGroup(); HashSet<IPeakAnnotationDescriptor> descr = map.get(treatmentGroup); if (descr == null) { descr = new HashSet<>(); map.put(treatmentGroup, descr); } descr.add(ipad); } List<Color> colors = new LinkedList<>(); for (ITreatmentGroupDescriptor tgd : map.keySet()) { String name = getPeakName(pgd); baw.add(createBoxAndWhiskerItem(map.get(tgd)), tgd.getName() + " (" + map.get(tgd).size() + ")", name); colors.add(tgd.getColor()); } BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(true); renderer.setMeanVisible(false); renderer.setMedianVisible(true); renderer.setArtifactPaint(new Color(0, 0, 0, 128)); renderer.setMaximumBarWidth(0.1); renderer.setUseOutlinePaintForWhiskers(false); // renderer.setAutoPopulateSeriesFillPaint(true); // renderer.setAutoPopulateSeriesPaint(true); // renderer.setAutoPopulateSeriesOutlinePaint(true); CategoryPlot cp = new CategoryPlot(baw, new CategoryAxis("Treatment Groups"), new NumberAxis("Normalized Peak Area"), renderer); Logger.getLogger(getClass().getName()).log(Level.INFO, "Setting {0} colors!", colors.size()); ChartCustomizer.setSeriesColors(cp, 0.6f, colors); // ChartCustomizer.setSeriesColors(cp, 0.9f,colors); plots.add(cp); JFreeChart chart = new JFreeChart(cp); chart.setTitle( "Peak group " + pgd.getDisplayName() + " size: " + pgd.getPeakAnnotationDescriptors().size()); charts.add(chart); } // CategoryAxis ca = new CategoryAxis("Treatment Groups"); // NumberAxis va = new NumberAxis("Normalized Peak Area"); // CombinedDomainCategoryPlot cdcp = new CombinedDomainCategoryPlot(ca); // for (CategoryPlot cp : plots) { // cp.setRangeAxis(va); // cdcp.add(cp); // break; // } // return new JFreeChart(cdcp); return charts; }
From source file:net.sf.maltcms.chromaui.normalization.spi.charts.PeakGroupRtBoxPlot.java
public List<JFreeChart> createChart() { List<JFreeChart> charts = new ArrayList<>(); LinkedHashSet<ITreatmentGroupDescriptor> treatmentGroups = new LinkedHashSet<>( project.getTreatmentGroups()); List<CategoryPlot> plots = new LinkedList<>(); for (IPeakGroupDescriptor pgd : pgdl) { LinkedHashMap<ITreatmentGroupDescriptor, HashSet<IPeakAnnotationDescriptor>> map = new LinkedHashMap<>(); for (ITreatmentGroupDescriptor itgd : treatmentGroups) { map.put(itgd, new LinkedHashSet<IPeakAnnotationDescriptor>()); }/*ww w . ja v a2 s . c om*/ List<IPeakAnnotationDescriptor> descriptors = pgd.getPeakAnnotationDescriptors(); DefaultBoxAndWhiskerCategoryDataset baw = new DefaultBoxAndWhiskerCategoryDataset(); for (IPeakAnnotationDescriptor ipad : descriptors) { ITreatmentGroupDescriptor treatmentGroup = ipad.getChromatogramDescriptor().getTreatmentGroup(); HashSet<IPeakAnnotationDescriptor> descr = map.get(treatmentGroup); if (descr == null) { descr = new HashSet<>(); map.put(treatmentGroup, descr); } descr.add(ipad); } List<Color> colors = new LinkedList<>(); for (ITreatmentGroupDescriptor tgd : map.keySet()) { String name = getPeakName(pgd); baw.add(createBoxAndWhiskerItem(map.get(tgd)), tgd.getName() + " (" + map.get(tgd).size() + ")", name); colors.add(tgd.getColor()); } BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(true); renderer.setMeanVisible(false); renderer.setMedianVisible(true); renderer.setArtifactPaint(new Color(0, 0, 0, 128)); renderer.setMaximumBarWidth(0.1); renderer.setUseOutlinePaintForWhiskers(false); // renderer.setAutoPopulateSeriesFillPaint(true); // renderer.setAutoPopulateSeriesPaint(true); // renderer.setAutoPopulateSeriesOutlinePaint(true); NumberAxis yAxis = new NumberAxis("Peak Apex Retention Time"); yAxis.setAutoRange(true); yAxis.setAutoRangeIncludesZero(false); CategoryPlot cp = new CategoryPlot(baw, new CategoryAxis("Treatment Groups"), yAxis, renderer); Logger.getLogger(getClass().getName()).log(Level.INFO, "Setting {0} colors!", colors.size()); ChartCustomizer.setSeriesColors(cp, 0.6f, colors); // ChartCustomizer.setSeriesColors(cp, 0.9f,colors); plots.add(cp); JFreeChart chart = new JFreeChart(cp); chart.setTitle( "Peak group " + pgd.getDisplayName() + " size: " + pgd.getPeakAnnotationDescriptors().size()); charts.add(chart); } // CategoryAxis ca = new CategoryAxis("Treatment Groups"); // NumberAxis va = new NumberAxis("Normalized Peak Area"); // CombinedDomainCategoryPlot cdcp = new CombinedDomainCategoryPlot(ca); // for (CategoryPlot cp : plots) { // cp.setRangeAxis(va); // cdcp.add(cp); // break; // } // return new JFreeChart(cdcp); return charts; }
From source file:com.concursive.connect.web.modules.members.portlets.InviteMembersPortlet.java
/** * @param request// w w w. j ava 2 s . c o m */ private boolean buildMatches(ActionRequest request) throws SQLException { Connection db = PortalUtils.useConnection(request); String[] membersToInvite = request.getParameter(MEMBERS_TO_INVITE).split(","); LinkedHashMap<String, String> members = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> membersPresent = new LinkedHashMap<String, String>(); boolean hasMultipleMatches = false; for (String member : membersToInvite) { members.put(member.trim(), NO_MATCH_FOUND); } //1. Profile Id based Query Iterator<String> keyIterator = members.keySet().iterator(); while (keyIterator.hasNext()) { String profileId = keyIterator.next(); if (members.get(profileId).equals(NO_MATCH_FOUND) && profileId.contains("(")) { // Find user by unique profileId String[] arrNameProfile = profileId.split("\\("); int endIndex = arrNameProfile[1].indexOf(")") < 0 ? arrNameProfile[1].length() : arrNameProfile[1].indexOf(")"); arrNameProfile[1] = arrNameProfile[1].substring(0, endIndex); Project project = ProjectUtils.loadProject(arrNameProfile[1]); if (project == null) { continue; } int userId = project.getOwner(); if (userId > -1) { members = updateMemberList(request, profileId, String.valueOf(userId), members, membersPresent); } } } //2. Email based Query keyIterator = members.keySet().iterator(); while (keyIterator.hasNext()) { String email = keyIterator.next(); if (members.get(email).equals(NO_MATCH_FOUND) && email.contains("@")) { // Find user by email address String strEmail = email.trim(); HashMap<String, String> mapEmail = DimDimUtils.processEmail(strEmail); strEmail = StringUtils.hasText(mapEmail.get(DimDimUtils.EMAIL)) ? mapEmail.get(DimDimUtils.EMAIL) : strEmail; int userId = User.getIdByEmailAddress(db, strEmail); if (userId > -1) { members = updateMemberList(request, email, String.valueOf(userId), members, membersPresent); } } } //3. Name based Query based on first and last name //for the items that did not match in 1.get the names (i.e., first and last names) only (i.e., filter out the emails) //Fetch from users by matching first name and last name if more than one character exists in the last name keyIterator = members.keySet().iterator(); while (keyIterator.hasNext()) { String name = keyIterator.next(); if (members.get(name).equals(NO_MATCH_FOUND) && !name.contains("@")) { String[] nameParts = name.split(" "); UserList userList = new UserList(); if (nameParts.length == 1) { //search first and last name fields UserSearchBean userSearch = new UserSearchBean(); userSearch.setName(nameParts[0]); userList.setSearchCriteria(userSearch); } else if (nameParts.length == 2) { userList.setFirstName(nameParts[0]); userList.setLastName(nameParts[1]); } userList.buildList(db); if (userList.size() > 0) { if (userList.size() > 1) { hasMultipleMatches = true; } StringBuffer idStringBuffer = new StringBuffer(); for (User user : userList) { idStringBuffer.append("," + user.getId()); } members = updateMemberList(request, name, idStringBuffer.toString().substring(1), members, membersPresent); } } } request.getPortletSession().setAttribute(MEMBERS, members); request.getPortletSession().setAttribute(HAS_MULTIPLE_MATCHES, String.valueOf(hasMultipleMatches)); request.getPortletSession().setAttribute(MEMBERS_PRESENT, membersPresent); return members.isEmpty(); }
From source file:gate.util.reporting.DocTimeReporter.java
/** * Computes the sub totals at each processing level. * * @param reportContainer/*from ww w . j a v a 2s .c om*/ * An Object of type LinkedHashMap<String, Object> containing the * processing elements (with time in milliseconds) in hierarchical * structure. * @return An Object containing the LinkedHashMap with the element values * totaled. */ @SuppressWarnings("unchecked") private LinkedHashMap<String, String> doTotal(LinkedHashMap<String, Object> reportContainer) { LinkedHashMap<String, Object> myHash = reportContainer; Iterator<String> i = myHash.keySet().iterator(); while (i.hasNext()) { String key = i.next(); if (myHash.get(key) instanceof LinkedHashMap) { docContainer = doTotal((LinkedHashMap<String, Object>) (myHash.get(key))); } else { if (docContainer.get(key) == null) { docContainer.put(key, (String) myHash.get(key)); } else { // Do total if value already exists int val = Integer.parseInt(docContainer.get(key)) + Integer.parseInt((String) myHash.get(key)); docContainer.put(key, Integer.toString(val)); } } } return docContainer; }