Example usage for org.apache.lucene.util FixedBitSet equals

List of usage examples for org.apache.lucene.util FixedBitSet equals

Introduction

In this page you can find the example usage for org.apache.lucene.util FixedBitSet equals.

Prototype

@Override
    public boolean equals(Object o) 

Source Link

Usage

From source file:de.unihildesheim.iw.lucene.util.BitsUtilsTest.java

License:Open Source License

@Test
public void testBits2FixedBitSet() throws Exception {
    final FixedBitSet fbs = new FixedBitSet(11);
    fbs.set(1);/*from ww  w  . j  a va 2s  .  c om*/
    fbs.set(3);
    fbs.set(6);
    fbs.set(7);
    fbs.set(8);
    fbs.set(10);

    final FixedBitSet result = BitsUtils.bits2FixedBitSet(fbs);
    Assert.assertTrue("BitSets not equal.", fbs.equals(result));
}

From source file:de.unihildesheim.iw.lucene.util.BitsUtilsTest.java

License:Open Source License

@Test
public void testArrayToBits() throws Exception {
    final FixedBitSet fbs = new FixedBitSet(11);
    fbs.set(1);//from ww w . j  av  a 2 s.c o  m
    fbs.set(3);
    fbs.set(6);
    fbs.set(7);
    fbs.set(8);
    fbs.set(10);
    final int[] bits = { 1, 3, 6, 7, 8, 10 };

    final FixedBitSet result = BitsUtils.arrayToBits(bits);
    Assert.assertTrue("BitSets not equal.", fbs.equals(result));
}

From source file:de.unihildesheim.iw.lucene.util.BitsUtilsTest.java

License:Open Source License

@SuppressWarnings({ "ZeroLengthArrayAllocation", "RedundantArrayCreation" })
@Test/*from  www.j a  v  a2s . co m*/
public void testArrayToBits_empty() throws Exception {
    final FixedBitSet fbs = new FixedBitSet(0);
    final FixedBitSet result = BitsUtils.arrayToBits(new int[] {});
    Assert.assertTrue("BitSets not equal.", fbs.equals(result));
}

From source file:org.elasticsearch.index.search.child.AbstractChildTests.java

License:Apache License

static void assertBitSet(FixedBitSet actual, FixedBitSet expected, IndexSearcher searcher) throws IOException {
    if (!actual.equals(expected)) {
        Description description = new StringDescription();
        description.appendText(reason(actual, expected, searcher));
        description.appendText("\nExpected: ");
        description.appendValue(expected);
        description.appendText("\n     got: ");
        description.appendValue(actual);
        description.appendText("\n");
        throw new java.lang.AssertionError(description.toString());
    }/*from w  w  w  .j  av a2  s  .co  m*/
}