VictoriqueMoe / TimedSet

a Timed set in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

timed set in Java

A simple timed set that will evict items after they have been added to the set.

Usage:

final var timedSet = new TimedSet<>(1000);
timedSet.add(1);
Thread.sleep(1050);
timedSet.add(2);
timedSet.contains(1); // false
timedSet.contains(2); // true
Thread.sleep(1050);
timedSet.contains(2); // false

Also supports refreshing an item.

The Timed Set fully implements the Set interface

About

a Timed set in Java


Languages

Language:Java 100.0%