parent
d5b38edf52
commit
fd09ecccbd
|
@ -36,7 +36,7 @@ import java.util.function.IntPredicate;
|
|||
* all items, hashing may not create indices that fill the full region within a much larger filter. Imagine hashers created with {@code initial}
|
||||
* and {@code increment} values less than 255 with a filter size of 30000 and number of hash functions as 5. Ignoring the
|
||||
* tetrahedral addition (a maximum of 20 for k=5) the max index is 255 * 4 + 255 = 1275, this covers 4.25% of the filter. This also
|
||||
* ignores the negative wrapping but the behaviour is the same, some bits cannot be reached.
|
||||
* ignores the negative wrapping but the behavior is the same, some bits cannot be reached.
|
||||
* </p><p>
|
||||
* So this needs to be avoided as the filter probability assumptions will be void. If the {@code initial} and {@code increment} are larger
|
||||
* than the number of bits then the modulus will create a 'random' position and increment within the size.
|
||||
|
|
|
@ -67,9 +67,9 @@ public abstract class AbstractBitCountProducerTest extends AbstractIndexProducer
|
|||
protected abstract BitCountProducer createEmptyProducer();
|
||||
|
||||
/**
|
||||
* Gets the behaviour of the {@link BitCountProducer#forEachCount(BitCountConsumer)} method.
|
||||
* Gets the behavior of the {@link BitCountProducer#forEachCount(BitCountConsumer)} method.
|
||||
* By default returns the value of {@code getAsIndexArrayBehaviour()} method.
|
||||
* @return the behaviour.
|
||||
* @return the behavior.
|
||||
*/
|
||||
protected int getForEachCountBehaviour() {
|
||||
return getAsIndexArrayBehaviour();
|
||||
|
@ -129,8 +129,8 @@ public abstract class AbstractBitCountProducerTest extends AbstractIndexProducer
|
|||
}
|
||||
|
||||
/**
|
||||
* Test the behaviour of {@link BitCountProducer#forEachCount(BitCountConsumer)} with respect
|
||||
* to ordered and distinct indices. Currently the behaviour is assumed to be the same as
|
||||
* Test the behavior of {@link BitCountProducer#forEachCount(BitCountConsumer)} with respect
|
||||
* to ordered and distinct indices. Currently the behavior is assumed to be the same as
|
||||
* {@link IndexProducer#forEachIndex(java.util.function.IntPredicate)}.
|
||||
*/
|
||||
@Test
|
||||
|
|
|
@ -82,17 +82,17 @@ public abstract class AbstractIndexProducerTest {
|
|||
protected abstract IndexProducer createEmptyProducer();
|
||||
|
||||
/**
|
||||
* Gets the behaviour of the {@link IndexProducer#asIndexArray()} method.
|
||||
* @return the behaviour.
|
||||
* Gets the behavior of the {@link IndexProducer#asIndexArray()} method.
|
||||
* @return the behavior.
|
||||
* @see #ORDERED
|
||||
* @see #DISTINCT
|
||||
*/
|
||||
protected abstract int getAsIndexArrayBehaviour();
|
||||
|
||||
/**
|
||||
* Gets the behaviour of the {@link IndexProducer#forEachIndex(IntPredicate)} method.
|
||||
* Gets the behavior of the {@link IndexProducer#forEachIndex(IntPredicate)} method.
|
||||
* By default returns the value of {@code getAsIndexArrayBehaviour()} method.
|
||||
* @return the behaviour.
|
||||
* @return the behavior.
|
||||
* @see #ORDERED
|
||||
* @see #DISTINCT
|
||||
*/
|
||||
|
@ -173,8 +173,8 @@ public abstract class AbstractIndexProducerTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests the behaviour of {@code IndexProducer.asIndexArray()}.
|
||||
* The expected behaviour is defined by the {@code getBehaviour()} method.
|
||||
* Tests the behavior of {@code IndexProducer.asIndexArray()}.
|
||||
* The expected behavior is defined by the {@code getBehaviour()} method.
|
||||
* The index array may be Ordered, Distinct or both.
|
||||
* If the index array is not distinct then all elements returned by the {@code getExpectedIndices()}
|
||||
* method, including duplicates, are expected to be returned by the {@code asIndexArray()} method.
|
||||
|
@ -201,8 +201,8 @@ public abstract class AbstractIndexProducerTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests the behaviour of {@code IndexProducer.forEachIndex()}.
|
||||
* The expected behaviour is defined by the {@code getBehaviour()} method.
|
||||
* Tests the behavior of {@code IndexProducer.forEachIndex()}.
|
||||
* The expected behavior is defined by the {@code getBehaviour()} method.
|
||||
* The order is assumed to follow the order produced by {@code IndexProducer.asIndexArray()}.
|
||||
*/
|
||||
@Test
|
||||
|
|
|
@ -51,7 +51,7 @@ public class DefaultBitCountProducerTest extends AbstractBitCountProducerTest {
|
|||
|
||||
@Override
|
||||
protected int getForEachIndexBehaviour() {
|
||||
// The default method has the same behaviour as the forEachCount() method.
|
||||
// The default method has the same behavior as the forEachCount() method.
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ import org.junit.jupiter.api.Test;
|
|||
* <p>
|
||||
* <b>Indicate Collection Behaviour</b>
|
||||
* <p>
|
||||
* Override these if your collection makes specific behaviour guarantees:
|
||||
* Override these if your collection makes specific behavior guarantees:
|
||||
* <ul>
|
||||
* <li>{@link #getIterationBehaviour()}</li>
|
||||
* </ul>
|
||||
|
@ -144,7 +144,7 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
|
|||
|
||||
/**
|
||||
* Flag to indicate the collection makes no ordering guarantees for the iterator. If this is not used
|
||||
* then the behaviour is assumed to be ordered and the output order of the iterator is matched by
|
||||
* then the behavior is assumed to be ordered and the output order of the iterator is matched by
|
||||
* the toArray method.
|
||||
*/
|
||||
public static final int UNORDERED = 0x1;
|
||||
|
@ -503,11 +503,11 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a flag specifying the iteration behaviour of the collection.
|
||||
* Return a flag specifying the iteration behavior of the collection.
|
||||
* This is used to change the assertions used by specific tests.
|
||||
* The default implementation returns 0 which indicates ordered iteration behaviour.
|
||||
* The default implementation returns 0 which indicates ordered iteration behavior.
|
||||
*
|
||||
* @return the iteration behaviour
|
||||
* @return the iteration behavior
|
||||
* @see #UNORDERED
|
||||
*/
|
||||
protected int getIterationBehaviour(){
|
||||
|
|
|
@ -65,7 +65,7 @@ import org.junit.jupiter.api.Test;
|
|||
*
|
||||
* <b>Indicate Map Behaviour</b>
|
||||
* <p>
|
||||
* Override these if your map makes specific behaviour guarantees:
|
||||
* Override these if your map makes specific behavior guarantees:
|
||||
* <ul>
|
||||
* <li>{@link #getIterationBehaviour()}</li>
|
||||
* </ul>
|
||||
|
@ -532,11 +532,11 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a flag specifying the iteration behaviour of the collection.
|
||||
* Return a flag specifying the iteration behavior of the collection.
|
||||
* This is used to change the assertions used by specific tests.
|
||||
* The default implementation returns 0 which indicates ordered iteration behaviour.
|
||||
* The default implementation returns 0 which indicates ordered iteration behavior.
|
||||
*
|
||||
* @return the iteration behaviour
|
||||
* @return the iteration behavior
|
||||
* @see AbstractCollectionTest#UNORDERED
|
||||
*/
|
||||
protected int getIterationBehaviour(){
|
||||
|
|
|
@ -213,11 +213,11 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a flag specifying the iteration behaviour of the map.
|
||||
* Return a flag specifying the iteration behavior of the map.
|
||||
* This is used to change the assertions used by specific tests.
|
||||
* The default implementation returns 0 which indicates ordered iteration behaviour.
|
||||
* The default implementation returns 0 which indicates ordered iteration behavior.
|
||||
*
|
||||
* @return the iteration behaviour
|
||||
* @return the iteration behavior
|
||||
* @see AbstractCollectionTest#UNORDERED
|
||||
*/
|
||||
protected int getIterationBehaviour() {
|
||||
|
|
Loading…
Reference in New Issue