Class TrimOperationOrList<T>
Object
com.owenfeehan.pathpatternfinder.trim.TrimOperationOrList<T>
- Type Parameters:
T
- type of objects the trimmer works upon
- All Implemented Interfaces:
TrimOperation<T>
public class TrimOperationOrList<T> extends Object implements TrimOperation<T>
Tries to apply each operation in a list until one is successful.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description TrimOperationOrList(List<TrimOperation<T>> operations)
Creates given a list of operations. -
Method Summary
-
Constructor Details
-
TrimOperationOrList
Creates given a list of operations.- Parameters:
operations
- the operations
-
-
Method Details
-
trim
Description copied from interface:TrimOperation
Attempts to trim the list of objects by finding aPattern
.- Specified by:
trim
in interfaceTrimOperation<T>
- Parameters:
source
- list of objects- Returns:
- if successful, a pattern with the trimmed elements (and what remains to be resolved) as elements, otherwise
Optional.empty()
if unsuccessful
-