/** Wraps a given iterable, returning an iterable that contains {@linkplain BitVector bit vectors}. * * @param iterable an iterable. * @param transformationStrategy a strategy to transform the object contained in <code>iterable</code>. * @return an iterable that has the content of <code>iterable</code> passed through <code>transformationStrategy</code>. */ @SuppressWarnings("unchecked") public static <T> Iterable<BitVector> wrap( final Iterable<T> iterable, final TransformationStrategy<? super T> transformationStrategy ) { return (Iterable<BitVector>)( transformationStrategy == IDENTITY ? iterable : new IterableWrapper<T>( iterable, transformationStrategy ) ); }
/** Wraps a given iterable, returning an iterable that contains {@linkplain BitVector bit vectors}. * * @param iterable an iterable. * @param transformationStrategy a strategy to transform the object contained in <code>iterable</code>. * @return an iterable that has the content of <code>iterable</code> passed through <code>transformationStrategy</code>. */ @SuppressWarnings("unchecked") public static <T> Iterable<BitVector> wrap(final Iterable<T> iterable, final TransformationStrategy<? super T> transformationStrategy) { return (Iterable<BitVector>)(transformationStrategy == IDENTITY ? iterable : new IterableWrapper<>(iterable, transformationStrategy)); }
/** Wraps a given iterable, returning an iterable that contains {@linkplain BitVector bit vectors}. * * @param iterable an iterable. * @param transformationStrategy a strategy to transform the object contained in <code>iterable</code>. * @return an iterable that has the content of <code>iterable</code> passed through <code>transformationStrategy</code>. */ @SuppressWarnings("unchecked") public static <T> Iterable<BitVector> wrap( final Iterable<T> iterable, final TransformationStrategy<? super T> transformationStrategy ) { return (Iterable<BitVector>)( transformationStrategy == IDENTITY ? iterable : new IterableWrapper<T>( iterable, transformationStrategy ) ); }