clear()
and a cheap random eviction via evict().
This object must be accessed from the FX application thread, although it does not check.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final HashMap | |
| private final FastCache. | |
| private static final Random | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public int | |
| public void | |
| protected int | |
| public T | |
| public int |
| data | back to summary |
|---|---|
| private final HashMap<Integer, T> data | |
| linear | back to summary |
|---|---|
| private final FastCache. | |
| random | back to summary |
|---|---|
| private static final Random random | |
| size | back to summary |
|---|---|
| private int size | |
| FastCache | back to summary |
|---|---|
| public FastCache(int capacity) | |
| add | back to summary |
|---|---|
| public void add(int index, T cell) Adds a new cell to the cache. When the cache is full, this method evicts a random cell from the cache first. Note this method does not check whether
another cell for the given row is present, so this call must be preceded by a
| |
| capacity | back to summary |
|---|---|
| public int capacity() | |
| clear | back to summary |
|---|---|
| public void clear() | |
| evict | back to summary |
|---|---|
| protected int evict() returns an index in the linear array of the cell that has been evicted | |
| get | back to summary |
|---|---|
| public T get(int row) | |
| size | back to summary |
|---|---|
| public int size() | |
| Modifier and Type | Field and Description |
|---|---|
| private final V | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public V | |
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| cell | back to summary |
|---|---|
| private final V cell Record Component accessed by cell(). | |
| index | back to summary |
|---|---|
| private final int index Record Component accessed by index(). | |
| Entry | back to summary |
|---|---|
| private Entry(int index, V cell) | |
| cell | back to summary |
|---|---|
| public V cell() Record Component getter of cell. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| index | back to summary |
|---|---|
| public int index() Record Component getter of index. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |