Skip to content

osteele/SparseRingBuffer.java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SpringRingBuffer.java

SparseRingBuffer implements a sparse list of integers stored in a fixed-size ring buffer.

The buffer is sparse in time, not space: like a ring buffer, it uses fixed-size arrays that are sized for the largest possible number of samples; but like a linked list, each entry contains a pointer to the next populated entry, and is possible to skip entries.

The class uses names from java.util.AbstractList and java.util.AbstractCollection, but it does not implement those interfaces: first, because it implements only the functionality that I have needed for my specific use cases; second, because it is specalized to the int primitive type, which is not possible at the time of this writing with Java generics.

I wrote this for https://github.com/osteele/SerialPlotter, and ended up developing this part of it outside of Processing so that I could use Java development tools to develop the ring buffer class.

License

Copyright (c) 2022 Oliver Steele.

Available under the MIT License.

About

Sparse list of integers using a fixed-size ring buffer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages