List of usage examples for java.util Arrays hashCode
public static int hashCode(Object a[])
From source file:com.opengamma.maths.lowlevelapi.datatypes.primitive.CompressedSparseColumnFormatMatrix.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(_rowIdx); result = prime * result + _cols;//from w ww .j a va2s .c o m result = prime * result + _els; result = prime * result + Arrays.hashCode(_colPtr); result = prime * result + _rows; result = prime * result + Arrays.hashCode(_values); return result; }
From source file:com.impetus.ankush.common.domain.NodeMonitoring.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(monitoringInfoBytes); result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode()); result = prime * result + Arrays.hashCode(technologyDataBytes); result = prime * result + ((updateTime == null) ? 0 : updateTime.hashCode()); return result; }
From source file:org.mc4j.ems.connection.support.classloader.ClassLoaderFactory.java
public ClassLoader buildClassLoader(ConnectionSettings settings) { String tempDirString = (String) settings.getControlProperties().get(ConnectionFactory.JAR_TEMP_DIR); File tempDir = null;/*from w w w . j a v a2 s. com*/ if (tempDirString != null) { tempDir = new File(tempDirString); } Boolean useContextClassLoader = Boolean.valueOf( settings.getAdvancedProperties().getProperty(ConnectionFactory.USE_CONTEXT_CLASSLOADER, "false")); if (useContextClassLoader.booleanValue()) { ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); URL implURL = storeImplToTemp("org-mc4j-ems-impl.jar", tempDir); ClassLoader loader = new URLClassLoader(new URL[] { implURL }, contextClassLoader); return loader; } List<URL> entries = new ArrayList<URL>(); if (settings.getClassPathEntries() != null) { for (File file : settings.getClassPathEntries()) { try { if (Boolean.valueOf(settings.getControlProperties() .getProperty(ConnectionFactory.COPY_JARS_TO_TEMP, "false"))) { entries.add(getCachedTempForFile(file, tempDir)); } else { entries.add(file.toURI().toURL()); } } catch (MalformedURLException e) { throw new EmsConnectException("Unable to read class path library url", e); } } } // Now load in the implementation jar // URL implURL = new URL(null, "deepjar://org-mc4j-ems-impl.jar", new Handler()); URL implURL = storeImplToTemp("org-mc4j-ems-impl.jar", tempDir); entries.add(implURL); if (settings.getConnectionType() instanceof LocalVMTypeDescriptor) { // Need tools.jar if its not already loaded try { Class.forName("com.sun.tools.attach.VirtualMachine"); } catch (ClassNotFoundException e) { // Try to load tools.jar File toolsJar = null; toolsJar = findToolsJarForHome(System.getProperty("java.home")); if (toolsJar == null) { toolsJar = findToolsJarForHome(System.getProperty("env_java_home")); } if (toolsJar != null) { try { log.debug("Found tools.jar at " + toolsJar.getPath()); entries.add(toolsJar.toURI().toURL()); } catch (MalformedURLException e1) { /* Unnexpected */ } } else { throw new EmsConnectException( "Unable to find tools.jar. Add it to your classpath to use Sun local vm connections."); } } } // Add internal support jars for JSR160 on < jdk5 if ((settings.getConnectionType() instanceof JSR160ConnectionTypeDescriptor) && settings.getConnectionType().getConnectionClasspathEntries() == null && Double.parseDouble(System.getProperty("java.version").substring(0, 3)) < 1.5) { entries.add(storeImplToTemp("lib/jsr160-includes/mx4j.jar", tempDir)); entries.add(storeImplToTemp("lib/jsr160-includes/mx4j-remote.jar", tempDir)); } // TODO: Check if file exists, log warning if not URL[] entryArray = entries.toArray(new URL[entries.size()]); ClassLoader loader = null; long key = Arrays.hashCode(entryArray); WeakReference<ClassLoader> loaderReference = classLoaderCache.get(key); if (loaderReference != null) { loader = classLoaderCache.get(key).get(); } if (loader == null) { // WARNING: Relatively disgusting hack. hiding classes is not a good thing if (settings.getConnectionType().isUseChildFirstClassLoader()) { loader = new ChildFirstClassloader(entryArray, ClassLoaderFactory.class.getClassLoader()); } else { // TODO was NestedJarClassLoader //loader = new ChildFirstClassloader(entryArray, ClassLoaderFactory.class.getClassLoader()); loader = new URLClassLoader(entryArray, ClassLoaderFactory.class.getClassLoader()); //loader = new NestedJarClassLoader(entryArray, ClassLoaderFactory.class.getClassLoader()); } classLoaderCache.put(key, new WeakReference<ClassLoader>(loader)); if (log.isDebugEnabled()) { StringBuffer buf = new StringBuffer("Classloader built with: \n"); for (URL url : entries) { buf.append("\t").append(url).append("\n"); } log.info(buf.toString()); } } return loader; }
From source file:com.linkedin.databus.core.DbusEventPart.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (_schemaDigest == null ? 0 : Arrays.hashCode(_schemaDigest)); result = prime * result + (_data == null ? 0 : _data.hashCode()); return result; }
From source file:au.org.ala.biocache.dto.SearchRequestParams.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((dir == null) ? 0 : dir.hashCode()); result = prime * result + ((displayString == null) ? 0 : displayString.hashCode()); result = prime * result + ((facet == null) ? 0 : facet.hashCode()); result = prime * result + Arrays.hashCode(facets); result = prime * result + ((fl == null) ? 0 : fl.hashCode()); result = prime * result + ((flimit == null) ? 0 : flimit.hashCode()); result = prime * result + ((foffset == null) ? 0 : foffset.hashCode()); result = prime * result + ((formattedQuery == null) ? 0 : formattedQuery.hashCode()); result = prime * result + ((fprefix == null) ? 0 : fprefix.hashCode()); result = prime * result + Arrays.hashCode(fq); result = prime * result + ((fsort == null) ? 0 : fsort.hashCode()); result = prime * result + ((pageSize == null) ? 0 : pageSize.hashCode()); result = prime * result + ((q == null) ? 0 : q.hashCode()); result = prime * result + ((qc == null) ? 0 : qc.hashCode()); result = prime * result + ((sort == null) ? 0 : sort.hashCode()); result = prime * result + ((start == null) ? 0 : start.hashCode()); return result; }
From source file:com.opengamma.analytics.math.cube.DoublesCube.java
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + Arrays.hashCode(_values); result = prime * result + Arrays.hashCode(_xData); result = prime * result + Arrays.hashCode(_yData); result = prime * result + Arrays.hashCode(_zData); return result; }
From source file:com.opengamma.maths.lowlevelapi.datatypes.primitive.CompressedSparseRowFormatMatrix.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(_colIdx); result = prime * result + _cols;/*ww w. ja va 2s.c o m*/ result = prime * result + _els; result = prime * result + Arrays.hashCode(_rowPtr); result = prime * result + _rows; result = prime * result + Arrays.hashCode(_values); return result; }
From source file:org.apache.fop.render.pdf.pdfbox.PSPDFGraphics2D.java
@Override public boolean drawImage(Image img, int x1, int y1, ImageObserver observer) { PSGenerator tmp = gen;/*from w w w .j av a 2 s .co m*/ if (gen instanceof PSDocumentHandler.FOPPSGenerator) { PSDocumentHandler.FOPPSGenerator fopGen = (PSDocumentHandler.FOPPSGenerator) tmp; PSDocumentHandler handler = fopGen.getHandler(); if (handler.getPSUtil().isOptimizeResources()) { try { final int width = img.getWidth(observer); final int height = img.getHeight(observer); if (width == -1 || height == -1) { return false; } BufferedImage buf = getImage(width, height, img, observer); if (buf == null) { return false; } ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataBufferInt db = (DataBufferInt) buf.getRaster().getDataBuffer(); DataOutputStream dos = new DataOutputStream(bos); dos.writeInt(width); dos.writeInt(height); for (int i : db.getData()) { dos.writeInt(i); } String format = DataBufferInt.class.getName(); int hash = Arrays.hashCode(bos.toByteArray()); URI uri = fopGen.getImages().get(hash); if (uri == null) { uri = new TempResourceURIGenerator("img" + hash + "." + format).generate(); fopGen.getImages().put(hash, uri); BufferedOutputStream outputStream = fopGen.getTempStream(uri); outputStream.write(bos.toByteArray()); outputStream.close(); } PSResource form = handler.getFormForImage(uri.toASCIIString()); ImageInfo info = new ImageInfo(uri.toASCIIString(), "image/" + format); ImageSize size = new ImageSize(width, height, handler.getUserAgent().getTargetResolution()); size.calcSizeFromPixels(); info.setSize(size); float res = handler.getUserAgent().getSourceResolution() / 72; Rectangle rect = new Rectangle(0, 0, (int) (size.getWidthMpt() * res), (int) (size.getHeightMpt() * res)); gen.saveGraphicsState(); gen.concatMatrix(getTransform()); writeClip(getClip()); PSImageUtils.drawForm(form, info, rect, gen); gen.restoreGraphicsState(); } catch (IOException e) { throw new RuntimeException(e); } return true; } } return super.drawImage(img, x1, y1, observer); }
From source file:com.opengamma.analytics.financial.credit.isdayieldcurve.ISDADateCurve.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(_curveDates); result = prime * result + _name.hashCode(); result = prime * result + Arrays.hashCode(_shiftedTimePoints); long temp;/*www . j av a 2s. c o m*/ temp = Double.doubleToLongBits(_zeroDiscountFactor); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; }
From source file:org.multibit.crypto.KeyCrypterOpenSSL.java
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(openSSLSaltedBytes); return result; }