com.javanut.pronghorn.pipe.util.IntWriteOnceOrderedSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pronghorn-pipes Show documentation
Show all versions of pronghorn-pipes Show documentation
Ring buffer based queuing utility for applications that require high performance and/or a small
footprint. Well suited for embedded and stream based processing.
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