Example usage for org.apache.commons.lang3.builder HashCodeBuilder toHashCode

List of usage examples for org.apache.commons.lang3.builder HashCodeBuilder toHashCode

Introduction

In this page you can find the example usage for org.apache.commons.lang3.builder HashCodeBuilder toHashCode.

Prototype

public int toHashCode() 

Source Link

Document

Return the computed hashCode.

Usage

From source file:io.netlibs.bgp.protocol.attributes.ClusterListPathAttribute.java

@Override
protected int subclassHashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();
    Iterator<Integer> it = getClusterIds().iterator();

    while (it.hasNext())
        builder.append(it.next());/*from w ww  . java  2  s . c  o  m*/

    return builder.toHashCode();
}

From source file:ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate.java

@Override
public int hashCode() {
    HashCodeBuilder b = new HashCodeBuilder();
    b.append(getParamName());/*from   ww  w. j  ava 2  s  . c  o  m*/
    b.append(getResource());
    b.append(getValueHigh());
    b.append(getValueLow());
    return b.toHashCode();
}

From source file:com.github.jgility.core.project.Person.java

@Override
public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();
    builder.append(firstname);/*from   w  w w.  j  a v  a  2  s .  c  o  m*/
    builder.append(surname);
    builder.append(eMail);
    return builder.toHashCode();
}

From source file:edu.oregonstate.eecs.mcplan.domains.blackjack.HandValueAbstraction.java

public HandValueAbstraction(final int dealer_value, final int[] player_values, final boolean[] player_aces,
        final BlackjackParameters params) {
    assert (player_values.length == 1);
    this.dealer_value = dealer_value;
    this.player_values = player_values;
    this.player_aces = player_aces;
    phi_ = makePhi(params, player_values[0], player_aces[0] ? 1 : 0, dealer_value);
    params_ = params;/*w ww . j a  v a 2 s  .c  o  m*/
    final HashCodeBuilder hb = newHashCodeBuilder();
    final StringBuilder sb = new StringBuilder();
    makeRepr(hb, sb);
    hash_code_ = hb.toHashCode();
    repr_ = sb.toString();
}

From source file:ca.uhn.fhir.validation.SingleValidationMessage.java

@Override
public int hashCode() {
    HashCodeBuilder b = new HashCodeBuilder();
    b.append(myLocationCol);//from   www  . j av a  2s  .  c o m
    b.append(myLocationCol);
    b.append(myLocationString);
    b.append(myMessage);
    b.append(mySeverity);
    return b.toHashCode();
}

From source file:annis.model.DataObject.java

@Override
public int hashCode() {
    // sort fields by name for predictable results
    final SortedMap<String, Object> fieldValues = new TreeMap<String, Object>();

    final Object _this = this;
    forEachFieldDo(new FieldCallBack() {

        public void doForField(Field field) throws IllegalAccessException {
            fieldValues.put(field.getName(), field.get(_this));
        }/*from  www .  ja va  2 s  . c  o m*/

    });

    HashCodeBuilder hashCodeBuilder = new HashCodeBuilder();

    for (Object fieldValue : fieldValues.values())
        hashCodeBuilder.append(fieldValue);

    return hashCodeBuilder.toHashCode();
}

From source file:edu.oregonstate.eecs.mcplan.domains.blackjack.HandValueAbstraction.java

public HandValueAbstraction(final BlackjackState s) {
    assert (s.nplayers() == 1);
    dealer_value = s.dealerUpcard().BlackjackValue();
    player_values = new int[s.nplayers()];
    player_aces = new boolean[s.nplayers()];
    params_ = s.parameters();//from   w  w  w . j a v  a2  s .co  m
    for (int i = 0; i < s.nplayers(); ++i) {
        final int[] v = params_.handValue(s.hand(i));
        player_values[i] = v[0];
        player_aces[i] = v[1] > 0;
    }

    phi_ = makePhi(params_, player_values[0], player_aces[0] ? 1 : 0, dealer_value);

    final HashCodeBuilder hb = newHashCodeBuilder();
    final StringBuilder sb = new StringBuilder();
    makeRepr(hb, sb);
    hash_code_ = hb.toHashCode();

    // TODO: Debugging
    //      sb.append( "\n" ).append( new BlackjackStateToken( s ).toString() );
    repr_ = sb.toString();
}

From source file:net.sf.jabb.util.col.NumberArray.java

/**
 * Gets the calculated hash code.<br>
 * hash//ww  w  .  ja  v a2s  . c  o m
 */
@Override
public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder(11, 19);
    for (Number o : values) {
        builder.append(o);
    }
    return builder.toHashCode();
}

From source file:gal.udc.fic.muei.tfm.dap.flipper.domain.Metadata.java

@Override
public int hashCode() {
    HashCodeBuilder hcb = new HashCodeBuilder();

    hcb.append(picture_id);/*from  w  w  w  .j  av  a 2s  .c om*/
    hcb.append(tagName);

    /* return "toHashCode", NOT "hashCode " */
    return hcb.toHashCode();
}

From source file:ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString.java

@Override
public int hashCode() {
    HashCodeBuilder b = new HashCodeBuilder();
    b.append(getParamName());//from  w  w  w .j a  va2 s  .c  o m
    b.append(getResource());
    b.append(getValueExact());
    return b.toHashCode();
}