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 voidaddValue(T value)voidforEachValue(Consumer<T> valueConsumer)TgetValue(String identifier)voidmoveAfter(String pivotIdentifier, T valueToMove)voidmoveBefore(String pivotIdentifier, T valueToMove)New Value should take place before 'pivotIdentifier' valuevoidremoveValue(T value)voidreplace(String identifier, T newValue)Stream<T>streams()voidswap(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.
-
-