Examples of IntDoublePair


Examples of com.gs.collections.api.tuple.primitive.IntDoublePair

                int[] keys = IntDoubleHashMap.this.keys;
                while (!isNonSentinel(keys[this.position]))
                {
                    this.position++;
                }
                IntDoublePair result = PrimitiveTuples.pair(keys[this.position], IntDoubleHashMap.this.values[this.position]);
                this.position++;
                return result;
            }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

*/
@Test(groups = TestGroup.UNIT)
public class IntDoublePairTest {

  public void test_IntDoublePair_of() {
    IntDoublePair test = IntDoublePair.of(1, 2.5d);
    assertEquals(new IntDoublePair(1, 2.5d), test);
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    IntDoublePair test = IntDoublePair.of(1, 2.5d);
    assertEquals(new IntDoublePair(1, 2.5d), test);
  }

  public void testConstructionGets() {
    IntDoublePair test = new IntDoublePair(1, 2.0d);
    assertEquals(Integer.valueOf(1), test.getFirst());
    assertEquals(Double.valueOf(2.0d), test.getSecond());
    assertEquals(1, test.getFirstInt());
    assertEquals(2.0d, test.getSecondDouble(), 1E-10);
    assertEquals(Integer.valueOf(1), test.getFirst());
    assertEquals(Double.valueOf(2.0d), test.getSecond());
    assertEquals(1, test.getFirstInt());
    assertEquals(2.0d, test.getSecondDouble(), 1E-10);
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

  }

  //-------------------------------------------------------------------------
  @Test(expectedExceptions = UnsupportedOperationException.class)
  public void testSetValue() {
    IntDoublePair pair = new IntDoublePair(2, -0.3d);
    pairToEntry(pair).setValue(Double.valueOf(1.2d));
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    pairToEntry(pair).setValue(Double.valueOf(1.2d));
  }

  @Test(expectedExceptions = UnsupportedOperationException.class)
  public void testSetValue_null() {
    IntDoublePair pair = new IntDoublePair(2, -0.3d);
    pairToEntry(pair).setValue(null);
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    pairToEntry(pair).setValue(null);
  }

  @Test(expectedExceptions = UnsupportedOperationException.class)
  public void testSetValue_primitives() {
    IntDoublePair pair = new IntDoublePair(2, -0.3d);
    pairToEntry(pair).setValue(1.2d);
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    pairToEntry(pair).setValue(1.2d);
  }

  //-------------------------------------------------------------------------
  public void compareTo() {
    IntDoublePair ab = Pair.of(1, 1.7d);
    IntDoublePair ac = Pair.of(1, 1.9d);
    IntDoublePair ba = Pair.of(2, 1.5d);

    FirstThenSecondPairComparator<Integer, Double> comparator = new FirstThenSecondPairComparator<Integer, Double>();
    assertTrue(comparator.compare(ab, ab) == 0);
    assertTrue(comparator.compare(ac, ab) > 0);
    assertTrue(comparator.compare(ba, ab) > 0);
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    assertTrue(comparator.compare(ac, ba) < 0);
    assertTrue(comparator.compare(ba, ba) == 0);
  }

  public void testEquals() {
    IntDoublePair a = new IntDoublePair(1, 2.0);
    IntDoublePair b = new IntDoublePair(1, 3.0);
    IntDoublePair c = new IntDoublePair(2, 2.0);
    IntDoublePair d = new IntDoublePair(2, 3.0);
    assertEquals(true, a.equals(a));
    assertEquals(false, a.equals(b));
    assertEquals(false, a.equals(c));
    assertEquals(false, a.equals(d));

    assertEquals(false, b.equals(a));
    assertEquals(true, b.equals(b));
    assertEquals(false, b.equals(c));
    assertEquals(false, b.equals(d));

    assertEquals(false, c.equals(a));
    assertEquals(false, c.equals(b));
    assertEquals(true, c.equals(c));
    assertEquals(false, c.equals(d));

    assertEquals(false, d.equals(a));
    assertEquals(false, d.equals(b));
    assertEquals(false, d.equals(c));
    assertEquals(true, d.equals(d));
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    assertEquals(false, d.equals(c));
    assertEquals(true, d.equals(d));
  }

  public void testEquals_toObjectVersion() {
    IntDoublePair a = Pair.of(1, 1.7d);
    Pair<Integer, Double> b = Pair.of(Integer.valueOf(1), Double.valueOf(1.7d));
    assertEquals(true, a.equals(b));
    assertEquals(true, b.equals(a));
  }
View Full Code Here

Examples of com.opengamma.util.tuple.IntDoublePair

    assertEquals(true, b.equals(a));
  }

  public void testEquals_toObjectVersion_null() {
    Pair<Integer, Double> a = Pair.of(null, Double.valueOf(1.9d));
    IntDoublePair b = Pair.of(1, 1.7d);
    assertEquals(true, a.equals(a));
    assertEquals(false, a.equals(b));
    assertEquals(false, b.equals(a));
    assertEquals(true, b.equals(b));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.