List of usage examples for java.util LinkedHashMap keySet
public Set<K> keySet()
From source file:ubic.gemma.visualization.ExperimentalDesignVisualizationServiceImpl.java
/** * @param layout/* w w w. j a v a2 s . co m*/ * @param skipBatchFactors don't return the 'batch' factor if there is one. * @return */ private Collection<ExperimentalFactor> extractFactors( LinkedHashMap<BioAssayValueObject, LinkedHashMap<ExperimentalFactor, Double>> layout, boolean skipBatchFactors) { Collection<ExperimentalFactor> factors = new HashSet<ExperimentalFactor>(); for (BioAssayValueObject bioAssay : layout.keySet()) { if (layout.get(bioAssay) != null && layout.get(bioAssay).keySet() != null) { for (ExperimentalFactor ef : layout.get(bioAssay).keySet()) { factors.add(ef); if (skipBatchFactors && ExperimentalDesignUtils.isBatch(ef)) { layout.get(bioAssay).remove(ef); break; } } } } return factors; }
From source file:com.opengamma.analytics.financial.interestrate.capletstripping.CapletStrippingJacobian.java
public CapletStrippingJacobian(final List<CapFloor> caps, final YieldCurveBundle yieldCurves, final LinkedHashMap<String, double[]> knotPoints, final LinkedHashMap<String, Interpolator1D> interpolators, final LinkedHashMap<String, ParameterLimitsTransform> parameterTransforms, final LinkedHashMap<String, InterpolatedDoublesCurve> knownParameterTermSturctures) { Validate.notNull(caps, "caps null"); Validate.notNull(knotPoints, "null node points"); Validate.notNull(interpolators, "null interpolators"); Validate.isTrue(knotPoints.size() == interpolators.size(), "size mismatch between nodes and interpolators"); _knownParameterTermSturctures = knownParameterTermSturctures; final LinkedHashMap<String, Interpolator1D> transInterpolators = new LinkedHashMap<>(); final Set<String> names = interpolators.keySet(); _parameterNames = names;/*from ww w . j a v a 2 s . c o m*/ for (final String name : names) { final Interpolator1D temp = new TransformedInterpolator1D(interpolators.get(name), parameterTransforms.get(name)); transInterpolators.put(name, temp); } _capPricers = new ArrayList<>(caps.size()); for (final CapFloor cap : caps) { _capPricers.add(new CapFloorPricer(cap, yieldCurves)); } _interpolators = transInterpolators; _curveBuilder = new InterpolatedCurveBuildingFunction(knotPoints, transInterpolators); _dataBundleBuilder = new Interpolator1DDataBundleBuilderFunction(knotPoints, transInterpolators); }
From source file:de.ingrid.importer.udk.strategy.v2.IDCStrategy2_3_0.java
/** * @param defaultEntry pass key of default entry or < 0 if no default entry ! * @throws Exception/*from ww w . j a v a 2 s . co m*/ */ private void writeNewSyslist(int listId, LinkedHashMap<Integer, String> syslistMap_de, LinkedHashMap<Integer, String> syslistMap_en, int defaultEntry) throws Exception { // clean up, to guarantee no old values ! sqlStr = "DELETE FROM sys_list where lst_id = " + listId; jdbc.executeUpdate(sqlStr); Iterator<Integer> itr = syslistMap_de.keySet().iterator(); while (itr.hasNext()) { int key = itr.next(); String isDefault = "N"; if (key == defaultEntry) { isDefault = "Y"; } // german version jdbc.executeUpdate( "INSERT INTO sys_list (id, lst_id, entry_id, lang_id, name, maintainable, is_default) VALUES (" + getNextId() + ", " + listId + ", " + key + ", 'de', '" + syslistMap_de.get(key) + "', 0, '" + isDefault + "')"); // english version jdbc.executeUpdate( "INSERT INTO sys_list (id, lst_id, entry_id, lang_id, name, maintainable, is_default) VALUES (" + getNextId() + ", " + listId + ", " + key + ", 'en', '" + syslistMap_en.get(key) + "', 0, '" + isDefault + "')"); } }
From source file:com.concursive.connect.web.modules.members.portlets.InviteMembersPortlet.java
private void checkDuplicates(LinkedHashMap<String, String> members, String member, String userId) { Iterator<String> memIterator = members.keySet().iterator(); while (memIterator.hasNext()) { String keyName = memIterator.next(); String idValue = members.get(keyName); //check only previous values and not entire list if (keyName.equals(member)) { return; }/*ww w .j av a 2s . c om*/ //check if valid ids if (NO_MATCH_FOUND.equals(idValue) || !StringUtils.hasText(idValue)) { continue; } //convert comma separated string to ArrayList and remove duplicates ArrayList<String> lstIds = new ArrayList<String>(Arrays.asList(idValue.split(","))); while (lstIds.contains(userId)) { lstIds.remove(userId); } //convert the id list to comma separated string and assign it to members list if there ids remaining if (!lstIds.isEmpty()) { String ids = lstIds.toString(); ids = ids.replace("[", ""); ids = ids.replace("]", ""); ids = ids.replace(" ", ""); members.put(keyName, ids); } else { memIterator.remove(); } } }
From source file:org.openmeetings.app.data.user.Organisationmanagement.java
/** * //from w w w. j a v a 2 s.c o m * @param user_id * @param usersToStore * @return * @throws Exception */ private boolean checkUserShouldBeStored(Long user_id, @SuppressWarnings("rawtypes") LinkedHashMap usersToStore) throws Exception { for (Iterator<?> it2 = usersToStore.keySet().iterator(); it2.hasNext();) { Integer key = (Integer) it2.next(); Long usersIdToCheck = Long.valueOf(usersToStore.get(key).toString()).longValue(); log.debug("usersIdToCheck: " + usersIdToCheck); if (user_id.equals(usersIdToCheck)) { return true; } } return false; }
From source file:com.amalto.workbench.dialogs.AddBrowseItemsWizard.java
private TreeObject createNewTreeObject(XSDElementDeclaration decl, String browseItem) { WSView view = new WSView(); view.setIsTransformerActive(new WSBoolean(false)); view.setTransformerPK("");//$NON-NLS-1$ view.setName(browseItem);/* w ww.j a v a 2 s. c o m*/ EList<XSDIdentityConstraintDefinition> idtylist = decl.getIdentityConstraintDefinitions(); List<String> keys = new ArrayList<String>(); for (XSDIdentityConstraintDefinition idty : idtylist) { EList<XSDXPathDefinition> xpathList = idty.getFields(); for (XSDXPathDefinition path : xpathList) { String key = decl.getName(); // remove key = key.replaceFirst("#.*", "");//$NON-NLS-1$//$NON-NLS-2$ key += "/" + path.getValue();//$NON-NLS-1$ keys.add(key); } } view.getSearchableBusinessElements().addAll(keys); view.getViewableBusinessElements().addAll(keys); StringBuffer desc = new StringBuffer(); LinkedHashMap<String, String> labels = new LinkedHashMap<String, String>(); if (decl.getAnnotation() != null) { labels = new XSDAnnotationsStructure(decl.getAnnotation()).getLabels(); } if (labels.size() == 0) { labels.put("EN", decl.getName());//$NON-NLS-1$ } for (String lan : labels.keySet()) { desc.append("[" + lan.toUpperCase() + ":" + labels.get(lan) + "]");//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ } view.setDescription(desc.toString()); WSPutView wrap = new WSPutView(); wrap.setWsView(view); WSViewPK viewPk = new WSViewPK(); viewPk.setPk(browseItem); WSDeleteView delView = new WSDeleteView(); delView.setWsViewPK(viewPk); WSGetView getView = new WSGetView(); getView.setWsViewPK(viewPk); service.putView(wrap); // add node in the root TreeParent root = page.getXObject().getServerRoot(); TreeObject obj = new TreeObject(browseItem, root, TreeObject.VIEW, viewPk, null // no storage to save // space ); return obj; }
From source file:eu.hydrologis.jgrass.charting.datamodels.MultiXYTimeChartCreator.java
/** * Make a composite with the plot of the supplied chartdata. There are several HINT* variables * that can be set to tweak and configure the plot. * //from w w w . j a v a 2s .c o m * @param parentComposite * @param chartData */ public void makePlot(Composite parentComposite, NumericChartData chartData) { final int tabNums = chartData.getTabItemNumbers(); if (tabNums == 0) { return; } Shell dummyShell = null; // try { // dummyShell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); // } catch (Exception e) { dummyShell = new Shell(Display.getCurrent(), SWT.None); // } /* * wrapping panel needed in the case of hide checks */ TabFolder tabFolder = null; if (tabNums > 1) { tabFolder = new TabFolder(parentComposite, SWT.BORDER); tabFolder.setLayout(new GridLayout()); tabFolder.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL)); } for (int i = 0; i < tabNums; i++) { NumericChartDataItem chartItem = chartData.getChartDataItem(i); int chartNums = chartItem.chartSeriesData.size(); /* * are there data to create the lower chart panel */ List<LinkedHashMap<String, Integer>> series = new ArrayList<LinkedHashMap<String, Integer>>(); List<XYPlot> plots = new ArrayList<XYPlot>(); List<JFreeChart> charts = new ArrayList<JFreeChart>(); for (int j = 0; j < chartNums; j++) { final LinkedHashMap<String, Integer> chartSeries = new LinkedHashMap<String, Integer>(); XYPlot chartPlot = null; JGrassChart chart = null; double[][][] cLD = chartItem.chartSeriesData.get(j); if (M_HINT_CREATE_CHART[i][j]) { final String[] cT = chartItem.seriesNames.get(j); final String title = chartItem.chartTitles.get(j); final String xT = chartItem.chartXLabels.get(j); final String yT = chartItem.chartYLabels.get(j); if (M_HINT_CHART_TYPE[i][j] == XYLINECHART) { chart = new JGrassXYLineChart(cT, cLD); } else if (M_HINT_CHART_TYPE[i][j] == XYBARCHART) { chart = new JGrassXYBarChart(cT, cLD, HINT_barwidth); } else if (M_HINT_CHART_TYPE[i][j] == TIMEYLINECHART) { chart = new JGrassXYTimeLineChart(cT, cLD, Minute.class); ((JGrassXYTimeLineChart) chart).setTimeAxisFormat(TIMEFORMAT); } else if (M_HINT_CHART_TYPE[i][j] == TIMEYBARCHART) { chart = new JGrassXYTimeBarChart(cT, cLD, Minute.class, HINT_barwidth); ((JGrassXYTimeBarChart) chart).setTimeAxisFormat(TIMEFORMAT); } else if (M_HINT_CHART_TYPE[i][j] == XYPOINTCHART) { chart = new JGrassXYLineChart(cT, cLD); ((JGrassXYLineChart) chart).toggleLineShapesDisplay(false, true); } else if (M_HINT_CHART_TYPE[i][j] == TIMEXYPOINTCHART) { chart = new JGrassXYTimeLineChart(cT, cLD, Minute.class); ((JGrassXYTimeLineChart) chart).setTimeAxisFormat(TIMEFORMAT); ((JGrassXYTimeLineChart) chart).toggleLineShapesDisplay(false, true); } else { chart = new JGrassXYLineChart(cT, cLD); } final Composite p1Composite = new Composite(dummyShell, SWT.None); p1Composite.setLayout(new FillLayout()); p1Composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); chart.makeChartPanel(p1Composite, title, xT, yT, null, true, true, true, true); chartPlot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = chartPlot.getRenderer(); chartPlot.setDomainGridlinesVisible(HINT_doDomainGridVisible); chartPlot.setRangeGridlinesVisible(HINT_doRangeGridVisible); if (HINT_doDisplayToolTips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (!M_HINT_CHARTORIENTATION_UP[i][j]) { chartPlot.getRangeAxis().setInverted(true); } if (M_HINT_CHARTSERIESCOLOR != null) { final XYItemRenderer rend = renderer; for (int k = 0; k < cLD.length; k++) { rend.setSeriesPaint(k, M_HINT_CHARTSERIESCOLOR[i][j][k]); } } chart.toggleFilledShapeDisplay(HINT_doDisplayBaseShapes, HINT_doFillBaseShapes, true); for (int k = 0; k < cT.length; k++) { chartSeries.put(cT[k], k); } series.add(chartSeries); chartPlot.setNoDataMessage("No data available"); chartPlot.setNoDataMessagePaint(Color.red); plots.add(chartPlot); charts.add(chart.getChart(title, xT, yT, null, true, HINT_doDisplayToolTips, true)); chartsList.add(chart); /* * add annotations? */ if (chartItem.annotationsOnChart.size() > 0) { LinkedHashMap<String, double[]> annotations = chartItem.annotationsOnChart.get(j); if (annotations.size() > 0) { Set<String> keys = annotations.keySet(); for (String key : keys) { double[] c = annotations.get(key); XYPointerAnnotation ann = new XYPointerAnnotation(key, c[0], c[1], HINT_AnnotationArrowAngle); ann.setTextAnchor(HINT_AnnotationTextAncor); ann.setPaint(HINT_AnnotationTextColor); ann.setArrowPaint(HINT_AnnotationArrowColor); // ann.setArrowLength(15); renderer.addAnnotation(ann); // Marker currentEnd = new ValueMarker(c[0]); // currentEnd.setPaint(Color.red); // currentEnd.setLabel(""); // currentEnd.setLabelAnchor(RectangleAnchor.TOP_RIGHT); // currentEnd.setLabelTextAnchor(TextAnchor.TOP_LEFT); // chartPlot.addDomainMarker(currentEnd); // Drawable cd = new LineDrawer(Color.red, new BasicStroke(1.0f)); // XYAnnotation bestBid = new XYDrawableAnnotation(c[0], c[1]/2.0, // 0, c[1], // cd); // chartPlot.addAnnotation(bestBid); // pointer.setFont(new Font("SansSerif", Font.PLAIN, 9)); } } } } } JFreeChart theChart = null; if (plots.size() > 1) { ValueAxis domainAxis = null; if (M_HINT_CHART_TYPE[i][0] == ChartCreator.TIMEYBARCHART || M_HINT_CHART_TYPE[i][0] == ChartCreator.TIMEYLINECHART) { domainAxis = (plots.get(0)).getDomainAxis(); } else { domainAxis = new NumberAxis(chartItem.chartXLabels.get(0)); } final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(domainAxis); plot.setGap(10.0); // add the subplots... for (int k = 0; k < plots.size(); k++) { XYPlot tmpPlot = plots.get(k); if (HINT_labelInsets != null) { tmpPlot.getRangeAxis().setLabelInsets(HINT_labelInsets); } plot.add(tmpPlot, k + 1); } plot.setOrientation(PlotOrientation.VERTICAL); theChart = new JFreeChart(chartItem.bigTitle, JFreeChart.DEFAULT_TITLE_FONT, plot, true); } else if (plots.size() == 1) { theChart = new JFreeChart(chartItem.chartTitles.get(0), JFreeChart.DEFAULT_TITLE_FONT, plots.get(0), true); } else { return; } /* * create the chart composite */ Composite tmp; if (tabNums > 1 && tabFolder != null) { tmp = new Composite(tabFolder, SWT.None); } else { tmp = new Composite(parentComposite, SWT.None); } tmp.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL)); tmp.setLayout(new GridLayout()); final ChartComposite frame = new ChartComposite(tmp, SWT.None, theChart, 680, 420, 300, 200, 700, 500, false, true, // properties true, // save true, // print true, // zoom true // tooltips ); // public static final boolean DEFAULT_BUFFER_USED = false; // public static final int DEFAULT_WIDTH = 680; // public static final int DEFAULT_HEIGHT = 420; // public static final int DEFAULT_MINIMUM_DRAW_WIDTH = 300; // public static final int DEFAULT_MINIMUM_DRAW_HEIGHT = 200; // public static final int DEFAULT_MAXIMUM_DRAW_WIDTH = 800; // public static final int DEFAULT_MAXIMUM_DRAW_HEIGHT = 600; // public static final int DEFAULT_ZOOM_TRIGGER_DISTANCE = 10; frame.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL)); frame.setLayout(new FillLayout()); frame.setDisplayToolTips(HINT_doDisplayToolTips); frame.setHorizontalAxisTrace(HINT_doHorizontalAxisTrace); frame.setVerticalAxisTrace(HINT_doVerticalAxisTrace); frame.setDomainZoomable(HINT_doDomainZoomable); frame.setRangeZoomable(HINT_doRangeZoomable); if (tabNums > 1 && tabFolder != null) { final TabItem item = new TabItem(tabFolder, SWT.NONE); item.setText(chartData.getChartDataItem(i).chartStringExtra); item.setControl(tmp); } /* * create the hide toggling part */ for (int j = 0; j < plots.size(); j++) { if (M_HINT_CREATE_TOGGLEHIDESERIES[i][j]) { final LinkedHashMap<Button, Integer> allButtons = new LinkedHashMap<Button, Integer>(); Group checksComposite = new Group(tmp, SWT.None); checksComposite.setText(""); RowLayout rowLayout = new RowLayout(); rowLayout.wrap = true; rowLayout.type = SWT.HORIZONTAL; checksComposite.setLayout(rowLayout); checksComposite .setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); final XYItemRenderer renderer = plots.get(j).getRenderer(); Set<String> lTitles = series.get(j).keySet(); for (final String title : lTitles) { final Button b = new Button(checksComposite, SWT.CHECK); b.setText(title); b.setSelection(true); final int index = series.get(j).get(title); b.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { boolean visible = renderer.getItemVisible(index, 0); renderer.setSeriesVisible(index, new Boolean(!visible)); } }); allButtons.put(b, index); } /* * toggle all and none */ if (HINT_doToggleTuttiButton) { Composite allchecksComposite = new Composite(tmp, SWT.None); RowLayout allrowLayout = new RowLayout(); allrowLayout.wrap = true; allrowLayout.type = SWT.HORIZONTAL; allchecksComposite.setLayout(allrowLayout); allchecksComposite .setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); final Button tuttiButton = new Button(allchecksComposite, SWT.BORDER | SWT.PUSH); tuttiButton.setText("Tutti"); tuttiButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { Set<Button> set = allButtons.keySet(); for (Button button : set) { button.setSelection(true); int i = allButtons.get(button); if (renderer != null) { renderer.setSeriesVisible(i, new Boolean(true)); } } } }); final Button noneButton = new Button(allchecksComposite, SWT.BORDER | SWT.PUSH); noneButton.setText("Nessuno"); noneButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { Set<Button> set = allButtons.keySet(); for (Button button : set) { button.setSelection(false); int i = allButtons.get(button); if (renderer != null) { renderer.setSeriesVisible(i, new Boolean(false)); } } } }); } } } } }
From source file:com.zimbra.cs.db.SQLite.java
@Override public void registerDatabaseInterest(DbConnection conn, String dbname) throws SQLException, ServiceException { LinkedHashMap<String, String> attachedDBs = getAttachedDatabases(conn); if (attachedDBs != null && attachedDBs.containsKey(dbname)) return;/* www . jav a2 s. c om*/ // if we're using more databases than we're allowed to, detach the least recently used if (attachedDBs != null && attachedDBs.size() >= MAX_ATTACHED_DATABASES) { for (Iterator<String> it = attachedDBs.keySet().iterator(); attachedDBs.size() >= MAX_ATTACHED_DATABASES && it.hasNext();) { String name = it.next(); if (!name.equals("zimbra") && detachDatabase(conn, name)) it.remove(); } } attachDatabase(conn, dbname); }
From source file:com.google.gwt.emultest.java.util.LinkedHashMapTest.java
public void testKeySet() { LinkedHashMap<String, String> hashMap = new LinkedHashMap<String, String>(); checkEmptyLinkedHashMapAssumptions(hashMap); Set<String> keySet = hashMap.keySet(); assertNotNull(keySet);/*from ww w. j av a2 s. c o m*/ assertTrue(keySet.isEmpty()); assertTrue(keySet.size() == 0); hashMap.put(KEY_TEST_KEY_SET, VALUE_TEST_KEY_SET); assertEquals(SIZE_ONE, keySet.size()); assertTrue(keySet.contains(KEY_TEST_KEY_SET)); assertFalse(keySet.contains(VALUE_TEST_KEY_SET)); assertFalse(keySet.contains(KEY_TEST_KEY_SET.toUpperCase(Locale.ROOT))); }
From source file:com.atinternet.tracker.Builder.java
/** * Build the hit/*from www . ja v a 2s.c om*/ */ Object[] build() { ArrayList<String> prepareHitsList = new ArrayList<String>(); ArrayList<String> hitsList = new ArrayList<String>(); Integer countSplitHits = 1; int indexError = -1; String queryString = ""; String idClient = ""; String configuration = buildConfiguration(); // Calcul pour connaitre la longueur maximum du hit String oltParameter = Tool.getTimeStamp().execute(); int MAX_LENGTH_AVAILABLE = HIT_MAX_LENGTH - (configuration.length() + oltParameter.length() + MH_PARAMETER_MAX_LENGTH); LinkedHashMap<String, Object[]> dictionary = new LinkedHashMap<String, Object[]>(); if (!TextUtils.isEmpty(configuration)) { dictionary = prepareQuery(); Set<String> keySet = dictionary.keySet(); // Outerloop est un label de rfrence si jamais une boucle doit tre interrompue outerloop: for (String parameterKey : keySet) { Param p = (Param) dictionary.get(parameterKey)[0]; String value = String.valueOf(dictionary.get(parameterKey)[1]); // Rcupration de l'idclient pour viter les redirections if (parameterKey.equals(Hit.HitParam.UserId.stringValue())) { idClient = value; MAX_LENGTH_AVAILABLE -= idClient.length(); } // Si la valeur du paramtre est trop grande if (value.length() > MAX_LENGTH_AVAILABLE) { // Si le paramtre est dcoupable if (Lists.getSliceReadyParams().contains(parameterKey)) { // Rcupration du sparateur, de la cl et la valeur du paramtre courant String separator = p.getOptions() != null ? p.getOptions().getSeparator() : ","; String[] currentParameterString = value.split("="); String currentKey = currentParameterString[0] + "="; String currentValue = currentParameterString[1]; // On dcoupe la valeur du paramtre sur son sparateur String[] valuesList = currentValue.split(separator); for (int i = 0; i < valuesList.length; i++) { String currentSplitValue = valuesList[i]; // Si la valeur courante est trop grande if (currentSplitValue.length() > MAX_LENGTH_AVAILABLE) { // Erreur : Valeur trop longue non dcoupable indexError = countSplitHits; queryString += currentKey; int currentMaxLength = MAX_LENGTH_AVAILABLE - (MHERR_PARAMETER_LENGTH + queryString.length()); // On cherche la position du dernier % afin d'viter les exceptions au moment de la dcoupe brutale String splitError = currentSplitValue.substring(0, currentMaxLength); int lastIndexOfPercent = splitError.lastIndexOf(PERCENT_VALUE); if ((lastIndexOfPercent > currentMaxLength - 5) && (lastIndexOfPercent < currentMaxLength)) { queryString += splitError.substring(0, lastIndexOfPercent); } else { queryString += splitError; } Tool.executeCallback(tracker.getListener(), CallbackType.warning, "Multihits: Param " + parameterKey + " value still too long after slicing"); // On retourne l'endroit du code o se trouve outerloop break outerloop; } // Sinon si le hit dj construit + la valeur courante est trop grand else if (queryString.length() + currentSplitValue.length() > MAX_LENGTH_AVAILABLE) { // On cr un nouveau tronon countSplitHits++; prepareHitsList.add(queryString); queryString = idClient + currentKey + (i == 0 ? currentSplitValue : separator + currentSplitValue); } // Sinon, on continue la construction normalement else { queryString += i == 0 ? currentKey + currentSplitValue : separator + currentSplitValue; } } } else { // Erreur : le paramtre n'est pas dcoupable indexError = countSplitHits; Tool.executeCallback(tracker.getListener(), CallbackType.warning, "Multihits: parameter " + parameterKey + " value not allowed to be sliced"); break; } } // Sinon, si le hit est trop grand, on le dcoupe entre deux paramtres else if (queryString.length() + value.length() > MAX_LENGTH_AVAILABLE) { countSplitHits++; prepareHitsList.add(queryString); queryString = idClient + value; } //Sinon, on ne dcoupe pas else { queryString += value; } } // Si un seul hit est construit if (countSplitHits == 1) { if (indexError == countSplitHits) { hitsList.add(configuration + makeSubQuery("mherr", "1") + queryString); } else { hitsList.add(configuration + queryString); } } // Sinon, si le nombre de tronons > 999, erreur else if (countSplitHits > HIT_MAX_COUNT) { hitsList.add(configuration + makeSubQuery("mherr", "1") + queryString); Tool.executeCallback(tracker.getListener(), CallbackType.warning, "Multihits: too much hit parts"); } // Sinon, on ajoute les hits construits la liste de hits envoyer else { prepareHitsList.add(queryString); String mhID = mhIdSuffixGenerator(); for (int i = 0; i < countSplitHits; i++) { String countSplitHitsString = countSplitHits.toString(); String mhParameter = makeSubQuery("mh", String.format(MH_PARAMETER_FORMAT, Tool.formatNumberLength(Integer.toString(i + 1), countSplitHitsString.length()), countSplitHitsString, mhID)); if (indexError == (i + 1)) { hitsList.add( configuration + mhParameter + makeSubQuery("mherr", "1") + prepareHitsList.get(i)); } else { hitsList.add(configuration + mhParameter + prepareHitsList.get(i)); } } } if (tracker.getListener() != null) { String message = ""; for (String hit : hitsList) { message += hit + "\n"; } Tool.executeCallback(tracker.getListener(), CallbackType.build, message, TrackerListener.HitStatus.Success); } } return new Object[] { hitsList, oltParameter }; }