Top Fields Constructors Methods
com.vladsch.flexmark.experimental.util.sequence.managed

public Class BaseSequenceManager

extends Object
Class Inheritance
Imports
com.vladsch.flexmark.util.sequence.BasedSequence, .SubSequence, org.jetbrains.annotations.NotNull, .Nullable, java.lang.ref.WeakReference, java.util.Map, .WeakHashMap, java.util.function.Function

Field Summary

Modifier and TypeField and Description
private final @NotNull WeakHashMap<Object, WeakReference<BasedSequence>>
private final @NotNull WeakHashMap<BasedSequence, BaseSequenceEntry>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <
type of base character sequence
T
>
@NotNull BasedSequence

Returns:

existing equivalent base or newly created base
getBaseSequence
(T
object for the underlying based sequence base
object
,
@Nullable int[]
one element array for type of tests done to find result NOTE: 0 if map lookup, 10 - set search, 20 - construct and add to map/set with units digit giving max testEquals call type from all tests done
callTypes
,
@NotNull Function<T, BasedSequence>
factory to create based sequence from the object
factory
)

Get an equivalent existing based sequence base or a new one created by passed factory

Note

should only be called by base sequence which are the base for their category: SubSequence implementing managed sequence base

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseMapback to summary
private final @NotNull WeakHashMap<Object, WeakReference<BasedSequence>> baseMap
Annotations
@NotNull
baseSetback to summary
private final @NotNull WeakHashMap<BasedSequence, BaseSequenceEntry> baseSet
Annotations
@NotNull

Constructor Detail

BaseSequenceManagerback to summary
public BaseSequenceManager()

Method Detail

getBaseSequenceback to summary
public <T> @NotNull BasedSequence getBaseSequence(T object, @Nullable int[] callTypes, @NotNull Function<T, BasedSequence> factory)

Get an equivalent existing based sequence base or a new one created by passed factory

Note

should only be called by base sequence which are the base for their category: SubSequence implementing managed sequence base

all others should delegate to these sequences for creating the base

Parameters
<T>
type of base character sequence
object:T

object for the underlying based sequence base

callTypes:@Nullable int[]

one element array for type of tests done to find result NOTE: 0 if map lookup, 10 - set search, 20 - construct and add to map/set with units digit giving max testEquals call type from all tests done

factory:@NotNull Function<T, BasedSequence>

factory to create based sequence from the object

Returns:@NotNull BasedSequence

existing equivalent base or newly created base

Annotations
@NotNull