Example usage for java.lang String hashCode

List of usage examples for java.lang String hashCode

Introduction

In this page you can find the example usage for java.lang String hashCode.

Prototype

public int hashCode() 

Source Link

Document

Returns a hash code for this string.

Usage

From source file:com.android.isoma.sync.PageTurnerWebProgressService.java

private String computeKey(String fileName) {

    String filePart = fileName;/*from  w ww  .  ja  v a  2  s.co m*/

    if (fileName.indexOf("/") != -1) {
        filePart = fileName.substring(fileName.lastIndexOf('/'));
    }

    String plainTextKey = this.userId + ":" + filePart;

    String hash = Integer.toHexString(plainTextKey.hashCode());

    return hash;
}

From source file:com.opengamma.component.factory.web.FreemarkerConfigurationComponentFactory.java

@Override
protected void propertySet(String propertyName, Object newValue, boolean quiet) {
    switch (propertyName.hashCode()) {
    case 826348548: // templateLocations
        setTemplateLocations((String) newValue);
        return;//from  www.jav  a 2 s .  co m
    }
    super.propertySet(propertyName, newValue, quiet);
}

From source file:com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.impl.AbstractVirtualDataSourceQueryServiceImpl.java

private String getJndiDataSourceID(JndiDataSource jndiDataSource) {
    String key = jndiDataSource.getJndiName();
    return key.hashCode() + "";
}

From source file:com.opengamma.financial.analytics.ircurve.strips.PointsCurveNodeWithIdentifier.java

@Override
protected void propertySet(String propertyName, Object newValue, boolean quiet) {
    switch (propertyName.hashCode()) {
    case 368639974: // underlyingIdentifier
        setUnderlyingIdentifier((ExternalId) newValue);
        return;/*from w w  w.  j a  v  a  2 s  . c  om*/
    case -876884845: // underlyingDataField
        setUnderlyingDataField((String) newValue);
        return;
    }
    super.propertySet(propertyName, newValue, quiet);
}

From source file:gov.nih.nci.evs.browser.utils.CacheController.java

private static String getTreeKey(String codingScheme, String code) {
    return String.valueOf("Tree".hashCode() + codingScheme.hashCode() + code.hashCode());
}

From source file:Data.c_CardDB.java

public HashMap<c_Expansion, Integer> getExpansionList(String cardname) {
    return m_cardNamesToMIDs.get(cardname.hashCode());
}

From source file:Data.c_CardDB.java

public boolean contains(String name) {
    return m_cardNamesToMIDs.containsKey(name.hashCode());
}

From source file:gov.nih.nci.evs.browser.utils.CacheController.java

private static String getSubConceptKey(String codingScheme, String code) {
    return String.valueOf("SubConcept".hashCode() + codingScheme.hashCode() + code.hashCode());
}

From source file:fedora.server.security.servletfilters.Cache.java

private final synchronized CacheElement getCacheElement(String userid /*
                                                                         * ,
                                                                         * String
                                                                         * password
                                                                         */) {
    String m = getCacheAbbrev() + " getCacheElement() ";
    CacheElement cacheElement = null;/*from  w w  w  .  j a  v  a2s . com*/
    String keytemp = getKey(userid/* ,password,CACHE_KEY_SEPARATOR */);
    Integer key = new Integer(keytemp.hashCode());
    LOG.debug(m + "keytemp==" + keytemp);
    LOG.debug(m + "key==" + key);
    if (cache.containsKey(key)) {
        LOG.debug(m + "cache already has element");
    } else {
        LOG.debug(m + "cache does not have element; create and put");
        CacheElement itemtemp = new CacheElement(userid, getCacheId(), getCacheAbbrev());
        cache.put(key, itemtemp);
    }
    cacheElement = (CacheElement) cache.get(key);
    if (cacheElement == null) {
        LOG.error(m + "cache does not contain element");
    } else {
        LOG.debug(m + "element retrieved from cache successfully");
    }
    return cacheElement;
}

From source file:com.aujur.ebookreader.sync.PageTurnerWebProgressService.java

private String computeKey(String fileName) {

    String filePart = fileName;//from ww  w  .  j  ava  2 s. c  om

    if (fileName.indexOf("/") != -1) {
        filePart = fileName.substring(fileName.lastIndexOf('/'));
    }

    String plainTextKey = this.config.getSynchronizationEmail() + ":" + filePart;

    String hash = Integer.toHexString(plainTextKey.hashCode());

    return hash;
}