Top Description Fields Constructors Methods
com.sun.javafx.scene.control

public Class SizeLimitedList<E>

extends Object
Class Inheritance
Type Parameters
<E>
The type of the items added into the list.
Imports
java.util.LinkedList, .List, java.util.function.Predicate

A list that has a maximum size. Useful for recording historical data, but not too much of it.

Items are added at the front of the list. That is, the item at index 0 is more recent than that added at index 1. In this regard, this class resembles a stack.

Field Summary

Modifier and TypeField and Description
private final List<E>
private final int

Constructor Summary

AccessConstructor and Description
public
SizeLimitedList(int maxSize)

Method Summary

Modifier and TypeMethod and Description
public void
add(E item)

public void
public boolean
contains(E item)

public E
get(int index)

public void
removeIf(Predicate<? super E> predicate)

public int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backingListback to summary
private final List<E> backingList
maxSizeback to summary
private final int maxSize

Constructor Detail

SizeLimitedListback to summary
public SizeLimitedList(int maxSize)

Method Detail

addback to summary
public void add(E item)
clearback to summary
public void clear()
containsback to summary
public boolean contains(E item)
getback to summary
public E get(int index)
removeIfback to summary
public void removeIf(Predicate<? super E> predicate)
sizeback to summary
public int size()