package com.onaro.util.jfc.tables.filter.matcher; import java.util.*; public abstract class CompositeFilterMatcher implements FilterMatcher { protected FilterMatcher x; protected FilterMatcher y; protected CompositeFilterMatcher(FilterMatcher x, FilterMatcher y) { this.x = x; this.y = y; } public abstract boolean isAccepted(Object value); /** * Collect the ranges from both FilterMatchers. * @param value the filtered value * @return ranges that mathes the filter pattern in the value in both matchers */ public List getAcceptedRange(Object value) { List acceptedRanges = x.getAcceptedRange(value); acceptedRanges.addAll(y.getAcceptedRange(value)); return acceptedRanges; } }