Package edu.umd.cloud9.util.array

Examples of edu.umd.cloud9.util.array.ArrayListOfShorts.sort()


    assertEquals(0, a.size());

    a.add(5.2f).add(6f).add(5.9f).add(4.1f);
    assertEquals(4, a.size());

    a.sort();
    assertEquals(4, a.size());

    assertTrue(Math.abs(a.get(0)-4.1) < 0.0001);
    assertTrue(Math.abs(a.get(1)-5.2) < 0.0001);
    assertTrue(Math.abs(a.get(2)-5.9) < 0.0001);
View Full Code Here


  @Test
  public void testIntersection1() {
    ArrayListOfDoubles a = new ArrayListOfDoubles();
    a.add(5).add(3).add(1);

    a.sort();

    ArrayListOfDoubles b = new ArrayListOfDoubles();
    b.add(0).add(1).add(2).add(3);

    ArrayListOfDoubles c = a.intersection(b);
View Full Code Here

    assertEquals(0, a.size());

    a.add(5.2f).add(6f).add(5.9f).add(4.1f);
    assertEquals(4, a.size());

    a.sort();
    assertEquals(4, a.size());

    assertTrue(Math.abs(a.get(0)-4.1) < 0.0001);
    assertTrue(Math.abs(a.get(1)-5.2) < 0.0001);
    assertTrue(Math.abs(a.get(2)-5.9) < 0.0001);
View Full Code Here

  @Test
  public void testIntersection1() {
    ArrayListOfFloats a = new ArrayListOfFloats();
    a.add(5).add(3).add(1);

    a.sort();

    ArrayListOfFloats b = new ArrayListOfFloats();
    b.add(0).add(1).add(2).add(3);

    ArrayListOfFloats c = a.intersection(b);
View Full Code Here

    }

    // for each source token id, sort ids of its translations in ascending order
    for(Integer f : one2manyAlign.keySet()) {
      ArrayListOfInts lst = one2manyAlign.get(f);
      lst.sort();
      one2manyAlign.put(f, lst);
    }

    return one2manyAlign;
  }
View Full Code Here

    }

    // for each source token id, sort ids of its translations in ascending order
    for(Integer f : one2manyAlign.keySet()) {
      ArrayListOfInts lst = one2manyAlign.get(f);
      lst.sort();
      one2manyAlign.put(f, lst);
    }

    return one2manyAlign;
  }
View Full Code Here

    }

    // for each source token id, sort ids of its translations in ascending order
    for(Integer f : one2manyAlign.keySet()) {
      ArrayListOfInts lst = one2manyAlign.get(f);
      lst.sort();
      one2manyAlign.put(f, lst);
    }

    return one2manyAlign;
  }
View Full Code Here

    a.add((short) 6);
    a.add((short) 1);
    a.add((short) 4);
    assertEquals(4, a.size());

    a.sort();
    assertEquals(4, a.size());

    assertEquals(1, a.get(0));
    assertEquals(4, a.get(1));
    assertEquals(5, a.get(2));
View Full Code Here

    ArrayListOfShorts a = new ArrayListOfShorts();
    a.add((short) 5);
    a.add((short) 3);
    a.add((short) 1);

    a.sort();

    ArrayListOfShorts b = new ArrayListOfShorts();
    b.add((short) 0);
    b.add((short) 1);
    b.add((short) 2);
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.