Package com.chemaxon.calculations.io
Interface MemoizedSparseCollection<T>
- Type Parameters:
T
- Type of memoized items
- All Known Implementing Classes:
MemoizingIterator
,SmilesMemoizingMoleculeIterator
@Beta
@PublicAPI
@Deprecated(forRemoval=true)
@SubjectToRemoval(date=JAN_01_2025)
public interface MemoizedSparseCollection<T>
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed without replacement.
Represents an ordered sparse collection of memoized items.
Typical usage is to retrieve structure sources captured during import.
Note that the typical usage of term Memoization usually refers to an operation of storing the results of a potentially expensive calculation (see https://en.wikipedia.org/wiki/Memoization.
-
Method Summary
Modifier and TypeMethodDescriptiongetMemoized
(int i) Deprecated, for removal: This API element is subject to removal in a future version.Get a non-missing memoiozed.Deprecated, for removal: This API element is subject to removal in a future version.Function
to access captured non-missing memoizeds.getMemoizedIfPresent
(int i) Deprecated, for removal: This API element is subject to removal in a future version.Get item when present.getMemoizedOrDefault
(int i, T defaultValue) Deprecated, for removal: This API element is subject to removal in a future version.Get item when present or a default value when missing.getMemoizedOrDefaultFunction
(T defaultValue) Deprecated, for removal: This API element is subject to removal in a future version.Function
to access present items with a default value for missing items.int
size()
Deprecated, for removal: This API element is subject to removal in a future version.Collected items count.
-
Method Details
-
size
int size()Deprecated, for removal: This API element is subject to removal in a future version.Collected items count.Including missing items.
- Returns:
- collected items count
-
getMemoizedIfPresent
Deprecated, for removal: This API element is subject to removal in a future version.Get item when present.- Parameters:
i
- Index which refers to either a missing or a present element- Returns:
- Collected remembered element
-
getMemoizedOrDefault
Deprecated, for removal: This API element is subject to removal in a future version.Get item when present or a default value when missing.- Parameters:
i
- Index which refers to either a missing or a present elementdefaultValue
- value for return when missing- Returns:
- Collected remembered element or default when missing
-
getMemoized
Deprecated, for removal: This API element is subject to removal in a future version.Get a non-missing memoiozed.- Parameters:
i
- Index of an item which is not missing- Returns:
- Collected remembered item
- Throws:
NoSuchElementException
- when given index refers to a missing item
-
getMemoizedFunction
Deprecated, for removal: This API element is subject to removal in a future version.Function
to access captured non-missing memoizeds.- Returns:
- A
Function
ofInteger
to the memoized typeT
which delegates togetMemoized(int)
-
getMemoizedOrDefaultFunction
Deprecated, for removal: This API element is subject to removal in a future version.Function
to access present items with a default value for missing items.- Parameters:
defaultValue
- Value to return for missing items.- Returns:
- A
Function
ofInteger
to the memoized typeT
which delegates togetMemoizedOrDefault(int, java.lang.Object)
-