List of usage examples for java.lang Integer MIN_VALUE
int MIN_VALUE
To view the source code for java.lang Integer MIN_VALUE.
Click Source Link
From source file:simx.profiler.info.application.ActorsInfoTopComponent.java
public ActorsInfoTopComponent() { initComponents();//from ww w.j a v a2 s . c o m setName(Bundle.CTL_ActorsInfoTopComponent()); setToolTipText(Bundle.HINT_ActorsInfoTopComponent()); this.content = new InstanceContent(); this.associateLookup(new AbstractLookup(this.content)); this.profilingData = ProfilingData.getLoadedProfilingData(); final Map<MessageType, Integer> applicationCommunicationDataLocal = new HashMap<>(); this.profilingData.getMessageTypes().stream().forEach((messageType) -> { applicationCommunicationDataLocal.put(messageType, messageType.getTimesSent()); }); this.applicationCommunicationData = new CommunicationData(new ImmutableTupel<>(null, null), applicationCommunicationDataLocal); this.content.set(Collections.singleton(this.applicationCommunicationData), null); this.actorTypes = this.profilingData.getActorTypes(); this.actorTypeInformationTable.setModel(new ActorTypeInformationTableModel(this.profilingData)); ListSelectionModel listSelectionModel = this.actorTypeInformationTable.getSelectionModel(); listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listSelectionModel.addListSelectionListener((final ListSelectionEvent e) -> { setSelectedActorType(actorTypes.get(actorTypeInformationTable.getSelectedRow())); }); this.actorInstances = profilingData.getActorInstances(); listSelectionModel = this.actorInstanceInformationTable.getSelectionModel(); listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listSelectionModel.addListSelectionListener((ListSelectionEvent e) -> { final ActorInstance actorInstance = actorInstances.get(actorInstanceInformationTable.getSelectedRow()); setSelectedActorInstance(actorInstance); }); this.actorInstanceInformationTable.setModel(new ActorInstanceInformationTableModel(this.profilingData)); long minProcessingTime = Long.MAX_VALUE; long maxProcessingTime = Long.MIN_VALUE; for (final ActorType type : this.actorTypes) { if (type.getOverallProcessingTime() < minProcessingTime) minProcessingTime = type.getOverallProcessingTime(); if (type.getOverallProcessingTime() > maxProcessingTime) maxProcessingTime = type.getOverallProcessingTime(); } final Map<ImmutableTupel<ActorType, ActorType>, Integer> typeCommunicationScaleFactors = new HashMap<>(); int minMessagesCount = Integer.MAX_VALUE; int maxMessagesCount = Integer.MIN_VALUE; for (final ActorType actorType : this.actorTypes) { final Map<ActorType, Map<MessageType, Integer>> s = actorType.getReceiverStatistics(); for (final Map.Entry<ActorType, Map<MessageType, Integer>> e : s.entrySet()) { int count = 0; count = e.getValue().entrySet().stream().map((d) -> d.getValue()).reduce(count, Integer::sum); typeCommunicationScaleFactors.put(new ImmutableTupel<>(actorType, e.getKey()), count); if (count < minMessagesCount) minMessagesCount = count; if (count > maxMessagesCount) maxMessagesCount = count; } } int messagesSpan = maxMessagesCount - minMessagesCount; for (final Map.Entry<ImmutableTupel<ActorType, ActorType>, Integer> e : typeCommunicationScaleFactors .entrySet()) { final int factor = (((e.getValue() - minMessagesCount) * 4) / messagesSpan) + 1; typeCommunicationScaleFactors.put(e.getKey(), factor); } double timeSpan = maxProcessingTime - minProcessingTime; final Map<ActorType, Double> typeComputationScaleFactors = new HashMap<>(); for (final ActorType type : this.actorTypes) { typeComputationScaleFactors.put(type, ((double) (type.getOverallProcessingTime() - minProcessingTime) * 0.4 / timeSpan) + 0.6); } final ActorTypeGraphScene actorTypeGraphScene = new ActorTypeGraphScene(this, typeComputationScaleFactors, typeCommunicationScaleFactors); actorTypeGraphScene.addObjectSceneListener(new ObjectSceneListener() { @Override public void objectAdded(final ObjectSceneEvent ose, final Object o) { } @Override public void objectRemoved(final ObjectSceneEvent ose, final Object o) { } @Override public void objectStateChanged(final ObjectSceneEvent ose, final Object o, final ObjectState os, final ObjectState os1) { } @Override public void selectionChanged(final ObjectSceneEvent ose, final Set<Object> oldSelection, final Set<Object> newSelection) { boolean communicationDataSet = false; for (final Object o : newSelection) { if (o instanceof ActorType) setSelectedActorType((ActorType) o); if (o instanceof CommunicationData) { setSelectedCommunicationData((CommunicationData) o); communicationDataSet = true; } } if (!communicationDataSet) setSelectedCommunicationData(null); } @Override public void highlightingChanged(final ObjectSceneEvent ose, final Set<Object> set, final Set<Object> set1) { } @Override public void hoverChanged(final ObjectSceneEvent ose, final Object o, final Object o1) { } @Override public void focusChanged(final ObjectSceneEvent ose, final Object o, final Object o1) { } }, ObjectSceneEventType.OBJECT_SELECTION_CHANGED); this.typeScrollPane.setViewportView(actorTypeGraphScene.createView()); this.actorTypes.stream().forEach((actorType) -> { actorTypeGraphScene.addNode(actorType); }); this.actorTypes.stream().forEach((actorType) -> { final Map<ActorType, Map<MessageType, Integer>> s = actorType.getReceiverStatistics(); s.entrySet().stream().forEach((e) -> { final CommunicationData edge = new CommunicationData(new ImmutableTupel<>(actorType, e.getKey()), e.getValue()); actorTypeGraphScene.addEdge(edge); actorTypeGraphScene.setEdgeSource(edge, actorType); actorTypeGraphScene.setEdgeTarget(edge, e.getKey()); }); }); minProcessingTime = Long.MAX_VALUE; maxProcessingTime = Long.MIN_VALUE; for (final ActorInstance instance : this.actorInstances) { if (instance.getOverallProcessingTime() < minProcessingTime) minProcessingTime = instance.getOverallProcessingTime(); if (instance.getOverallProcessingTime() > maxProcessingTime) maxProcessingTime = instance.getOverallProcessingTime(); } timeSpan = maxProcessingTime - minProcessingTime; final Map<ImmutableTupel<ActorInstance, ActorInstance>, Integer> instanceCommunicationScaleFactors = new HashMap<>(); minMessagesCount = Integer.MAX_VALUE; maxMessagesCount = Integer.MIN_VALUE; for (final ActorInstance instance : this.actorInstances) { final Map<ActorInstance, Map<MessageType, Integer>> s = instance.getReceiverStatistics(); for (final Map.Entry<ActorInstance, Map<MessageType, Integer>> e : s.entrySet()) { int count = 0; count = e.getValue().entrySet().stream().map((d) -> d.getValue()).reduce(count, Integer::sum); instanceCommunicationScaleFactors.put(new ImmutableTupel<>(instance, e.getKey()), count); if (count < minMessagesCount) minMessagesCount = count; if (count > maxMessagesCount) maxMessagesCount = count; } } messagesSpan = maxMessagesCount - minMessagesCount; for (final Map.Entry<ImmutableTupel<ActorInstance, ActorInstance>, Integer> e : instanceCommunicationScaleFactors .entrySet()) { final int factor = (((e.getValue() - minMessagesCount) * 4) / messagesSpan) + 1; instanceCommunicationScaleFactors.put(e.getKey(), factor); } final Map<ActorInstance, Double> instanceComputationScaleFactors = new HashMap<>(); for (final ActorInstance instance : this.actorInstances) { instanceComputationScaleFactors.put(instance, ((double) (instance.getOverallProcessingTime() - minProcessingTime) * 0.4 / timeSpan) + 0.6); } final ActorInstanceGraphScene actorInstanceGraphScene = new ActorInstanceGraphScene(this, instanceComputationScaleFactors, instanceCommunicationScaleFactors); actorInstanceGraphScene.addObjectSceneListener(new ObjectSceneListener() { @Override public void objectAdded(final ObjectSceneEvent ose, final Object o) { } @Override public void objectRemoved(final ObjectSceneEvent ose, final Object o) { } @Override public void objectStateChanged(final ObjectSceneEvent ose, final Object o, final ObjectState os, final ObjectState os1) { } @Override public void selectionChanged(final ObjectSceneEvent ose, final Set<Object> oldSelection, final Set<Object> newSelection) { boolean communicationDataSet = false; for (final Object o : newSelection) { if (o instanceof ActorInstance) setSelectedActorInstance((ActorInstance) o); if (o instanceof CommunicationData) { setSelectedCommunicationData((CommunicationData) o); communicationDataSet = true; } } if (!communicationDataSet) setSelectedCommunicationData(null); } @Override public void highlightingChanged(final ObjectSceneEvent ose, final Set<Object> set, final Set<Object> set1) { } @Override public void hoverChanged(final ObjectSceneEvent ose, final Object o, final Object o1) { } @Override public void focusChanged(final ObjectSceneEvent ose, final Object o, final Object o1) { } }, ObjectSceneEventType.OBJECT_SELECTION_CHANGED); this.instancesScrollPane.setViewportView(actorInstanceGraphScene.createView()); this.actorInstances.stream().forEach((actorInstance) -> { actorInstanceGraphScene.addNode(actorInstance); }); this.actorInstances.stream().forEach((actorInstance) -> { final Map<ActorInstance, Map<MessageType, Integer>> s = actorInstance.getReceiverStatistics(); s.entrySet().stream().forEach((e) -> { final CommunicationData edge = new CommunicationData( new ImmutableTupel<>(actorInstance, e.getKey()), e.getValue()); actorInstanceGraphScene.addEdge(edge); actorInstanceGraphScene.setEdgeSource(edge, actorInstance); actorInstanceGraphScene.setEdgeTarget(edge, e.getKey()); }); }); this.dopPlotData = new XYSeriesCollection(); JFreeChart dopChart = ChartFactory.createXYLineChart("", "", "", this.dopPlotData); final ChartPanel dopChartPanel = new ChartPanel(dopChart); dopChartPanel.setPreferredSize(new java.awt.Dimension(261, 157)); this.dopPanel.setLayout(new BorderLayout()); this.dopPanel.add(dopChartPanel, BorderLayout.CENTER); final XYSeries plotData = new XYSeries("Degree of Parallelism"); final List<ParallelismEvent> parallelismEvents = this.profilingData.getParallelismEvents(); Collections.sort(parallelismEvents); int parallelismLevel = 1; long lastTimeStamp = parallelismEvents.get(0).timestamp; final long firstTimeStamp = lastTimeStamp; final Map<Integer, Long> histogramData = new HashMap<>(); plotData.add(0, 1); for (int i = 1; i < parallelismEvents.size(); ++i) { if (histogramData.containsKey(parallelismLevel)) { final long old = histogramData.get(parallelismLevel); histogramData.put(parallelismLevel, parallelismEvents.get(i).timestamp - lastTimeStamp + old); } else { histogramData.put(parallelismLevel, parallelismEvents.get(i).timestamp - lastTimeStamp); } lastTimeStamp = parallelismEvents.get(i).timestamp; if (parallelismEvents.get(i).eventType == ParallelismEvent.ParallelimEventTypes.PROCESSING_START) { ++parallelismLevel; } else { --parallelismLevel; } plotData.add((double) (lastTimeStamp - firstTimeStamp) / 1000000000.0, parallelismLevel); } this.dopPlotData.addSeries(plotData); this.parallelismHistogramDataSet = new DefaultCategoryDataset(); double avgParallelism1 = 0.0; double avgParallelism2 = 0.0; long t = 0; for (int i = 1; i < histogramData.size(); ++i) { t += histogramData.get(i); } for (int i = 0; i < histogramData.size(); ++i) { parallelismHistogramDataSet.addValue((double) histogramData.get(i) / 1000000.0, "", i == 0 ? "Idle" : "" + i); avgParallelism1 += i * ((double) histogramData.get(i) / this.profilingData.applicationRunTime()); avgParallelism2 += i * ((double) histogramData.get(i) / t); } final JFreeChart chart = ChartFactory.createBarChart("", "Parallelism", "ms", this.parallelismHistogramDataSet, PlotOrientation.VERTICAL, false, true, false); final ChartPanel chartPanel = new ChartPanel(chart); this.parallelismHistogramPanel.setLayout(new BorderLayout()); this.parallelismHistogramPanel.add(chartPanel, BorderLayout.CENTER); this.runtimeTextField.setText("" + (this.profilingData.applicationRunTime() / 1000000.0)); this.computationTimeMsTextField.setText("" + (this.profilingData.getOverallProcessingTime() / 1000000.0)); this.computationTimePercentTextField.setText("" + (this.profilingData.getOverallProcessingTime() * 100.0 / this.profilingData.applicationRunTime())); this.actorInstancesTextField.setText("" + this.actorInstances.size()); this.messagesSentTextField.setText("" + this.profilingData.getMessagesSentCount()); this.messagesSentPerSecondTextField.setText("" + ((double) this.profilingData.getMessagesSentCount() * 1000000000.0 / this.profilingData.applicationRunTime())); this.messagesProcessedTextField.setText("" + this.profilingData.getMessagesProcessedCount()); this.messagesProcessedPerSecondTextField .setText("" + ((double) this.profilingData.getMessagesProcessedCount() * 1000000000.0 / this.profilingData.applicationRunTime())); this.averageTimeInMailboxTextField.setText("" + (this.profilingData.getAverageTimeInMailbox() / 1000000.0)); this.avgParallelismWithIdleTimeTextField.setText("" + avgParallelism1); this.avgParallelismWithouIdleTimeTextField.setText("" + avgParallelism2); final SpawnTreeGraphScene spawnTreeGraphScene = new SpawnTreeGraphScene(this); this.spawnTreeScrollPane.setViewportView(spawnTreeGraphScene.createView()); this.actorInstances.stream().forEach((actorInstance) -> { spawnTreeGraphScene.addNode(actorInstance); }); for (final ActorInstance actorInstance : this.actorInstances) { if (actorInstance.supervisor != null) { final ImmutableTupel<ActorInstance, ActorInstance> edge = new ImmutableTupel( actorInstance.supervisor, actorInstance); spawnTreeGraphScene.addEdge(edge); spawnTreeGraphScene.setEdgeSource(edge, actorInstance.supervisor); spawnTreeGraphScene.setEdgeTarget(edge, actorInstance); } } }
From source file:IntVector.java
/** * Deletes the component at the specified index. Each component in * this vector with an index greater or equal to the specified * index is shifted downward to have an index one smaller than * the value it had previously.//from www .j a va 2 s . c o m * * @param i index of where to remove and int */ public final void removeElementAt(int i) { if (i > m_firstFree) System.arraycopy(m_map, i + 1, m_map, i, m_firstFree); else m_map[i] = java.lang.Integer.MIN_VALUE; m_firstFree--; }
From source file:gobblin.source.jdbc.MysqlExtractor.java
@Override public List<Command> getDataMetadata(String schema, String entity, WorkUnit workUnit, List<Predicate> predicateList) throws DataRecordException { log.debug("Build query to extract data"); List<Command> commands = new ArrayList<>(); int fetchsize = Integer.MIN_VALUE; String watermarkFilter = this.concatPredicates(predicateList); String query = this.getExtractSql(); if (StringUtils.isBlank(watermarkFilter)) { watermarkFilter = "1=1"; }/*w ww .j a va 2s .com*/ query = query.replace(ConfigurationKeys.DEFAULT_SOURCE_QUERYBASED_WATERMARK_PREDICATE_SYMBOL, watermarkFilter); String sampleFilter = this.constructSampleClause(); query = query + sampleFilter; commands.add(getCommand(query, JdbcCommand.JdbcCommandType.QUERY)); commands.add(getCommand(fetchsize, JdbcCommand.JdbcCommandType.FETCHSIZE)); return commands; }
From source file:com.example.google.maps.dataviz.MainActivity.java
private void addDataToMap() { ArrayList<LatLng> coords = new ArrayList<LatLng>(); ArrayList<Double> samples = new ArrayList<Double>(); double minElevation = Integer.MAX_VALUE; double maxElevation = Integer.MIN_VALUE; try {/*from w ww.j a v a 2 s . c o m*/ Resources res = getResources(); InputStream istream = res.openRawResource(R.raw.elevation); byte[] buff = new byte[istream.available()]; istream.read(buff); istream.close(); String json = new String(buff); JSONArray jsonArray = new JSONArray(json); for (int i = 0; i < jsonArray.length(); i++) { JSONObject sample = jsonArray.getJSONObject(i); double elevation = sample.getDouble("elevation"); minElevation = elevation < minElevation ? elevation : minElevation; maxElevation = elevation > maxElevation ? elevation : maxElevation; JSONObject location = sample.getJSONObject("location"); LatLng position = new LatLng(location.getDouble("lat"), location.getDouble("lng")); coords.add(position); samples.add(elevation); } } catch (IOException e) { Log.e(this.getClass().getName(), "Error accessing elevation data file."); return; } catch (JSONException e) { Log.e(this.getClass().getName(), "Error processing elevation data (JSON)."); return; } for (int i = 0; i < coords.size(); i++) { double elevation = samples.get(i); int height = (int) (elevation / maxElevation * MARKER_HEIGHT); Bitmap.Config conf = Bitmap.Config.ARGB_8888; Bitmap bitmap = Bitmap.createBitmap(MARKER_WIDTH, height, conf); Canvas canvas = new Canvas(bitmap); canvas.drawPaint(mPaint); // Invert the bitmap (top red, bottom blue). Matrix matrix = new Matrix(); matrix.preScale(1, -1); bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, false); LatLng position = coords.get(i); BitmapDescriptor bitmapDesc = BitmapDescriptorFactory.fromBitmap(bitmap); mMap.addMarker(new MarkerOptions().position(position).icon(bitmapDesc).alpha(.8f) .title(new DecimalFormat("#.## meters").format(elevation))); } }
From source file:it.geosolutions.jaiext.range.RangeTest.java
@BeforeClass public static void initialSetup() { arrayB = new byte[] { 0, 1, 5, 50, 100 }; arrayUS = new short[] { 0, 1, 5, 50, 100 }; arrayS = new short[] { -10, 0, 5, 50, 100 }; arrayI = new int[] { -10, 0, 5, 50, 100 }; arrayF = new float[] { -10, 0, 5, 50, 100 }; arrayD = new double[] { -10, 0, 5, 50, 100 }; arrayL = new long[] { -10, 0, 5, 50, 100 }; rangeB2bounds = RangeFactory.create((byte) 2, true, (byte) 60, true); rangeBpoint = RangeFactory.create(arrayB[2], true, arrayB[2], true); rangeU2bounds = RangeFactory.createU((short) 2, true, (short) 60, true); rangeUpoint = RangeFactory.createU(arrayUS[2], true, arrayUS[2], true); rangeS2bounds = RangeFactory.create((short) 1, true, (short) 60, true); rangeSpoint = RangeFactory.create(arrayS[2], true, arrayS[2], true); rangeI2bounds = RangeFactory.create(1, true, 60, true); rangeIpoint = RangeFactory.create(arrayI[2], true, arrayI[2], true); rangeF2bounds = RangeFactory.create(0.5f, true, 60.5f, true, false); rangeFpoint = RangeFactory.create(arrayF[2], true, arrayF[2], true, false); rangeD2bounds = RangeFactory.create(1.5d, true, 60.5d, true, false); rangeDpoint = RangeFactory.create(arrayD[2], true, arrayD[2], true, false); rangeL2bounds = RangeFactory.create(1L, true, 60L, true); rangeLpoint = RangeFactory.create(arrayL[2], true, arrayL[2], true); arrayBtest = new Byte[100]; arrayStest = new Short[100]; arrayItest = new Integer[100]; arrayFtest = new Float[100]; arrayDtest = new Double[100]; // Random value creation for the various Ranges for (int j = 0; j < 100; j++) { double randomValue = Math.random(); arrayBtest[j] = (byte) (randomValue * (Byte.MAX_VALUE - Byte.MIN_VALUE) + Byte.MIN_VALUE); arrayStest[j] = (short) (randomValue * (Short.MAX_VALUE - Short.MIN_VALUE) + Short.MIN_VALUE); arrayItest[j] = (int) (randomValue * (Integer.MAX_VALUE - Integer.MIN_VALUE) + Integer.MIN_VALUE); arrayFtest[j] = (float) (randomValue * (Float.MAX_VALUE - Float.MIN_VALUE) + Float.MIN_VALUE); arrayDtest[j] = (randomValue * (Double.MAX_VALUE - Double.MIN_VALUE) + Double.MIN_VALUE); }/*from w w w. j av a 2s .c o m*/ // JAI tools Ranges rangeJTB = org.jaitools.numeric.Range.create((byte) 1, true, (byte) 60, true); rangeJTS = org.jaitools.numeric.Range.create((short) 1, true, (short) 60, true); rangeJTI = org.jaitools.numeric.Range.create(1, true, 60, true); rangeJTF = org.jaitools.numeric.Range.create(0.5f, true, 60.5f, true); rangeJTD = org.jaitools.numeric.Range.create(1.5d, true, 60.5d, true); // 1 point Ranges rangeJTBpoint = org.jaitools.numeric.Range.create((byte) 5, true, (byte) 5, true); rangeJTSpoint = org.jaitools.numeric.Range.create((short) 5, true, (short) 5, true); rangeJTIpoint = org.jaitools.numeric.Range.create(5, true, 5, true); rangeJTFpoint = org.jaitools.numeric.Range.create(5f, true, 5f, true); rangeJTDpoint = org.jaitools.numeric.Range.create(5d, true, 5d, true); // JAI Ranges rangeJAIB = new javax.media.jai.util.Range(Byte.class, (byte) 1, true, (byte) 60, true); rangeJAIS = new javax.media.jai.util.Range(Short.class, (short) 1, true, (short) 60, true); rangeJAII = new javax.media.jai.util.Range(Integer.class, 1, true, 60, true); rangeJAIF = new javax.media.jai.util.Range(Float.class, 0.5f, true, 60.5f, true); rangeJAID = new javax.media.jai.util.Range(Double.class, 1.5d, true, 60.5d, true); // 1 point Ranges rangeJAIBpoint = new javax.media.jai.util.Range(Byte.class, (byte) 5, true, (byte) 5, true); rangeJAISpoint = new javax.media.jai.util.Range(Short.class, (short) 5, true, (short) 5, true); rangeJAIIpoint = new javax.media.jai.util.Range(Integer.class, 5, true, 5, true); rangeJAIFpoint = new javax.media.jai.util.Range(Float.class, 5f, true, 5f, true); rangeJAIDpoint = new javax.media.jai.util.Range(Double.class, 5d, true, 5d, true); // Apache Common Ranges rangeCommonsB = new org.apache.commons.lang.math.IntRange((byte) 1, (byte) 60); rangeCommonsS = new org.apache.commons.lang.math.IntRange((short) 1, (short) 60); rangeCommonsI = new org.apache.commons.lang.math.IntRange(1, 60); rangeCommonsF = new org.apache.commons.lang.math.FloatRange(0.5f, 60.5f); rangeCommonsD = new org.apache.commons.lang.math.DoubleRange(1.5d, 60.5d); // 1 point Ranges rangeCommonsBpoint = new org.apache.commons.lang.math.IntRange(5); rangeCommonsSpoint = new org.apache.commons.lang.math.IntRange(5); rangeCommonsIpoint = new org.apache.commons.lang.math.IntRange(5); rangeCommonsFpoint = new org.apache.commons.lang.math.FloatRange(5f); rangeCommonsDpoint = new org.apache.commons.lang.math.DoubleRange(5d); // // GeoTools Ranges // rangeGeoToolsB = new org.geotools.util.NumberRange<Byte>(Byte.class, (byte) 1, (byte) 60); // rangeGeoToolsS = new org.geotools.util.NumberRange<Short>(Short.class, (short) 1, // (short) 60); // rangeGeoToolsI = new org.geotools.util.NumberRange<Integer>(Integer.class, 1, 60); // rangeGeoToolsF = new org.geotools.util.NumberRange<Float>(Float.class, 0.5f, 60.5f); // rangeGeoToolsD = new org.geotools.util.NumberRange<Double>(Double.class, 1.5d, 60.5d); // // 1 point Ranges // rangeGeoToolsBpoint = new org.geotools.util.NumberRange<Byte>(Byte.class, (byte) 5, // (byte) 5); // rangeGeoToolsSpoint = new org.geotools.util.NumberRange<Short>(Short.class, (short) 5, // (short) 5); // rangeGeoToolsIpoint = new org.geotools.util.NumberRange<Integer>(Integer.class, 5, 5); // rangeGeoToolsFpoint = new org.geotools.util.NumberRange<Float>(Float.class, 5f, 5f); // rangeGeoToolsDpoint = new org.geotools.util.NumberRange<Double>(Double.class, 5d, 5d); // // Guava Ranges // rangeGuavaB = com.google.common.collect.Range.closed((byte) 1, (byte) 60); // rangeGuavaS = com.google.common.collect.Range.closed((short) 1, (short) 60); // rangeGuavaI = com.google.common.collect.Range.closed(1, 60); // rangeGuavaF = com.google.common.collect.Range.closed(0.5f, 60.5f); // rangeGuavaD = com.google.common.collect.Range.closed(1.5d, 60.5d); // // 1 point Ranges // rangeGuavaBpoint = com.google.common.collect.Range.singleton((byte) 5); // rangeGuavaSpoint = com.google.common.collect.Range.singleton((short) 5); // rangeGuavaIpoint = com.google.common.collect.Range.singleton(5); // rangeGuavaFpoint = com.google.common.collect.Range.singleton(5f); // rangeGuavaDpoint = com.google.common.collect.Range.singleton(5d); }
From source file:statistic.graph.dataset.XYChartCreator.java
private XYSeries createSeries(String key, Object data) { LOGGER.entering("statistic.graph.dataset.XYChartCreator", "createSeries", new Object[] { key, data }); XYSeries series = new XYSeries(key); if (data instanceof Number) { Double value = ((Number) data).doubleValue(); series.add(Integer.MIN_VALUE, 0); series.add(0, value);/*from ww w .j a v a2 s .c om*/ series.add(Integer.MAX_VALUE, value); } else if (data instanceof IntegerDoubleMapping) { IntegerDoubleMapping idm = (IntegerDoubleMapping) data; if (diagram.getType() == DiagramType.BAR_CHART) { TimeValuePair start = idm.getFirst(); TimeValuePair end = idm.getLast(); if (start.time() > end.time()) { return series; } for (int i = start.time(); i <= end.time(); i++) { series.add(i, idm.get(i)); } } else { for (TimeValuePair tvp : idm) { series.add(tvp.time(), tvp.value()); } } } return series; }
From source file:de.blizzy.documentr.web.system.SystemController.java
@ModelAttribute public SystemSettingsForm createSystemSettingsForm(@RequestParam(required = false) String documentrHost, @RequestParam(required = false) String siteNotice, @RequestParam(required = false) String mailHostName, @RequestParam(required = false) Integer mailHostPort, @RequestParam(required = false) String mailSenderEmail, @RequestParam(required = false) String mailSenderName, @RequestParam(required = false) String mailSubjectPrefix, @RequestParam(required = false) String mailDefaultLanguage, @RequestParam(required = false) Integer bcryptRounds, @RequestParam(required = false) String pageFooterHtml, @RequestParam(required = false) String updateCheckInterval, WebRequest webRequest) { SortedMap<String, SortedMap<String, String>> allMacroSettings = getMacroSettingsFromRequest(webRequest); return new SystemSettingsForm(Strings.emptyToNull(documentrHost), Strings.emptyToNull(siteNotice), Strings.emptyToNull(mailHostName), (mailHostPort != null) ? mailHostPort : Integer.MIN_VALUE, Strings.emptyToNull(mailSenderEmail), Strings.emptyToNull(mailSenderName), Strings.emptyToNull(mailSubjectPrefix), Strings.emptyToNull(mailDefaultLanguage), (bcryptRounds != null) ? bcryptRounds : Integer.MIN_VALUE, Strings.emptyToNull(pageFooterHtml), Strings.emptyToNull(updateCheckInterval), allMacroSettings); }
From source file:uk.bowdlerize.MainActivity.java
private String getRegistrationId(Context context) { final SharedPreferences prefs = getGCMPreferences(context); String registrationId = prefs.getString(PROPERTY_REG_ID, ""); if (registrationId.isEmpty()) { Log.i(TAG, "Registration not found."); return ""; }// w w w . ja va 2 s . c o m // Check if app was updated; if so, it must clear the registration ID // since the existing regID is not guaranteed to work with the new // app version. int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE); int currentVersion = getAppVersion(context); if (registeredVersion != currentVersion) { Log.i(TAG, "App version changed."); return ""; } return registrationId; }
From source file:com.example.Android.LoginActivity.java
private String getRegistrationId(Context context) { final SharedPreferences prefs = getGcmPreferences(context); String registrationId = prefs.getString(PROPERTY_REG_ID, ""); if (registrationId.isEmpty()) { Log.i(TAG, "Registration not found."); return ""; }// ww w . java 2 s . co m // Check if app was updated; if so, it must clear the registration ID // since the existing regID is not guaranteed to work with the new // app version. int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE); int currentVersion = getAppVersion(context); if (registeredVersion != currentVersion) { Log.i(TAG, "App version changed."); return ""; } return registrationId; }
From source file:edu.cmu.tetrad.graph.LayeredDrawing.java
private int getPMax(List<Node> parents, Map<Node, Integer> tiers) { int pMax = Integer.MIN_VALUE; for (Node parent : parents) { Integer index = tiers.get(parent); if (index > pMax) { pMax = index;/* w w w . j a v a 2 s. c om*/ } } return pMax; }