Class OrderedMap<T>
- java.lang.Object
-
- org.talend.sdk.component.api.record.OrderedMap<T>
-
- Type Parameters:
T
- : type of element.
public class OrderedMap<T> extends Object
On TCK Record, we have to control order of elements with keeping efficient access. LinkedHashMap has efficient access, but order of element is only the order of insertions. List (ArrayList, LinkedList) allow to fine control order but have inefficent access. This class aims to control element order with keeping efficient access.
-
-
Constructor Summary
Constructors Constructor Description OrderedMap(Function<T,String> identifierGetter)
OrderedMap(Function<T,String> identifierGetter, Iterable<T> inputValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(T value)
void
forEachValue(Consumer<T> valueConsumer)
T
getValue(String identifier)
void
moveAfter(String pivotIdentifier, T valueToMove)
void
moveBefore(String pivotIdentifier, T valueToMove)
New Value should take place before 'pivotIdentifier' valuevoid
removeValue(T value)
void
replace(String identifier, T newValue)
Stream<T>
streams()
void
swap(String first, String second)
-
-
-
Constructor Detail
-
OrderedMap
public OrderedMap(Function<T,String> identifierGetter)
-
-
Method Detail
-
forEachValue
public void forEachValue(Consumer<T> valueConsumer)
-
removeValue
public void removeValue(T value)
-
moveBefore
public void moveBefore(String pivotIdentifier, T valueToMove)
New Value should take place before 'pivotIdentifier' value- Parameters:
pivotIdentifier
- : value pivotIdentifier to move before (pivot).valueToMove
- : value to move.
-
-