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:io.github.karols.hocr4j.Bounds.java
/** * Returns the semiplane on the left of the vertical line with the given coordinate. * * @param x the right edge coordinate/* ww w . j a va 2s . co m*/ * @return the semiplane */ public static Bounds getLeftSemiplane(int x) { return new Bounds(Integer.MIN_VALUE, Integer.MIN_VALUE, x, Integer.MAX_VALUE); }
From source file:fiji.plugin.trackmate.action.brownianmotion.WalkerMethodEstimator.java
/** * /*from w w w . j a va 2 s .c o m*/ * @param data Containes the mean squared displacement and the Tracklength for each track. data[i][0] = MSD data[i][1] = Tracklength * @param temp Temperature of the suspension in kelvin * @param visk Viscosity of the suspension * @param framerate Framerate in hertz * @param maxdiameter The maximum diameter for the estimation */ public WalkerMethodEstimator(double[][] data, double temp, double visk, double framerate, int maxdiameter) { this.data = data; this.temp = temp; this.visk = visk; this.frameduration = 1 / framerate; minTrackLength = Integer.MAX_VALUE; maxTrackLength = Integer.MIN_VALUE; //msdMin = Double.MAX_VALUE; msdMax = Double.MIN_VALUE; //double convFact = Math.pow(10, -10); for (int i = 0; i < data.length; i++) { //10^-10 cm^2 -> cm^2 //this.data[i][0] = this.data[i][0]*convFact; //- 4*17.562862475*17.562862475*Math.pow(10, -7)*Math.pow(10, -7); if (data[i][0] > msdMax) { msdMax = data[i][0]; } if (this.data[i][1] > maxTrackLength) { maxTrackLength = (int) this.data[i][1]; } if (this.data[i][1] < minTrackLength) { minTrackLength = (int) this.data[i][1]; } //IJ.log("MSD " + this.data[i][0]); } logMapK = new double[maxTrackLength + 1]; logMapGammaK = new double[maxTrackLength + 1]; java.util.Arrays.fill(logMapK, Double.NaN); java.util.Arrays.fill(logMapGammaK, Double.NaN); maxRadiusInNm = maxdiameter / 2.0; binNumber = (int) (maxRadiusInNm / binSizeInnm); histBinNumber = (int) Math.ceil(Math.sqrt(data.length)); deltaB = msdMax / histBinNumber; histogramMSD = new double[histBinNumber]; java.util.Arrays.fill(histogramMSD, 0); Nk = new int[maxTrackLength + 1]; java.util.Arrays.fill(Nk, 0); for (int i = 0; i < data.length; i++) { int index = (int) this.data[i][1]; Nk[index]++; int index2 = (int) Math.floor(data[i][0] / deltaB - 0.001); histogramMSD[index2]++; } }
From source file:net.kamhon.ieagle.struts2.components.AbstractContainer.java
protected String generateRandomId(String prefix) { // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT int nextInt = RANDOM.nextInt(); nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt); return prefix + "_" + String.valueOf(nextInt); }
From source file:com.opengamma.util.timeseries.fast.integer.FastArrayIntDoubleTimeSeries.java
private void init(final int[] times, final double[] values) { if (times.length != values.length) { throw new IllegalArgumentException( "Arrays are of different sizes: " + times.length + ", " + values.length); }//from ww w .ja v a 2 s.c om System.arraycopy(times, 0, _times, 0, times.length); System.arraycopy(values, 0, _values, 0, values.length); // check dates are ordered int maxTime = Integer.MIN_VALUE; for (final int time : _times) { if (time < maxTime) { throw new IllegalArgumentException("dates must be ordered"); } maxTime = time; } }
From source file:com.opengamma.util.timeseries.fast.integer.object.FastArrayIntObjectTimeSeries.java
private void init(final int[] times, final T[] values) { if (times.length != values.length) { throw new IllegalArgumentException( "Arrays are of different sizes: " + times.length + ", " + values.length); }/* ww w.ja va2s . c o m*/ System.arraycopy(times, 0, _times, 0, times.length); System.arraycopy(values, 0, _values, 0, values.length); // check dates are ordered int maxTime = Integer.MIN_VALUE; for (final int time : _times) { if (time < maxTime) { throw new IllegalArgumentException("dates must be ordered"); } maxTime = time; } }
From source file:de.unidue.inf.is.ezdl.gframedl.converter.HTMLConversionStrategy.java
private void printSingleDocument(TextDocument document, StringBuilder html) { html.append("<h2>").append(escape(document.getTitle())).append("</h2>"); if (document.getYear() != Integer.MIN_VALUE) { html.append("<p><b>").append(i18n.getLocString("field.year")).append("</b>: ") .append(document.getYear()).append("</p>"); }//w ww . j ava2s . c o m PersonList al = document.getAuthorList(); if ((al != null) && (!al.isEmpty())) { String authorLabel = getAuthorFieldLabel(al); html.append("<p><b>").append(escape(authorLabel)).append("</b></p>"); html.append(generateListIcon("author")); for (Person a : al) { html.append("<li>").append(createAuthorlink(a)).append("</li>"); } html.append("</ul>"); } if (!StringUtils.isEmpty(document.getAbstract())) { html.append("<p><b>").append(i18n.getLocString("field.abstract")).append("</b></p>"); html.append("<div>"); printToHTMLescaped(html, "p", document.getAbstract()); html.append("</div>"); } URLList urls = (URLList) document.getFieldValue(Field.URLS); if (urls != null && !urls.isEmpty()) { html.append("<p><b>").append(i18n.getLocString("field.detaillinks")).append("</b></p>"); html.append("<ul>"); for (URL url : urls) { String urlStr = url.toString(); html.append("<li><a href=\"" + urlStr + "\">").append(urlStr).append("</a></li>"); } html.append("</ul>"); } html.append("<br/><br/><br/><br/><br/>"); }
From source file:eu.stratosphere.nephele.io.channels.LocalChannelWithAccessInfo.java
@Override public int decrementReferences() { int current = this.referenceCounter.get(); while (true) { if (current <= 0) { // this is actually an error case, because the channel was deleted before throw new IllegalStateException("The references to the file were already at zero."); }/* ww w. jav a 2 s . c o m*/ if (current == 1) { // this call decrements to zero, so mark it as deleted if (this.referenceCounter.compareAndSet(current, Integer.MIN_VALUE)) { current = 0; break; } } else if (this.referenceCounter.compareAndSet(current, current - 1)) { current = current - 1; break; } current = this.referenceCounter.get(); } if (current > 0) { return current; } else if (current == 0) { // delete the channel this.referenceCounter.set(Integer.MIN_VALUE); this.reservedWritePosition.set(Long.MIN_VALUE); try { this.channel.close(); } catch (IOException ioex) { if (LOG.isErrorEnabled()) { LOG.error("Error while closing spill file for file buffers: " + ioex.getMessage(), ioex); } } if (this.deleteOnClose.get()) { this.file.delete(); } return current; } else { throw new IllegalStateException("The references to the file were already at zero."); } }
From source file:de.biomedical_imaging.ij.nanotrackj.WalkerMethodEstimator.java
/** * // w w w .java2 s .com * @param data Containes the mean squared displacement and the Tracklength for each track. data[i][0] = MSD data[i][1] = Tracklength * @param temp Temperature of the suspension in kelvin * @param visk Viscosity of the suspension * @param framerate * @param maxdiameter The maximum diameter for the estimation. 0 = Maximum Diameter is estimated automatically */ public WalkerMethodEstimator(double[][] data, double temp, double visk, double framerate, int maxdiameter) { this.temp = temp; this.visk = visk; this.framerate = 1.0 / framerate; this.data = data; kMin = Integer.MAX_VALUE; kMax = Integer.MIN_VALUE; msdMin = Double.MAX_VALUE; msdMax = Double.MIN_VALUE; double convFact = Math.pow(10, -10); for (int i = 0; i < data.length; i++) { //10^-10 cm^2 -> cm^2 this.data[i][0] = this.data[i][0] * convFact; //- 4*17.562862475*17.562862475*Math.pow(10, -7)*Math.pow(10, -7); if (this.data[i][0] > msdMax) { msdMax = this.data[i][0]; } if (this.data[i][0] < msdMin) { msdMin = this.data[i][0]; } if (this.data[i][1] > kMax) { kMax = (int) this.data[i][1]; } if (this.data[i][1] < kMin) { kMin = (int) this.data[i][1]; } //IJ.log("MSD " + this.data[i][0]); } logMapK = new double[kMax + 1]; logMapGammaK = new double[kMax + 1]; java.util.Arrays.fill(logMapK, Double.NaN); java.util.Arrays.fill(logMapGammaK, Double.NaN); maxRadiusInNm = maxdiameter / 2.0; if (maxdiameter == 0) { maxRadiusInNm = NanoTrackJ_.getInstance() .diffCoeffToDiameter((msdMin * Math.pow(10, 10)) / 4 * (framerate)); maxRadiusInNm = (maxRadiusInNm + 1) / 2; } binNumber = (int) (maxRadiusInNm / binSizeInnm); histBinNumber = (int) Math.ceil(Math.sqrt(data.length)); deltaB = msdMax / histBinNumber; histogramMSD = new double[histBinNumber]; java.util.Arrays.fill(histogramMSD, 0); Nk = new int[kMax + 1]; java.util.Arrays.fill(Nk, 0); for (int i = 0; i < data.length; i++) { int index = (int) this.data[i][1]; Nk[index]++; int index2 = (int) Math.floor(data[i][0] / deltaB - 0.001); histogramMSD[index2]++; } }
From source file:com.sisrni.managedbean.CarreraMB.java
/** * Metodo para guardar una instancia de 'Carrera' en la tabla * correspondiente de la base de datos//w w w . j av a 2 s. c o m */ public void guardarCarrera() { String msg = "Carrera Almacenada Exitosamente!"; try { carrera.setIdCarrera(Integer.MIN_VALUE); carrera.setIdFacultad(facultadService.findById(facultad.getIdFacultad())); carreraService.save(carrera); FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Guardado!!", msg)); } catch (Exception e) { JsfUtil.addErrorMessage("Error al Guardar Carrera!"); e.printStackTrace(); } cargarCarrera(); }
From source file:com.asakusafw.runtime.stage.input.StageInputDriver.java
/** * Returns the estimated input data-size. * @param context the current job context * @return the estimated input data-size in bytes * @throws InterruptedException if interrupted while * @throws IllegalArgumentException if some parameters were {@code null} * @since 0.6.0/*from w w w .ja va 2s . co m*/ */ public static long estimateInputSize(JobContext context) throws InterruptedException { if (context == null) { throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$ } long cached = context.getConfiguration().getLong(KEY_SIZE_CACHE, Integer.MIN_VALUE); if (cached != Integer.MIN_VALUE) { return cached; } long result = estimateInputSize0(context); if (result >= 0) { context.getConfiguration().setLong(KEY_SIZE_CACHE, result); } return result; }