Example usage for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder

List of usage examples for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder.

Prototype

public CompareToBuilder() 

Source Link

Document

Constructor for CompareToBuilder.

Starts off assuming that the objects are equal.

Usage

From source file:org.jgap.gp.function.AddAndStore.java

/**
 * The compareTo-method.//from  w  ww. j a v  a 2s  .co m
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.0
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    AddAndStore other = (AddAndStore) a_other;
    return new CompareToBuilder().append(m_type, other.m_type).append(m_storageName, other.m_storageName)
            .toComparison();
}

From source file:org.jgap.gp.function.AddAndStoreTerminal.java

/**
 * The compareTo-method.//w w w . ja  v  a  2 s  .  c  o m
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.2
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    AddAndStoreTerminal other = (AddAndStoreTerminal) a_other;
    return new CompareToBuilder().append(m_storageName, other.m_storageName).append(m_type, other.m_type)
            .toComparison();
}

From source file:org.jgap.gp.function.ADF.java

/**
 * The compareTo-method.// w ww .j av a  2s.  c o  m
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.0
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    ADF other = (ADF) a_other;
    return new CompareToBuilder().append(m_chromosomeNum, other.m_chromosomeNum).toComparison();
}

From source file:org.jgap.gp.function.CharacterProvider.java

/**
 * The compareTo-method.//from   w w  w .  j a  v  a2 s .c om
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.4.3
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    CharacterProvider other = (CharacterProvider) a_other;
    return new CompareToBuilder().append(m_alphabet, other.m_alphabet).toComparison();
}

From source file:org.jgap.gp.function.CountMatrix.java

/**
 * The compareTo-method.//from  w w w  .ja v  a 2  s  .  c  om
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.4.3
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    CountMatrix other = (CountMatrix) a_other;
    return new CompareToBuilder().append(m_matrixName, other.m_matrixName)
            .append(m_countType, other.m_countType).append(m_countMode, other.m_countMode)
            .append(m_emptyCharacter, other.m_emptyCharacter)
            .append(m_specificCharacter, other.m_specificCharacter)
            .append(getSubChildTypes(), other.getSubChildTypes()).toComparison();
}

From source file:org.jgap.gp.function.ExchangeMemory.java

/**
 * The compareTo-method./*from ww w . j av a2s . c o  m*/
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.2
 */
public int compareTo(Object a_other) {
    if (a_other == null) {
        return 1;
    } else {
        ExchangeMemory other = (ExchangeMemory) a_other;
        return new CompareToBuilder().append(m_sourceStorageName, other.m_sourceStorageName)
                .append(m_targetStorageName, other.m_targetStorageName).toComparison();
    }
}

From source file:org.jgap.gp.function.ForLoop.java

/**
 * The compareTo-method./* w  w  w.  jav a2s  .com*/
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.0
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    ForLoop other = (ForLoop) a_other;
    return new CompareToBuilder().append(m_typeVar, other.m_typeVar).append(m_maxLoop, other.m_maxLoop)
            .append(m_startIndex, other.m_startIndex).append(m_endIndex, other.m_endIndex)
            .append(m_increment, other.m_increment).toComparison();
}

From source file:org.jgap.gp.function.ForXLoop.java

/**
 * The compareTo-method./*from w  w w .  j  a v  a  2  s .c o m*/
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.0
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    ForXLoop other = (ForXLoop) a_other;
    return new CompareToBuilder().append(m_type, other.m_type).toComparison();
}

From source file:org.jgap.gp.function.Increment.java

/**
 * The compareTo-method.//from   ww  w.  j av a  2  s .  co m
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.0
 */
public int compareTo(Object a_other) {
    int result = super.compareTo(a_other);
    if (result != 0) {
        return result;
    }
    Increment other = (Increment) a_other;
    return new CompareToBuilder().append(m_increment, other.m_increment).toComparison();
}

From source file:org.jgap.gp.function.IncrementMemory.java

/**
 * The compareTo-method.//w w  w.j  ava  2s  .  c o m
 *
 * @param a_other the other object to compare
 * @return -1, 0, 1
 *
 * @author Klaus Meffert
 * @since 3.2
 */
public int compareTo(Object a_other) {
    if (a_other == null) {
        return 1;
    } else {
        IncrementMemory other = (IncrementMemory) a_other;
        return new CompareToBuilder().append(m_increment, other.m_increment)
                .append(m_memoryName, other.m_memoryName).toComparison();
    }
}