Package java.nio

Examples of java.nio.CharBuffer.compareTo()


    CharBuffer other = CharBuffer.allocate(buf.capacity());
    other.put(buf);
    other.clear();
    buf.clear();
    assertEquals(0, buf.compareTo(other));
    assertEquals(0, other.compareTo(buf));
    buf.position(1);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
View Full Code Here


    buf.clear();
    assertEquals(0, buf.compareTo(other));
    assertEquals(0, other.compareTo(buf));
    buf.position(1);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
    assertTrue(other.compareTo(buf) > 0);
    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
View Full Code Here

    buf.position(1);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
    assertTrue(other.compareTo(buf) > 0);
    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
    assertTrue(other.compareTo(buf) == 0);
    other.limit(SMALL_TEST_LENGTH);
    assertTrue(buf.compareTo(other) > 0);
View Full Code Here

    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
    assertTrue(other.compareTo(buf) > 0);
    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
    assertTrue(other.compareTo(buf) == 0);
    other.limit(SMALL_TEST_LENGTH);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
  }
View Full Code Here

    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
    assertTrue(other.compareTo(buf) == 0);
    other.limit(SMALL_TEST_LENGTH);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
  }

  public void testDuplicate() {
    // mark the position 0
    buf.clear();
View Full Code Here

    CharBuffer other = CharBuffer.allocate(buf.capacity());
    other.put(buf);
    other.clear();
    buf.clear();
    assertEquals(0, buf.compareTo(other));
    assertEquals(0, other.compareTo(buf));
    buf.position(1);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
View Full Code Here

    buf.clear();
    assertEquals(0, buf.compareTo(other));
    assertEquals(0, other.compareTo(buf));
    buf.position(1);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
    assertTrue(other.compareTo(buf) > 0);
    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
View Full Code Here

    buf.position(1);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
    assertTrue(other.compareTo(buf) > 0);
    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
    assertTrue(other.compareTo(buf) == 0);
    other.limit(SMALL_TEST_LENGTH);
    assertTrue(buf.compareTo(other) > 0);
View Full Code Here

    other.position(2);
    assertTrue(buf.compareTo(other) < 0);
    assertTrue(other.compareTo(buf) > 0);
    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
    assertTrue(other.compareTo(buf) == 0);
    other.limit(SMALL_TEST_LENGTH);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
  }
View Full Code Here

    buf.position(2);
    assertTrue(buf.compareTo(other) == 0);
    assertTrue(other.compareTo(buf) == 0);
    other.limit(SMALL_TEST_LENGTH);
    assertTrue(buf.compareTo(other) > 0);
    assertTrue(other.compareTo(buf) < 0);
  }

  public void testDuplicate() {
    // mark the position 0
    buf.clear();
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.