@Test public void testToString() { assertEquals("0000000000", filter.toString()); filter.add("one"); filter.add("two"); filter.add("three"); filter.add("four"); filter.add("five"); assertEquals("1010101010", filter.toString()); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(getNumberOfBits()); for (int i = 0; i < numBits; i++) { sb.append(bits.get(i) ? "1" : 0); } return sb.toString(); }
DefaultBloomFilter implements BloomFilter<T> { @Override public String toString() { final StringBuilder sb = new StringBuilder(getNumberOfBits()); for (int i = 0; i < numBits; i++) { sb.append(bits.get(i) ? "1" : 0); } return sb.toString(); } }
DefaultBloomFilter implements BloomFilter<T> { @Override public String toString() { final StringBuilder sb = new StringBuilder(getNumberOfBits()); for (int i = 0; i < numBits; i++) { sb.append(bits.get(i) ? "1" : 0); } return sb.toString(); } @SafeVarargs  DefaultBloomFilter(final int numBits, final Function<T, Integer>... hashFunctions); }
DefaultBloomFilter implements BloomFilter<T> { @Override public String toString() { final StringBuilder sb = new StringBuilder(getNumberOfBits()); for (int i = 0; i < numBits; i++) { sb.append(bits.get(i) ? "1" : 0); } return sb.toString(); } @SafeVarargs  DefaultBloomFilter(final int numBits, final Function<T, Integer>... hashFunctions); @Override boolean probablyContains(final T element); @Override void add(final T element); @Override int getNumberOfActiveBits(); @Override int getNumberOfBits(); @Override int getNumberOfHashFunctions(); @Override String toString(); }
DefaultBloomFilter implements BloomFilter<T> { @Override public String toString() { final StringBuilder sb = new StringBuilder(getNumberOfBits()); for (int i = 0; i < numBits; i++) { sb.append(bits.get(i) ? "1" : 0); } return sb.toString(); } @SafeVarargs  DefaultBloomFilter(final int numBits, final Function<T, Integer>... hashFunctions); @Override boolean probablyContains(final T element); @Override void add(final T element); @Override int getNumberOfActiveBits(); @Override int getNumberOfBits(); @Override int getNumberOfHashFunctions(); @Override String toString();  }