Package org.terrier.structures.indexing.singlepass.hadoop.SplitEmittedTerm

Examples of org.terrier.structures.indexing.singlepass.hadoop.SplitEmittedTerm.SETRawComparatorTermSplitFlush


      justification="Check String.equals is used, not ==")
  private void checkEqualityTerm(String t, int split, int flush) throws Exception
  {
    SplitEmittedTerm t1 = new SplitEmittedTerm(t, split, flush);
    SETRawComparatorTerm compare = new SETRawComparatorTerm();
    SETRawComparatorTermSplitFlush compare2 = new SETRawComparatorTermSplitFlush();
    assertEquals(0, t1.compareTo(t1));
    assertTrue(t1.equals(t1));
    assertEquals(0, compare.compare(t1, t1));
    assertEquals(0, compare2.compare(t1, t1));
    byte[] t1w = toBytes(t1);
    assertEquals(0, compare.compare(t1w, 0, t1w.length, t1w, 0, t1w.length));
    assertEquals(0, compare2.compare(t1w, 0, t1w.length, t1w, 0, t1w.length));
   
    SplitEmittedTerm t1a = new SplitEmittedTerm(new String(t), split, flush);
    assertEquals(0, t1.compareTo(t1a));
    assertEquals(0, t1a.compareTo(t1));
    assertTrue(t1.equals(t1a));
    assertTrue(t1a.equals(t1));
    assertEquals(0, compare.compare(t1, t1a));
    assertEquals(0, compare.compare(t1a, t1));
    assertEquals(0, compare2.compare(t1, t1a));
    assertEquals(0, compare2.compare(t1a, t1));
  }
View Full Code Here


  private void checkEqualityTermSplit(String t, int split1, int split2, int flush) throws Exception
  {
    SplitEmittedTerm t1 = new SplitEmittedTerm(t, split1, flush);
    SplitEmittedTerm t2 = new SplitEmittedTerm(new String(t), split2, flush);
    SETRawComparatorTerm compare = new SETRawComparatorTerm();
    SETRawComparatorTermSplitFlush compare2 = new SETRawComparatorTermSplitFlush();
   
    assertEquals(0, t1.compareTo(t1));
         
    assertFalse(t1.equals(t2));
    assertEquals(0, compare.compare(t1, t2));
    assertTrue(compare2.compare(t1, t2) < 0);
   
    byte[] t1w = toBytes(t1);
    byte[] t2w = toBytes(t2);
    assertEquals(0, compare.compare(t1w, 0, t1w.length, t2w, 0, t2w.length));
    assertTrue("Comparing t1 to t2 as bytes", compare2.compare(t1w, 0, t1w.length, t2w, 0, t2w.length)< 0);
  }
View Full Code Here

    assertTrue(t1.compareTo(t2) < 0);
    assertTrue(t2.compareTo(t1) > 0);
    assertTrue(compare.compare(t1, t2) < 0);
    assertTrue(compare.compare(t2, t1) > 0);
   
    SETRawComparatorTermSplitFlush compare2 = new SETRawComparatorTermSplitFlush();
    assertTrue(compare2.compare(t1, t2) < 0);
    assertTrue(compare2.compare(t2, t1) > 0);
    byte[] t1w = toBytes(t1);
    byte[] t2w = toBytes(t2);
    assertTrue(compare.compare(t1w, 0, t1w.length, t2w, 0, t2w.length)< 0);
    assertTrue("Comparing t1 to t2 as bytes", compare2.compare(t1w, 0, t1w.length, t2w, 0, t2w.length) < 0);
  }
View Full Code Here

    assertTrue(t1.compareTo(t2) < 0);
    assertTrue(t2.compareTo(t1) > 0);
    assertEquals(0, compare.compare(t1, t2));
    assertEquals(0, compare.compare(t2, t1));
   
    SETRawComparatorTermSplitFlush compare2 = new SETRawComparatorTermSplitFlush();
    assertTrue(compare2.compare(t1, t2) < 0);
    assertTrue(compare2.compare(t2, t1) > 0);
    byte[] t1w = toBytes(t1);
    byte[] t2w = toBytes(t2);
    assertEquals(0, compare.compare(t1w, 0, t1w.length, t2w, 0, t2w.length));
    assertEquals(0, compare.compare(t2w, 0, t2w.length, t1w, 0, t1w.length));
    assertTrue(compare2.compare(t1w, 0, t1w.length, t2w, 0, t2w.length) < 0);
    assertTrue(compare2.compare(t2w, 0, t2w.length, t1w, 0, t1w.length) > 0);
  }
View Full Code Here

    assertTrue(t1.compareTo(t2) < 0);
    assertTrue(t2.compareTo(t1) > 0);
    assertEquals(sign(t1.getTerm().compareTo(t2.getTerm())), sign(compare.compare(t1, t2)));
    assertEquals(sign(t2.getTerm().compareTo(t1.getTerm())), sign(compare.compare(t2, t1)));
   
    SETRawComparatorTermSplitFlush compare2 = new SETRawComparatorTermSplitFlush();
    assertTrue(compare2.compare(t1, t2) < 0);
    assertTrue(compare2.compare(t2, t1) > 0);
    byte[] t1w = toBytes(t1);
    byte[] t2w = toBytes(t2);
    assertEquals(sign(t1.getTerm().compareTo(t2.getTerm())), sign(compare.compare(t1w, 0, t1w.length, t2w, 0, t2w.length)));
    assertEquals(sign(t2.getTerm().compareTo(t1.getTerm())), sign(compare.compare(t2w, 0, t2w.length, t1w, 0, t1w.length)));
    assertTrue(compare2.compare(t1w, 0, t1w.length, t2w, 0, t2w.length) < 0);
    assertTrue(compare2.compare(t2w, 0, t2w.length, t1w, 0, t1w.length) > 0);
  }
View Full Code Here

TOP

Related Classes of org.terrier.structures.indexing.singlepass.hadoop.SplitEmittedTerm.SETRawComparatorTermSplitFlush

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.