Class TransformationListUtil
java.lang.Object
de.bernd_michaely.common.desktop.fx.collections.selection.TransformationListUtil
Utility for index calculations on TransformationList chains.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getViewIndexFor
(@Nullable ObservableList<?> sourceList, @Nullable TransformationList<?, ?> transformationList, int index) Maps the given index of the source list to an index in the transformation list.static int
getViewIndexFor
(@Nullable TransformationList<?, ?> transformationList, int index) Maps the given index of the transformation lists direct source list to an index in the transformation list.
-
Constructor Details
-
TransformationListUtil
public TransformationListUtil()
-
-
Method Details
-
getViewIndexFor
Maps the given index of the transformation lists direct source list to an index in the transformation list. Returns a negative value, if the source index is not mapped. This method is also a workaround for undefined index-out-of-bounds behavior ofTransformationList.getViewIndex(int)
.- Parameters:
transformationList
- the given transformation listindex
- the given source list index- Returns:
- the corresponding transformation list index
- Throws:
IllegalArgumentException
- if the source list is not in the transformation chain- Since:
- 2.0
- See Also:
-
getViewIndexFor
public static int getViewIndexFor(@Nullable ObservableList<?> sourceList, @Nullable TransformationList<?, ?> transformationList, int index) Maps the given index of the source list to an index in the transformation list. Returns a negative value, if the source index is not mapped. This method is also a workaround for undefined index-out-of-bounds behavior ofTransformationList.getViewIndex(int)
.- Parameters:
sourceList
- the given source listtransformationList
- the given transformation listindex
- the given source list index- Returns:
- the corresponding transformation list index
- Throws:
IllegalArgumentException
- if the source list is not in the transformation chain- See Also:
-