Class BaseSequenceManager
- java.lang.Object
-
- com.vladsch.flexmark.experimental.util.sequence.managed.BaseSequenceManager
-
public class BaseSequenceManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private @NotNull java.util.WeakHashMap<java.lang.Object,java.lang.ref.WeakReference<BasedSequence>>
baseMap
private @NotNull java.util.WeakHashMap<BasedSequence,BaseSequenceEntry>
baseSet
-
Constructor Summary
Constructors Constructor Description BaseSequenceManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> @NotNull BasedSequence
getBaseSequence(T object, @org.jetbrains.annotations.Nullable int[] callTypes, @NotNull java.util.function.Function<T,BasedSequence> factory)
Get an equivalent existing based sequence base or a new one created by passed factory
-
-
-
Field Detail
-
baseMap
@NotNull private final @NotNull java.util.WeakHashMap<java.lang.Object,java.lang.ref.WeakReference<BasedSequence>> baseMap
-
baseSet
@NotNull private final @NotNull java.util.WeakHashMap<BasedSequence,BaseSequenceEntry> baseSet
-
-
Method Detail
-
getBaseSequence
@NotNull public <T> @NotNull BasedSequence getBaseSequence(@NotNull T object, @Nullable @org.jetbrains.annotations.Nullable int[] callTypes, @NotNull @NotNull java.util.function.Function<T,BasedSequence> factory)
Get an equivalent existing based sequence base or a new one created by passed factoryNOTE: should only be called by base sequence which are the base for their category:
SubSequence
implementing managed sequence baseall others should delegate to these sequences for creating the base
- Type Parameters:
T
- type of base character sequence- Parameters:
object
- object for the underlying based sequence basecallTypes
- 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 donefactory
- factory to create based sequence from the object- Returns:
- existing equivalent base or newly created base
-
-