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

com.javanut.pronghorn.pipe.util.IntWriteOnceOrderedSet 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;

/**
 * Write once list (immutable after write)
 * Not thread safe
 * Easily in-lines
 * Creates no runtime garbage
 * 
 * @author Nathan Tippy
 *
 */
public class IntWriteOnceOrderedSet {

	final int[] data;
	int idx;
		
	public IntWriteOnceOrderedSet(int bits) {
		//Should not be used for lists with more than 1 million elements.
		assert(bits<20) : "There are much better choices than this algo for large lists.";
		
		int size = 1<




© 2015 - 2025 Weber Informatics LLC | Privacy Policy