List of usage examples for java.lang Object hashCode
@HotSpotIntrinsicCandidate public native int hashCode();
From source file:mondrian.olap.Util.java
/** * Computes a hash code from an existing hash code and an object (which * may be null)./*from www.j ava 2 s . c o m*/ */ public static int hash(int h, Object o) { int k = (o == null) ? 0 : o.hashCode(); return ((h << 4) | h) ^ k; }
From source file:com.kodemore.utility.Kmu.java
/** * Determine the hash code of an object, return 0 if null. *///from w w w . j av a2s. c om public static int getHashCode(Object e) { if (e == null) return 0; return e.hashCode(); }
From source file:org.apache.axis2.context.MessageContext.java
/** * Set up a unique key in the form of/* ww w .ja va2 s . c o m*/ * <OL> * <LI>the class name for the class that owns the key * <LI>delimitor * <LI>the key as a string * <LI>delimitor * <LI>the key's hash code as a string * </OL> * * @param clazz The class that owns the supplied key * @param key The key * @return A string key */ private String generateSelfManagedDataKey(Class clazz, Object key) { return clazz.getName() + selfManagedDataDelimiter + key.toString() + selfManagedDataDelimiter + Integer.toString(key.hashCode()); }
From source file:org.infoglue.deliver.util.CacheController.java
public static void cacheObject(String cacheName, Object key, Object value) { if (cacheName == null || key == null || value == null) return;/*from w w w. j ava2s .c om*/ //synchronized(caches) //{ if (caches.get(cacheName) == null) caches.put(cacheName, new HashMap()); //} //synchronized(caches) //{ Map cacheInstance = (Map) caches.get(cacheName); if (cacheInstance != null && key != null && value != null) { if (CmsPropertyHandler.getUseSynchronizationOnCaches()) { synchronized (cacheInstance) { if (CmsPropertyHandler.getUseHashCodeInCaches()) cacheInstance.put("" + key.hashCode(), value); else cacheInstance.put(key, value); } } else { if (CmsPropertyHandler.getUseHashCodeInCaches()) cacheInstance.put("" + key.hashCode(), value); else cacheInstance.put(key, value); } } //} }
From source file:org.infoglue.deliver.util.CacheController.java
public static Object getCachedObject(String cacheName, Object key) { if (cacheName == null || key == null) return null; if (getDefeatCaches() != null && getDefeatCaches().getDefeatCache("" + cacheName + "_" + key)) { if (!cacheName.equals("serverNodePropertiesCache") && !cacheName.equals("contentTypeDefinitionCache")) { if (logger.isInfoEnabled()) { logger.info("Missed cache: " + cacheName + " because of defeat caches. Cache.key: " + key); }/*from ww w . j a v a 2 s . c o m*/ return null; } } //synchronized(caches) //{ Map cacheInstance = (Map) caches.get(cacheName); if (cacheInstance != null) { //TODO if (CmsPropertyHandler.getUseSynchronizationOnCaches()) { synchronized (cacheInstance) { if (CmsPropertyHandler.getUseHashCodeInCaches()) return cacheInstance.get("" + key.hashCode()); else return cacheInstance.get(key); } } else { if (CmsPropertyHandler.getUseHashCodeInCaches()) return cacheInstance.get("" + key.hashCode()); else return cacheInstance.get(key); } } //} return null; }
From source file:org.mindswap.swoop.renderer.entity.ConciseFormatEntityRenderer.java
protected void addWhy(Object obj, String title) { String hash = String.valueOf(obj.hashCode()); OWLDescHash.put(hash, obj);/*from w ww. j a v a 2 s.c om*/ String titleCode = getCode(title); if (!imported) { print(" (<font color=\"red\"><a href=\"<Why:" + hash + ":" + titleCode + "\">Why?</a></font>)"); } }
From source file:org.mindswap.swoop.renderer.entity.ConciseFormatEntityRenderer.java
protected void addDelete(Object obj, String title) { String hash = String.valueOf(obj.hashCode()); OWLDescHash.put(hash, obj);// w w w. j av a 2 s . c o m String titleCode = getCode(title); if (!imported) { print(" (<font color=\"red\"><a href=\"<Delete:" + hash + ":" + titleCode + "\">Delete</a></font>)"); } }
From source file:org.mindswap.swoop.renderer.entity.ConciseFormatEntityRenderer.java
protected void addUndo(Object obj, String type, String title) { String hash = String.valueOf(obj.hashCode()); OWLDescHash.put(hash, obj);// w w w . j a v a 2 s .c o m String titleCode = getCode(title); print(" (<font color=\"red\"><a href=\"<Undo:" + type + ":" + hash + ":" + titleCode + "\">Undo</a></font>)"); }
From source file:org.regenstrief.util.Util.java
/** * Retrieves the hash code of the given Object * //from ww w . j a v a 2 s . com * @param o the Object * @return the hash code **/ public final static int hashCode(final Object o) { return o == null ? 0 : o.hashCode(); }
From source file:edu.ku.brc.af.ui.forms.FormViewObj.java
/** * @param oldDO// w w w.j av a2s . co m * @param newDO */ protected void replaceDataObjInList(final Object oldDO, final Object newDO) { //if (oldDO != null && newDO != null) //{ // log.debug("Replacing "+oldDO.getClass().getSimpleName()+" "+oldDO.hashCode()+" with "+newDO.getClass().getSimpleName()+" "+newDO.hashCode()); //} if (list != null) { int index = list.indexOf(oldDO); if (index > -1) { list.remove(oldDO); if (oldDO != null) { log.error( "Removed " + oldDO.getClass().getSimpleName() + " " + oldDO.hashCode() + " from list."); } list.insertElementAt(newDO, index); log.error("list length: " + list.size() + " inx: " + index); } else { if (oldDO != null) { log.error("************ " + oldDO.getClass().getSimpleName() + " " + oldDO.hashCode() + " couldn't be found in list."); } } } }