Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
* {@code SequencedData} objects are used to store sequenced data in a CHAMP
* trie (see {@link Node}).
*
* The kind of data is specified in concrete implementations of this
* interface.
*
* All sequence numbers of {@code SequencedData} objects in the same CHAMP trie
* are unique. Sequence numbers range from {@link Integer#MIN_VALUE} (exclusive)
* to {@link Integer#MAX_VALUE} (inclusive).
*/
public interface SequencedData {
/**
* We use {@link Integer#MIN_VALUE} to detect overflows in the sequence number.
*
* {@link Integer#MIN_VALUE} is the only integer number which can not
* be negated.
*
* Therefore, we can not use {@link Integer#MIN_VALUE} as a sequence number
* anyway.
*/
int NO_SEQUENCE_NUMBER = Integer.MIN_VALUE;
static boolean vecMustRenumber(int size, int offset, int vectorSize) {
return size == 0
|| vectorSize >>> 1 > size
|| (long) vectorSize - offset > Integer.MAX_VALUE - 2
|| offset < Integer.MIN_VALUE + 2;
}
/**
* Renumbers the sequence numbers in all nodes from {@code 0} to {@code size}.
*
* Afterward, the sequence number for the next inserted entry must be
* set to the value {@code size};
*
* @param
* @param owner
* @param size the size of the trie
* @param root the root of the trie
* @param vector the sequence root of the trie
* @param hashFunction the hash function for data elements
* @param equalsFunction the equals function for data elements
* @param factoryFunction the factory function for data elements
* @return a new renumbered root and a new vector with matching entries
*/
@SuppressWarnings("unchecked")
static OrderedPair, VectorList