Package de.jarnbjo.jsnappy

Examples of de.jarnbjo.jsnappy.IntIterator


  public void testSimple1() {
    IntListHashMap m = new IntListHashMap(10);
    m.put(5, 1);
    m.put(5, 2);
    m.put(5, 3);
    IntIterator i = m.getReverse(5);
    assertNotNull(i);

    assertTrue(i.next());
    assertEquals(3, i.get());

    assertTrue(i.next());
    assertEquals(2, i.get());

    assertTrue(i.next());
    assertEquals(1, i.get());
  }
View Full Code Here


    m.put(5, 3);
    m.put(15, 4);
    m.put(15, 5);
    m.put(15, 6);

    IntIterator i = m.getReverse(5);
    assertNotNull(i);

    assertTrue(i.next());
    assertEquals(3, i.get());

    assertTrue(i.next());
    assertEquals(2, i.get());

    assertTrue(i.next());
    assertEquals(1, i.get());

    assertFalse(i.next());

    i = m.getReverse(15);
    assertNotNull(i);

    assertTrue(i.next());
    assertEquals(6, i.get());

    assertTrue(i.next());
    assertEquals(5, i.get());

    assertTrue(i.next());
    assertEquals(4, i.get());

    assertFalse(i.next());
  }
View Full Code Here

    IntListHashMap m = new IntListHashMap(10);
    for(int i=1; i<=1000; i++) {
      m.put(1, i);
    }

    IntIterator ii = m.getReverse(1);
    assertNotNull(ii);

    for(int i=1000; i>=1; i--) {
      assertTrue(ii.next());
      assertEquals(i, ii.get());
    }

    assertFalse(ii.next());

  }
View Full Code Here

    IntListHashMap m = new IntListHashMap(10);
    m.put(1, 1);
    m.put(1, 1);

    IntIterator ii = m.getReverse(1);
    assertNotNull(ii);

    assertTrue(ii.next());
    assertEquals(1, ii.get());
    assertFalse(ii.next());
  }
View Full Code Here

TOP

Related Classes of de.jarnbjo.jsnappy.IntIterator

Copyright © 2018 www.massapicom. 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.