@SuppressWarnings({ "unchecked", "rawtypes" }) private static <T> List<CountValuePair<T>> unwrapCountPairs(List<CountPair<T>> pairs) { List<CountValuePair<T>> result = new ArrayList<>(); for (CountPair pair : pairs) { result.add(new CountValuePair<>(pair.value, pair.count)); } return result; }
@SuppressWarnings({ "unchecked", "rawtypes" }) private static <T> List<CountValuePair<T>> unwrapCountPairs(List<CountPair<T>> pairs) { List<CountValuePair<T>> result = new ArrayList<>(); for (CountPair pair : pairs) { result.add(new CountValuePair<>(pair.value, pair.count)); } return result; }
/** * Count value pair definition. * * @return Count value pair definition rule. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public Rule countValuePair() { return Sequence(function(Sequence(value(), comma(), longLiteral())), push(new CountValuePair((Value) pop(1), (Long) pop()))); }
/** * Count value pair definition. * * @return Count value pair definition rule. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public Rule countValuePair() { return Sequence(function(Sequence(value(), comma(), longLiteral())), push(new CountValuePair((Value) pop(1), (Long) pop()))); }