All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.javanut.pronghorn.pipe.util.hash.LongHashSet Maven / Gradle / Ivy

Go to download

Ring buffer based queuing utility for applications that require high performance and/or a small footprint. Well suited for embedded and stream based processing.

There is a newer version: 1.1.27
Show newest version
package com.javanut.pronghorn.pipe.util.hash;

import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Non-Thread safe simple fast hash for long to int mapping.
 * 
 * No set is allowed unless no previous value is found.
 * To change previous value replace must be called.
 * Remove can not be supported.
 * Key must not be zero.
 * 
 * @author Nathan Tippy
 *
 */
public class LongHashSet { 

	private final static Logger logger = LoggerFactory.getLogger(LongHashSet.class);
	private final int mask;
	
	private final long[] keys;
		
	private int space;
	
	public LongHashSet(int bits) {
		int size = 1<=0) {
		   long key = ht.keys[j];
		   if (0!=key) {			   
			   visitor.visit(key);
		   }		   
	   }	   
   }
	
	public static int computeBits(int count) {
		return (int)Math.ceil(Math.log(count)/Math.log(2));
	}


	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy