From 02162994a30c500518bf2c9e199b2ee80dfc6f2c Mon Sep 17 00:00:00 2001 From: Hannes Pernpeintner Date: Mon, 17 Aug 2015 03:54:37 +0200 Subject: [PATCH 1/5] #184 Fluent Interface pattern --- fluentinterface/pom.xml | 20 ++ .../com/iluwatar/fluentinterface/App.java | 90 ++++++++ .../fluentiterable/FluentIterable.java | 192 ++++++++++++++++++ .../com/iluwatar/fluentinterface/AppTest.java | 12 ++ pom.xml | 3 +- 5 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 fluentinterface/pom.xml create mode 100644 fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java create mode 100644 fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java create mode 100644 fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java diff --git a/fluentinterface/pom.xml b/fluentinterface/pom.xml new file mode 100644 index 000000000..c78c182e3 --- /dev/null +++ b/fluentinterface/pom.xml @@ -0,0 +1,20 @@ + + + + java-design-patterns + com.iluwatar + 1.5.0 + + 4.0.0 + + fluentinterface + + + junit + junit + test + + + \ No newline at end of file diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java new file mode 100644 index 000000000..fded13624 --- /dev/null +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java @@ -0,0 +1,90 @@ +package com.iluwatar.fluentinterface; + +import com.iluwatar.fluentinterface.fluentiterable.FluentIterable; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Function; +import java.util.function.Predicate; + +public class App { + + public static void main(String[] args) { + + List integerList = new ArrayList() {{ + add(1); + add(-61); + add(14); + add(-22); + add(18); + add(-87); + add(6); + add(64); + add(-82); + add(26); + add(-98); + add(97); + add(45); + add(23); + add(2); + add(-68); + add(45); + }}; + prettyPrint("The initial list contains: ", integerList); + + List firstFiveNegatives = FluentIterable.from(integerList) + .filter(negatives()) + .first(3) + .asList(); + prettyPrint("The first three negative values are: ", firstFiveNegatives); + + + List lastTwoPositives = FluentIterable.from(integerList) + .filter(positives()) + .last(2) + .asList(); + prettyPrint("The last two positive values are: ", lastTwoPositives); + + FluentIterable.from(integerList) + .filter(number -> number%2 == 0) + .first() + .ifPresent(evenNumber -> System.out.println(String.format("The first even number is: %d", evenNumber))); + + + List transformedList = FluentIterable.from(integerList) + .filter(negatives()) + .map(transformToString()) + .asList(); + prettyPrint("A string-mapped list of negative numbers contains: ", transformedList); + + } + + private static Function transformToString() { + return integer -> "String[" + String.valueOf(integer) + "]"; + } + private static Predicate negatives() { + return integer -> (integer < 0); + } + private static Predicate positives() { + return integer -> (integer > 0); + } + + private static void prettyPrint(String prefix, Iterable iterable) { + prettyPrint(", ", prefix, ".", iterable); + } + private static void prettyPrint(String prefix, String suffix, Iterable iterable) { + prettyPrint(", ", prefix, suffix, iterable); + } + + private static void prettyPrint(String delimiter, String prefix, String suffix, Iterable iterable) { + StringJoiner joiner = new StringJoiner(delimiter, prefix, "."); + Iterator iterator = iterable.iterator(); + while (iterator.hasNext()) { + joiner.add(iterator.next().toString()); + } + + System.out.println(joiner); + } +} diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java new file mode 100644 index 000000000..edb9275c1 --- /dev/null +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java @@ -0,0 +1,192 @@ +package com.iluwatar.fluentinterface.fluentiterable; + +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; + +/** + * The FluentIterable is a more convenient implementation of the common iterable interface based + * on the fluent interface design pattern. + * This implementation demonstrates a possible way to implement this functionality, but + * doesn't aim to be complete. It was inspired by Guava's com.google.common.collect.FluentIterable. + * @param is the class of objects the iterable contains + */ +public class FluentIterable implements Iterable { + + private final Iterable iterable; + + /** + * This constructor creates a copy of a given iterable's contents. + * @param iterable the iterable this interface copies to work on. + */ + protected FluentIterable(Iterable iterable) { + ArrayList copy = new ArrayList<>(); + Iterator iterator = iterable.iterator(); + while (iterator.hasNext()) { + copy.add(iterator.next()); + } + this.iterable = copy; + } + + /** + * Iterates over all elements of this iterator and filters them. + * @param predicate the condition to test with for the filtering. If the test + * is negative, the tested object is removed by the iterator. + * @return the same FluentIterable with a filtered collection + */ + public final FluentIterable filter(Predicate predicate) { + Iterator iterator = iterator(); + while (iterator.hasNext()) { + TYPE nextElement = iterator.next(); + if(!predicate.test(nextElement)) { + iterator.remove(); + } + } + return this; + } + + /** + * Uses the Iterable interface's forEach method to apply a given function + * for each object of the iterator. + * @param action the action for each object + * @return the same FluentIterable with an untouched collection + */ + public final FluentIterable forEachDo(Consumer action) { + iterable.forEach(action); + return this; + } + + /** + * Can be used to collect objects from the iteration. + * @return an option of the first object of the iteration + */ + public final Optional first() { + List list = first(1).asList(); + if(list.isEmpty()) { + return Optional.empty(); + } + return Optional.of(list.get(0)); + } + + /** + * Can be used to collect objects from the iteration. + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. + */ + public final FluentIterable first(int count) { + Iterator iterator = iterator(); + int currentCount = 0; + while (iterator.hasNext()) { + iterator.next(); + if(currentCount >= count) { + iterator.remove(); + } + currentCount++; + } + return this; + } + + /** + * Can be used to collect objects from the iteration. + * @return an option of the last object of the iteration + */ + public final Optional last() { + List list = last(1).asList(); + if(list.isEmpty()) { + return Optional.empty(); + } + return Optional.of(list.get(0)); + } + + /** + * Can be used to collect objects from the iteration. + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects + */ + public final FluentIterable last(int count) { + int remainingElementsCount = getRemainingElementsCount(); + Iterator iterator = iterator(); + int currentIndex = 0; + while (iterator.hasNext()) { + iterator.next(); + if(currentIndex < remainingElementsCount - count) { + iterator.remove(); + } + currentIndex++; + } + + return this; + } + + /** + * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. + * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE + * @param the target type of the transformation + * @return a new FluentIterable of the new type + */ + public final FluentIterable map(Function function) { + List temporaryList = new ArrayList(); + Iterator iterator = iterator(); + while (iterator.hasNext()) { + temporaryList.add(function.apply(iterator.next())); + } + return from(temporaryList); + } + + /** + * Collects all remaining objects of this iteration into a list. + * @return a list with all remaining objects of this iteration + */ + public List asList() { + return toList(iterable.iterator()); + } + + /** + * @return a FluentIterable from a given iterable. Calls the FluentIterable constructor. + */ + public static final FluentIterable from(Iterable iterable) { + return new FluentIterable<>(iterable); + } + + @Override + public Iterator iterator() { + return iterable.iterator(); + } + + @Override + public void forEach(Consumer action) { + iterable.forEach(action); + } + + + @Override + public Spliterator spliterator() { + return iterable.spliterator(); + } + + /** + * @return the count of remaining objects in the current iteration + */ + public final int getRemainingElementsCount() { + int counter = 0; + Iterator iterator = iterator(); + while(iterator.hasNext()) { + iterator.next(); + counter++; + } + return counter; + } + + /** + * Collects the remaining objects of the given iterators iteration into an List. + * @return a new List with the remaining objects. + */ + public static List toList(Iterator iterator) { + List copy = new ArrayList<>(); + while (iterator.hasNext()) { + copy.add(iterator.next()); + } + return copy; + } +} diff --git a/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java b/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java new file mode 100644 index 000000000..32bbca430 --- /dev/null +++ b/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java @@ -0,0 +1,12 @@ +package com.iluwatar.fluentinterface; + +import org.junit.Test; + +public class AppTest { + + @Test + public void test() { + String[] args = {}; + App.main(args); + } +} diff --git a/pom.xml b/pom.xml index 7b0d80bd8..2c040005b 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,8 @@ step-builder layers message-channel - + fluentinterface + From ded21b70acdbfa746343a0ebd6e5d33c5bf37dfb Mon Sep 17 00:00:00 2001 From: Hannes Pernpeintner Date: Sat, 22 Aug 2015 20:22:00 +0200 Subject: [PATCH 2/5] #184 Fluent interface pattern, lazy fluentiterable added --- .../com/iluwatar/fluentinterface/App.java | 34 ++- .../fluentiterable/FluentIterable.java | 175 +++---------- .../lazy/DecoratingIterator.java | 53 ++++ .../lazy/LazyFluentIterable.java | 236 ++++++++++++++++++ .../simple/SimpleFluentIterable.java | 194 ++++++++++++++ 5 files changed, 539 insertions(+), 153 deletions(-) create mode 100644 fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java create mode 100644 fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java create mode 100644 fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java index fded13624..96a2db323 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java @@ -1,14 +1,14 @@ package com.iluwatar.fluentinterface; -import com.iluwatar.fluentinterface.fluentiterable.FluentIterable; +import com.iluwatar.fluentinterface.fluentiterable.lazy.LazyFluentIterable; +import com.iluwatar.fluentinterface.fluentiterable.simple.SimpleFluentIterable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.StringJoiner; +import java.util.*; import java.util.function.Function; import java.util.function.Predicate; +import static java.lang.String.valueOf; + public class App { public static void main(String[] args) { @@ -34,35 +34,49 @@ public class App { }}; prettyPrint("The initial list contains: ", integerList); - List firstFiveNegatives = FluentIterable.from(integerList) + List firstFiveNegatives = SimpleFluentIterable.from(integerList) .filter(negatives()) .first(3) .asList(); prettyPrint("The first three negative values are: ", firstFiveNegatives); - List lastTwoPositives = FluentIterable.from(integerList) + List lastTwoPositives = SimpleFluentIterable.from(integerList) .filter(positives()) .last(2) .asList(); prettyPrint("The last two positive values are: ", lastTwoPositives); - FluentIterable.from(integerList) + SimpleFluentIterable.from(integerList) .filter(number -> number%2 == 0) .first() .ifPresent(evenNumber -> System.out.println(String.format("The first even number is: %d", evenNumber))); - List transformedList = FluentIterable.from(integerList) + List transformedList = SimpleFluentIterable.from(integerList) .filter(negatives()) .map(transformToString()) .asList(); prettyPrint("A string-mapped list of negative numbers contains: ", transformedList); + + List lastTwoOfFirstFourStringMapped = LazyFluentIterable.from(integerList) + .filter(positives()) + .first(4) + .last(2) + .map(number -> "String[" + String.valueOf(number) + "]") + .asList(); + prettyPrint("The lazy list contains the last two of the first four positive numbers mapped to Strings: ", lastTwoOfFirstFourStringMapped); + + LazyFluentIterable.from(integerList) + .filter(negatives()) + .first(2) + .last() + .ifPresent(lastOfFirstTwo -> System.out.println(String.format("The last of the first two negatives is: %d", lastOfFirstTwo))); } private static Function transformToString() { - return integer -> "String[" + String.valueOf(integer) + "]"; + return integer -> "String[" + valueOf(integer) + "]"; } private static Predicate negatives() { return integer -> (integer < 0); diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java index edb9275c1..7bdaf274c 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java @@ -1,6 +1,9 @@ package com.iluwatar.fluentinterface.fluentiterable; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; @@ -8,116 +11,49 @@ import java.util.function.Predicate; /** * The FluentIterable is a more convenient implementation of the common iterable interface based * on the fluent interface design pattern. - * This implementation demonstrates a possible way to implement this functionality, but + * This interface defines common operations, but * doesn't aim to be complete. It was inspired by Guava's com.google.common.collect.FluentIterable. * @param is the class of objects the iterable contains */ -public class FluentIterable implements Iterable { - - private final Iterable iterable; +public interface FluentIterable extends Iterable { /** - * This constructor creates a copy of a given iterable's contents. - * @param iterable the iterable this interface copies to work on. - */ - protected FluentIterable(Iterable iterable) { - ArrayList copy = new ArrayList<>(); - Iterator iterator = iterable.iterator(); - while (iterator.hasNext()) { - copy.add(iterator.next()); - } - this.iterable = copy; - } - - /** - * Iterates over all elements of this iterator and filters them. + * Filters the iteration with the given predicate. * @param predicate the condition to test with for the filtering. If the test * is negative, the tested object is removed by the iterator. - * @return the same FluentIterable with a filtered collection + * @return a filtered FluentIterable */ - public final FluentIterable filter(Predicate predicate) { - Iterator iterator = iterator(); - while (iterator.hasNext()) { - TYPE nextElement = iterator.next(); - if(!predicate.test(nextElement)) { - iterator.remove(); - } - } - return this; - } + FluentIterable filter(Predicate predicate); /** * Uses the Iterable interface's forEach method to apply a given function - * for each object of the iterator. - * @param action the action for each object - * @return the same FluentIterable with an untouched collection + * for each object of the iterator. This is a terminating operation. */ - public final FluentIterable forEachDo(Consumer action) { - iterable.forEach(action); - return this; - } + void forEachDo(Consumer action); /** - * Can be used to collect objects from the iteration. - * @return an option of the first object of the iteration + * Evaluates the iteration and returns the first element. This is a terminating operation. + * @return the first element after the iteration is evaluated */ - public final Optional first() { - List list = first(1).asList(); - if(list.isEmpty()) { - return Optional.empty(); - } - return Optional.of(list.get(0)); - } + Optional first(); /** - * Can be used to collect objects from the iteration. - * @param count defines the number of objects to return - * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. + * Evaluates the iteration and leaves only the count first elements. + * @return the first count elements as an Iterable */ - public final FluentIterable first(int count) { - Iterator iterator = iterator(); - int currentCount = 0; - while (iterator.hasNext()) { - iterator.next(); - if(currentCount >= count) { - iterator.remove(); - } - currentCount++; - } - return this; - } + FluentIterable first(int count); /** - * Can be used to collect objects from the iteration. - * @return an option of the last object of the iteration + * Evaluates the iteration and returns the last element. This is a terminating operation. + * @return the last element after the iteration is evaluated */ - public final Optional last() { - List list = last(1).asList(); - if(list.isEmpty()) { - return Optional.empty(); - } - return Optional.of(list.get(0)); - } + Optional last(); /** - * Can be used to collect objects from the iteration. - * @param count defines the number of objects to return - * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects + * Evaluates the iteration and leaves only the count last elements. + * @return the last counts elements as an Iterable */ - public final FluentIterable last(int count) { - int remainingElementsCount = getRemainingElementsCount(); - Iterator iterator = iterator(); - int currentIndex = 0; - while (iterator.hasNext()) { - iterator.next(); - if(currentIndex < remainingElementsCount - count) { - iterator.remove(); - } - currentIndex++; - } - - return this; - } + FluentIterable last(int count); /** * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. @@ -125,65 +61,18 @@ public class FluentIterable implements Iterable { * @param the target type of the transformation * @return a new FluentIterable of the new type */ - public final FluentIterable map(Function function) { - List temporaryList = new ArrayList(); - Iterator iterator = iterator(); - while (iterator.hasNext()) { - temporaryList.add(function.apply(iterator.next())); - } - return from(temporaryList); - } + FluentIterable map(Function function); + List asList(); /** - * Collects all remaining objects of this iteration into a list. - * @return a list with all remaining objects of this iteration + * Utility method that iterates over iterable and adds the contents to a list. + * @param iterable the iterable to collect + * @param the type of the objects to iterate + * @return a list with all objects of the given iterator */ - public List asList() { - return toList(iterable.iterator()); - } - - /** - * @return a FluentIterable from a given iterable. Calls the FluentIterable constructor. - */ - public static final FluentIterable from(Iterable iterable) { - return new FluentIterable<>(iterable); - } - - @Override - public Iterator iterator() { - return iterable.iterator(); - } - - @Override - public void forEach(Consumer action) { - iterable.forEach(action); - } - - - @Override - public Spliterator spliterator() { - return iterable.spliterator(); - } - - /** - * @return the count of remaining objects in the current iteration - */ - public final int getRemainingElementsCount() { - int counter = 0; - Iterator iterator = iterator(); - while(iterator.hasNext()) { - iterator.next(); - counter++; - } - return counter; - } - - /** - * Collects the remaining objects of the given iterators iteration into an List. - * @return a new List with the remaining objects. - */ - public static List toList(Iterator iterator) { - List copy = new ArrayList<>(); + static List copyToList(Iterable iterable) { + ArrayList copy = new ArrayList<>(); + Iterator iterator = iterable.iterator(); while (iterator.hasNext()) { copy.add(iterator.next()); } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java new file mode 100644 index 000000000..0e5b410cc --- /dev/null +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java @@ -0,0 +1,53 @@ +package com.iluwatar.fluentinterface.fluentiterable.lazy; + +import java.util.Iterator; + +/** + * This class is used to realize LazyFluentIterables. It decorates + * a given iterator. + * @param + */ +public abstract class DecoratingIterator implements Iterator { + + protected final Iterator fromIterator; + + private TYPE next = null; + + /** + * Creates an iterator that decorates the given iterator. + * @param fromIterator + */ + public DecoratingIterator(Iterator fromIterator) { + this.fromIterator = fromIterator; + } + + /** + * Precomputes and caches the next element of the iteration. + * @return true if a next element is available + */ + @Override + public final boolean hasNext() { + next = computeNext(); + return next != null; + } + + /** + * Returns the next element of the iteration. This implementation caches it. + * If no next element is cached, it is computed. + * @return the next element obf the iteration + */ + @Override + public final TYPE next() { + TYPE result = next; + next = null; + result = (result == null ? fromIterator.next() : result); + return result; + } + + /** + * Computes the next object of the iteration. Can be implemented to + * realize custom behaviour for an iteration process. + * @return + */ + public abstract TYPE computeNext(); +} diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java new file mode 100644 index 000000000..c6db4d2cd --- /dev/null +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java @@ -0,0 +1,236 @@ +package com.iluwatar.fluentinterface.fluentiterable.lazy; + +import com.iluwatar.fluentinterface.fluentiterable.FluentIterable; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; + +/** + * This is a lazy implementation of the FluentIterable interface. It evaluates + * all chained operations when a terminating operation is applied. + * @param the type of the objects the iteration is about + */ +public class LazyFluentIterable implements FluentIterable { + + private final Iterable iterable; + + /** + * This constructor creates a new LazyFluentIterable. It wraps the + * given iterable. + * @param iterable the iterable this FluentIterable works on. + */ + protected LazyFluentIterable(Iterable iterable) { + this.iterable = iterable; + } + + /** + * This constructor can be used to implement anonymous subclasses + * of the LazyFluentIterable. + */ + protected LazyFluentIterable() { + iterable = this; + } + + /** + * Adds a filter operation to the operation chain and returns a new iterable. + * @param predicate the condition to test with for the filtering. If the test + * is negative, the tested object is removed by the iterator. + * @return a new FluentIterable object that decorates the source iterable + */ + @Override + public FluentIterable filter(Predicate predicate) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + @Override + public TYPE computeNext() { + while(true) { + if(fromIterator.hasNext()) { + TYPE candidate = fromIterator.next(); + if(!predicate.test(candidate)) { + continue; + } + return candidate; + } + + return null; + } + } + }; + } + }; + } + + /** + * Uses the Iterable interface's forEach method to apply a given function + * for each object of the iterator. Is a terminating operation. + * @param action the action for each object + */ + @Override + public void forEachDo(Consumer action) { + Iterator newIterator = iterable.iterator(); + while(newIterator.hasNext()) { + action.accept(newIterator.next()); + } + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @return an option of the first object of the iteration + */ + @Override + public Optional first() { + Optional result = Optional.empty(); + List list = first(1).asList(); + if(!list.isEmpty()) { + result = Optional.of(list.get(0)); + } + + return result; + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. + */ + @Override + public FluentIterable first(int count) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + int currentIndex = 0; + + @Override + public TYPE computeNext() { + if(currentIndex < count) { + if(fromIterator.hasNext()) { + TYPE candidate = fromIterator.next(); + currentIndex++; + return candidate; + } + } + return null; + } + }; + } + }; + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @return an option of the last object of the iteration + */ + @Override + public Optional last() { + Optional result = Optional.empty(); + List list = last(1).asList(); + if(!list.isEmpty()) { + result = Optional.of(list.get(0)); + } + + return result; + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects + */ + @Override + public FluentIterable last(int count) {return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + int currentIndex = 0; + + @Override + public TYPE computeNext() { + List list = new ArrayList<>(); + + Iterator newIterator = iterable.iterator(); + while(newIterator.hasNext()) { + list.add(newIterator.next()); + } + + int totalElementsCount = list.size(); + int stopIndex = totalElementsCount - count; + + TYPE candidate = null; + while(currentIndex < stopIndex && fromIterator.hasNext()) { + currentIndex++; + fromIterator.next(); + } + if(currentIndex >= stopIndex && fromIterator.hasNext()) { + candidate = fromIterator.next(); + } + return candidate; + } + }; + } + }; + } + + /** + * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. + * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE + * @param the target type of the transformation + * @return a new FluentIterable of the new type + */ + @Override + public FluentIterable map(Function function) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(null) { + Iterator oldTypeIterator = iterable.iterator(); + @Override + public NEW_TYPE computeNext() { + while(true) { + if(oldTypeIterator.hasNext()) { + TYPE candidate = oldTypeIterator.next(); + return function.apply(candidate); + } + return null; + } + } + }; + } + }; + } + + /** + * Collects all remaining objects of this iteration into a list. + * @return a list with all remaining objects of this iteration + */ + @Override + public List asList() { + List copy = FluentIterable.copyToList(iterable); + return copy; + } + + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + @Override + public TYPE computeNext() { + return fromIterator.next(); + } + }; + } + + /** + * @return a FluentIterable from a given iterable. Calls the LazyFluentIterable constructor. + */ + public static final FluentIterable from(Iterable iterable) { + return new LazyFluentIterable<>(iterable); + } + +} diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java new file mode 100644 index 000000000..efaa87bbb --- /dev/null +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java @@ -0,0 +1,194 @@ +package com.iluwatar.fluentinterface.fluentiterable.simple; + +import com.iluwatar.fluentinterface.fluentiterable.FluentIterable; + +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; + +/** + * This is a simple implementation of the FluentIterable interface. It evaluates + * all chained operations eagerly. + * @param the type of the objects the iteration is about + */ +public class SimpleFluentIterable implements FluentIterable { + + private final Iterable iterable; + + /** + * This constructor creates a copy of a given iterable's contents. + * @param iterable the iterable this interface copies to work on. + */ + protected SimpleFluentIterable(Iterable iterable) { + List copy = FluentIterable.copyToList(iterable); + this.iterable = copy; + } + + /** + * Iterates over all elements of this iterator and filters them. + * @param predicate the condition to test with for the filtering. If the test + * is negative, the tested object is removed by the iterator. + * @return the same FluentIterable with a filtered collection + */ + @Override + public final FluentIterable filter(Predicate predicate) { + Iterator iterator = iterator(); + while (iterator.hasNext()) { + TYPE nextElement = iterator.next(); + if(!predicate.test(nextElement)) { + iterator.remove(); + } + } + return this; + } + + /** + * Uses the Iterable interface's forEach method to apply a given function + * for each object of the iterator. Is a terminating operation. + * @param action the action for each object + */ + @Override + public void forEachDo(Consumer action) { + iterable.forEach(action); + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @return an option of the first object of the iteration + */ + @Override + public final Optional first() { + List list = first(1).asList(); + if(list.isEmpty()) { + return Optional.empty(); + } + return Optional.of(list.get(0)); + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. + */ + @Override + public final FluentIterable first(int count) { + Iterator iterator = iterator(); + int currentCount = 0; + while (iterator.hasNext()) { + iterator.next(); + if(currentCount >= count) { + iterator.remove(); + } + currentCount++; + } + return this; + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @return an option of the last object of the iteration + */ + @Override + public final Optional last() { + List list = last(1).asList(); + if(list.isEmpty()) { + return Optional.empty(); + } + return Optional.of(list.get(0)); + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects + */ + @Override + public final FluentIterable last(int count) { + int remainingElementsCount = getRemainingElementsCount(); + Iterator iterator = iterator(); + int currentIndex = 0; + while (iterator.hasNext()) { + iterator.next(); + if(currentIndex < remainingElementsCount - count) { + iterator.remove(); + } + currentIndex++; + } + + return this; + } + + /** + * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. + * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE + * @param the target type of the transformation + * @return a new FluentIterable of the new type + */ + @Override + public final FluentIterable map(Function function) { + List temporaryList = new ArrayList(); + Iterator iterator = iterator(); + while (iterator.hasNext()) { + temporaryList.add(function.apply(iterator.next())); + } + return from(temporaryList); + } + + /** + * Collects all remaining objects of this iteration into a list. + * @return a list with all remaining objects of this iteration + */ + @Override + public List asList() { + return toList(iterable.iterator()); + } + + /** + * @return a FluentIterable from a given iterable. Calls the SimpleFluentIterable constructor. + */ + public static final FluentIterable from(Iterable iterable) { + return new SimpleFluentIterable<>(iterable); + } + + @Override + public Iterator iterator() { + return iterable.iterator(); + } + + @Override + public void forEach(Consumer action) { + iterable.forEach(action); + } + + + @Override + public Spliterator spliterator() { + return iterable.spliterator(); + } + + /** + * @return the count of remaining objects in the current iteration + */ + public final int getRemainingElementsCount() { + int counter = 0; + Iterator iterator = iterator(); + while(iterator.hasNext()) { + iterator.next(); + counter++; + } + return counter; + } + + /** + * Collects the remaining objects of the given iterators iteration into an List. + * @return a new List with the remaining objects. + */ + public static List toList(Iterator iterator) { + List copy = new ArrayList<>(); + while (iterator.hasNext()) { + copy.add(iterator.next()); + } + return copy; + } +} From a90fcc23916c8768087135e68d8499053b41e860 Mon Sep 17 00:00:00 2001 From: Hannes Pernpeintner Date: Wed, 2 Sep 2015 17:21:20 +0200 Subject: [PATCH 3/5] #184 Fluent interface pattern, documentation changed, collecting operations optimized --- .../fluentiterable/FluentIterable.java | 17 +++-- .../lazy/DecoratingIterator.java | 24 ++++--- .../lazy/LazyFluentIterable.java | 69 ++++++------------- .../simple/SimpleFluentIterable.java | 39 ++++------- 4 files changed, 56 insertions(+), 93 deletions(-) diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java index 7bdaf274c..919cf5664 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Optional; -import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; @@ -18,7 +17,7 @@ import java.util.function.Predicate; public interface FluentIterable extends Iterable { /** - * Filters the iteration with the given predicate. + * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy the predicate. * @param predicate the condition to test with for the filtering. If the test * is negative, the tested object is removed by the iterator. * @return a filtered FluentIterable @@ -26,13 +25,8 @@ public interface FluentIterable extends Iterable { FluentIterable filter(Predicate predicate); /** - * Uses the Iterable interface's forEach method to apply a given function - * for each object of the iterator. This is a terminating operation. - */ - void forEachDo(Consumer action); - - /** - * Evaluates the iteration and returns the first element. This is a terminating operation. + * Returns an Optional containing the first element of this iterable if present, + * else returns Optional.empty(). * @return the first element after the iteration is evaluated */ Optional first(); @@ -62,6 +56,11 @@ public interface FluentIterable extends Iterable { * @return a new FluentIterable of the new type */ FluentIterable map(Function function); + + /** + * Returns the contents of this Iterable as a List. + * @return a List representation of this Iterable + */ List asList(); /** diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java index 0e5b410cc..35c4cc0ae 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java @@ -22,7 +22,7 @@ public abstract class DecoratingIterator implements Iterator { } /** - * Precomputes and caches the next element of the iteration. + * Precomputes and saves the next element of the Iterable. null is considered as end of data. * @return true if a next element is available */ @Override @@ -32,22 +32,24 @@ public abstract class DecoratingIterator implements Iterator { } /** - * Returns the next element of the iteration. This implementation caches it. - * If no next element is cached, it is computed. - * @return the next element obf the iteration + * Returns the next element of the Iterable. + * @return the next element of the Iterable, or null if not present. */ @Override public final TYPE next() { - TYPE result = next; - next = null; - result = (result == null ? fromIterator.next() : result); - return result; + if (next == null) { + return fromIterator.next(); + } else { + final TYPE result = next; + next = null; + return result; + } } /** - * Computes the next object of the iteration. Can be implemented to - * realize custom behaviour for an iteration process. - * @return + * Computes the next object of the Iterable. Can be implemented to + * realize custom behaviour for an iteration process. null is considered as end of data. + * @return the next element of the Iterable. */ public abstract TYPE computeNext(); } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java index c6db4d2cd..27bca1bf6 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java @@ -37,7 +37,7 @@ public class LazyFluentIterable implements FluentIterable { } /** - * Adds a filter operation to the operation chain and returns a new iterable. + * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy the predicate. * @param predicate the condition to test with for the filtering. If the test * is negative, the tested object is removed by the iterator. * @return a new FluentIterable object that decorates the source iterable @@ -50,53 +50,33 @@ public class LazyFluentIterable implements FluentIterable { return new DecoratingIterator(iterable.iterator()) { @Override public TYPE computeNext() { - while(true) { - if(fromIterator.hasNext()) { - TYPE candidate = fromIterator.next(); - if(!predicate.test(candidate)) { - continue; - } - return candidate; + while(fromIterator.hasNext()) { + TYPE candidate = fromIterator.next(); + if(!predicate.test(candidate)) { + continue; } - - return null; + return candidate; } + + return null; } }; } }; } - /** - * Uses the Iterable interface's forEach method to apply a given function - * for each object of the iterator. Is a terminating operation. - * @param action the action for each object - */ - @Override - public void forEachDo(Consumer action) { - Iterator newIterator = iterable.iterator(); - while(newIterator.hasNext()) { - action.accept(newIterator.next()); - } - } - /** * Can be used to collect objects from the iteration. Is a terminating operation. - * @return an option of the first object of the iteration + * @return an Optional containing the first object of this Iterable */ @Override public Optional first() { - Optional result = Optional.empty(); - List list = first(1).asList(); - if(!list.isEmpty()) { - result = Optional.of(list.get(0)); - } - - return result; + Iterator resultIterator = first(1).iterator(); + return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); } /** - * Can be used to collect objects from the iteration. Is a terminating operation. + * Can be used to collect objects from the iteration. * @param count defines the number of objects to return * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. */ @@ -126,21 +106,18 @@ public class LazyFluentIterable implements FluentIterable { /** * Can be used to collect objects from the iteration. Is a terminating operation. - * @return an option of the last object of the iteration + * @return an Optional containing the last object of this Iterable */ @Override public Optional last() { - Optional result = Optional.empty(); - List list = last(1).asList(); - if(!list.isEmpty()) { - result = Optional.of(list.get(0)); - } - - return result; + Iterator resultIterator = last(1).iterator(); + return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); } /** - * Can be used to collect objects from the iteration. Is a terminating operation. + * Can be used to collect objects from the Iterable. Is a terminating operation. + * This operation is memory intensive, because the contents of this Iterable + * are collected into a List, when the next object is requested. * @param count defines the number of objects to return * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects */ @@ -193,13 +170,11 @@ public class LazyFluentIterable implements FluentIterable { Iterator oldTypeIterator = iterable.iterator(); @Override public NEW_TYPE computeNext() { - while(true) { - if(oldTypeIterator.hasNext()) { - TYPE candidate = oldTypeIterator.next(); - return function.apply(candidate); - } - return null; + while(oldTypeIterator.hasNext()) { + TYPE candidate = oldTypeIterator.next(); + return function.apply(candidate); } + return null; } }; } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java index efaa87bbb..a4bf77218 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java @@ -26,7 +26,7 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * Iterates over all elements of this iterator and filters them. + * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy the predicate. * @param predicate the condition to test with for the filtering. If the test * is negative, the tested object is removed by the iterator. * @return the same FluentIterable with a filtered collection @@ -44,30 +44,17 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * Uses the Iterable interface's forEach method to apply a given function - * for each object of the iterator. Is a terminating operation. - * @param action the action for each object - */ - @Override - public void forEachDo(Consumer action) { - iterable.forEach(action); - } - - /** - * Can be used to collect objects from the iteration. Is a terminating operation. - * @return an option of the first object of the iteration + * Can be used to collect objects from the Iterable. Is a terminating operation. + * @return an option of the first object of the Iterable */ @Override public final Optional first() { - List list = first(1).asList(); - if(list.isEmpty()) { - return Optional.empty(); - } - return Optional.of(list.get(0)); + Iterator resultIterator = first(1).iterator(); + return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); } /** - * Can be used to collect objects from the iteration. Is a terminating operation. + * Can be used to collect objects from the Iterable. Is a terminating operation. * @param count defines the number of objects to return * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. */ @@ -86,8 +73,8 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * Can be used to collect objects from the iteration. Is a terminating operation. - * @return an option of the last object of the iteration + * Can be used to collect objects from the Iterable. Is a terminating operation. + * @return an option of the last object of the Iterable */ @Override public final Optional last() { @@ -99,7 +86,7 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * Can be used to collect objects from the iteration. Is a terminating operation. + * Can be used to collect objects from the Iterable. Is a terminating operation. * @param count defines the number of objects to return * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects */ @@ -136,8 +123,8 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * Collects all remaining objects of this iteration into a list. - * @return a list with all remaining objects of this iteration + * Collects all remaining objects of this Iterable into a list. + * @return a list with all remaining objects of this Iterable */ @Override public List asList() { @@ -168,7 +155,7 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * @return the count of remaining objects in the current iteration + * @return the count of remaining objects of the current Iterable */ public final int getRemainingElementsCount() { int counter = 0; @@ -181,7 +168,7 @@ public class SimpleFluentIterable implements FluentIterable { } /** - * Collects the remaining objects of the given iterators iteration into an List. + * Collects the remaining objects of the given iterator into a List. * @return a new List with the remaining objects. */ public static List toList(Iterator iterator) { From ee47ae021aed75b1c467e31f75729224c02f943b Mon Sep 17 00:00:00 2001 From: Hannes Pernpeintner Date: Thu, 3 Sep 2015 18:49:52 +0200 Subject: [PATCH 4/5] #184 Fluent interface pattern, added cached initialization to anonymous iterator for lazy fluentiterable, small documentation changes --- .../lazy/DecoratingIterator.java | 2 +- .../lazy/LazyFluentIterable.java | 28 ++++++++++++------- .../simple/SimpleFluentIterable.java | 1 + 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java index 35c4cc0ae..3c1230bce 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java @@ -4,7 +4,7 @@ import java.util.Iterator; /** * This class is used to realize LazyFluentIterables. It decorates - * a given iterator. + * a given iterator. Does not support consecutive hasNext() calls. * @param */ public abstract class DecoratingIterator implements Iterator { diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java index 27bca1bf6..998bbd659 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java @@ -126,19 +126,14 @@ public class LazyFluentIterable implements FluentIterable { @Override public Iterator iterator() { return new DecoratingIterator(iterable.iterator()) { - int currentIndex = 0; + public int stopIndex; + public int totalElementsCount; + private List list; + private int currentIndex = 0; @Override public TYPE computeNext() { - List list = new ArrayList<>(); - - Iterator newIterator = iterable.iterator(); - while(newIterator.hasNext()) { - list.add(newIterator.next()); - } - - int totalElementsCount = list.size(); - int stopIndex = totalElementsCount - count; + initialize(); TYPE candidate = null; while(currentIndex < stopIndex && fromIterator.hasNext()) { @@ -150,6 +145,19 @@ public class LazyFluentIterable implements FluentIterable { } return candidate; } + + private void initialize() { + if(list == null) { + list = new ArrayList<>(); + Iterator newIterator = iterable.iterator(); + while(newIterator.hasNext()) { + list.add(newIterator.next()); + } + + totalElementsCount = list.size(); + stopIndex = totalElementsCount - count; + } + } }; } }; diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java index a4bf77218..0736387e5 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java @@ -10,6 +10,7 @@ import java.util.function.Predicate; /** * This is a simple implementation of the FluentIterable interface. It evaluates * all chained operations eagerly. + * This implementation would be costly to be utilized in real applications. * @param the type of the objects the iteration is about */ public class SimpleFluentIterable implements FluentIterable { From fb13ddc5d6ca34975c5c0bf474987e6b1c19c34a Mon Sep 17 00:00:00 2001 From: Hannes Pernpeintner Date: Mon, 7 Sep 2015 13:25:26 +0200 Subject: [PATCH 5/5] #184 Fluent interface pattern, added uml, adjusted style, added pattern description --- faq.md | 4 + fluentinterface/etc/fluentinterface.png | Bin 0 -> 59199 bytes fluentinterface/etc/fluentinterface.ucls | 100 +++++ fluentinterface/index.md | 28 ++ fluentinterface/pom.xml | 2 +- .../com/iluwatar/fluentinterface/App.java | 174 ++++---- .../fluentiterable/FluentIterable.java | 123 +++--- .../lazy/DecoratingIterator.java | 87 ++-- .../lazy/LazyFluentIterable.java | 400 +++++++++--------- .../simple/SimpleFluentIterable.java | 334 ++++++++------- .../com/iluwatar/fluentinterface/AppTest.java | 10 +- 11 files changed, 727 insertions(+), 535 deletions(-) create mode 100644 fluentinterface/etc/fluentinterface.png create mode 100644 fluentinterface/etc/fluentinterface.ucls create mode 100644 fluentinterface/index.md diff --git a/faq.md b/faq.md index 5633a693d..b98bc7589 100644 --- a/faq.md +++ b/faq.md @@ -61,3 +61,7 @@ As for performance and scalability, pools can become bottlenecks, if all the pooled objects are in use and more clients need them, threads will become blocked waiting for available object from the pool. This is not the case with Flyweight. + +### Q7: What are the differences between FluentInterface and Builder patterns? {#Q7} + +Fluent interfaces are sometimes confused with the Builder pattern, because they share method chaining and a fluent usage. However, fluent interfaces are not primarily used to create shared (mutable) objects, but to configure complex objects without having to respecify the target object on every property change. \ No newline at end of file diff --git a/fluentinterface/etc/fluentinterface.png b/fluentinterface/etc/fluentinterface.png new file mode 100644 index 0000000000000000000000000000000000000000..4a79ce0b7f69395cb81822042ae9c85f90da5e17 GIT binary patch literal 59199 zcmb?@by(DE*Di`N3dj(WA`VKYG)U+S-6aS}cS|=I!zhh(BMdFwAtBw}DcvC5aDL$4 z`^CNY`mN*LoV(Onc26bw-j0XYh=zynut`mJN-R_&7Gq5=Rxutu?m3?IY($-dbU!s5KnLya>b#v( ztVtj%TU9D3D4IBT6;V)f&=FuRYy=pknj1F*_#q)W#Oet;1m&$Q)vJqv2%xhf1W*)| z6`7oi5t!gjpPAq&CWBRxJCWmk>>O+Yd0NDoBvUF5?H-!N6DsQhq&G)Zq6J=XPg~@7OOU~R z-3ou;t|6>4>_w1Ef`$dp(57T3ik9fe@^IsWq$F33-Iz(3@74f&eD(4DeH0Wrmg@*6 z8<}S+#KRDhW-vvEj04N04LPJ{@K88u#&F3Y1ym#NDbkTYzC)6RuiUP#DD};kDS6?( z2dYF$=<6@W_JslQ`2RVS2nYu})jO+ej>Vgj zh)lf-e?uv$o(j?4G|{-b-a~AMRk%Vd?Uh0F z`!J@8)ek&>zSD5rX&IJxe<)(=4aQP;oS=Ap#ioQtz;_4tn-FYN8U{MX{p-ghlT`)UPaUZJVd0r(}PmREK}s0KUWSUEqAKMsrK z>OON@N!hxec|LcJ3(+_gQ+1)4hHv5&7j^9v(XhkUl5ypE-yjQN(vGZGuhs@*YWk!w zo2P6`VcRU;;;gX>#IVq4VQ~WjwRYc8Tv;tAskagJwR)jC*5FB{DQxmsWZ2$kmt>bp zhO;2?8e@*}JBTU!a$0pFmYg)ZOyIi*FoOEU&O$}{E1rln0g<{dZf&?v-S&4~lKb+* zYT{^0<950G(80TaPeIITa%k}uqt~Ae?m>yyq;Mf)_om^=44yM7c&}Qjs~o8tQ<}ut zABny0R86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3Y2ob5}GdZ=$ zIVL8YqDfJM>UxiJmRDtpS(9js7+^$01=;_;mWQ~gp1AJV(dd}iqL|pCf|;lPog2av zImSF>IPrEjUFP>$6G9p1VkUVK2oT>B&3IkAjjZlwN-&K-O9*$jEoQAHaNNjXG%j?P zRh8%d{l=4U75&J^>-YB8ju+QBLc-u_4cf4=+~mW@dCcfF43Aq*5Ba}d3ta= zX`zY$9{dD()ohXJ309pH&qL%R6%F`E74o>*WMtj$Mk4ngY5J^Qqz$3?(}uexCWT5cW1|Jy2`b8d|M8p($bCbIetq*_d$jKs z#Q$iUn)21fRteYTL8-YLl&4?q2XQv{9TrH1rT(YQ-*vs|uxeo7>AAAu))QL$6M=s~ xd?q12{c})JM4wtD_{dP>^a>#NRzjYf@0Gw#Bx?B}2L9okf{f~|66w1E{|B@XoLc|@ literal 0 HcmV?d00001 diff --git a/fluentinterface/etc/fluentinterface.ucls b/fluentinterface/etc/fluentinterface.ucls new file mode 100644 index 000000000..3277148cd --- /dev/null +++ b/fluentinterface/etc/fluentinterface.ucls @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fluentinterface/index.md b/fluentinterface/index.md new file mode 100644 index 000000000..942867933 --- /dev/null +++ b/fluentinterface/index.md @@ -0,0 +1,28 @@ +--- +layout: pattern +title: Fluent Interface +folder: fluentinterface +permalink: /patterns/fluentinterface/ +categories: Architectural +tags: Java +--- + +**Intent:** A fluent interface provides an easy-readable, flowing interface, that often mimics a domain specific language. Using this pattern results in code that can be read nearly as human language. + +![Fluent Interface](./etc/fluentinterface.png "Fluent Interface") + +**Applicability:** Use the Fluent Interface pattern when + +* you provide an API that would benefit from a DSL-like usage +* you have objects that are difficult to configure or use + +**Real world examples:** + +* [Java 8 Stream API](http://www.oracle.com/technetwork/articles/java/ma14-java-se-8-streams-2177646.html) +* [Google Guava FluentInterable](https://github.com/google/guava/wiki/FunctionalExplained) +* [JOOQ](http://www.jooq.org/doc/3.0/manual/getting-started/use-cases/jooq-as-a-standalone-sql-builder/) + +**Credits** + +* [Fluent Interface - Martin Fowler](http://www.martinfowler.com/bliki/FluentInterface.html) +* [Evolutionary architecture and emergent design: Fluent interfaces - Neal Ford](http://www.ibm.com/developerworks/library/j-eaed14/) \ No newline at end of file diff --git a/fluentinterface/pom.xml b/fluentinterface/pom.xml index c78c182e3..be8ab8039 100644 --- a/fluentinterface/pom.xml +++ b/fluentinterface/pom.xml @@ -5,7 +5,7 @@ java-design-patterns com.iluwatar - 1.5.0 + 1.6.0 4.0.0 diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java index 96a2db323..b9e5909f1 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/App.java @@ -1,5 +1,6 @@ package com.iluwatar.fluentinterface; +import com.iluwatar.fluentinterface.fluentiterable.FluentIterable; import com.iluwatar.fluentinterface.fluentiterable.lazy.LazyFluentIterable; import com.iluwatar.fluentinterface.fluentiterable.simple.SimpleFluentIterable; @@ -9,96 +10,113 @@ import java.util.function.Predicate; import static java.lang.String.valueOf; +/** + * Fluent interface pattern is useful when you want to provide an easy readable, flowing API. Those + * interfaces tend to mimic domain specific languages, so they can nearly be read as human + * languages. + *

+ * In this example two implementations of a {@link FluentIterable} interface are given. The + * SimpleFluentIterable evaluates eagerly and would be too costly for real world applications. The + * LazyFluentIterable is evaluated on termination. Their usage is demonstrated with a simple number + * list that is filtered, transformed and collected. The result is printed afterwards. + *

+ */ public class App { - public static void main(String[] args) { + public static void main(String[] args) { - List integerList = new ArrayList() {{ - add(1); - add(-61); - add(14); - add(-22); - add(18); - add(-87); - add(6); - add(64); - add(-82); - add(26); - add(-98); - add(97); - add(45); - add(23); - add(2); - add(-68); - add(45); - }}; - prettyPrint("The initial list contains: ", integerList); + List integerList = new ArrayList() { + { + add(1); + add(-61); + add(14); + add(-22); + add(18); + add(-87); + add(6); + add(64); + add(-82); + add(26); + add(-98); + add(97); + add(45); + add(23); + add(2); + add(-68); + add(45); + } + }; + prettyPrint("The initial list contains: ", integerList); - List firstFiveNegatives = SimpleFluentIterable.from(integerList) - .filter(negatives()) - .first(3) - .asList(); - prettyPrint("The first three negative values are: ", firstFiveNegatives); + List firstFiveNegatives = + SimpleFluentIterable.fromCopyOf(integerList).filter(negatives()).first(3).asList(); + prettyPrint("The first three negative values are: ", firstFiveNegatives); - List lastTwoPositives = SimpleFluentIterable.from(integerList) - .filter(positives()) - .last(2) - .asList(); - prettyPrint("The last two positive values are: ", lastTwoPositives); + List lastTwoPositives = + SimpleFluentIterable.fromCopyOf(integerList).filter(positives()).last(2).asList(); + prettyPrint("The last two positive values are: ", lastTwoPositives); - SimpleFluentIterable.from(integerList) - .filter(number -> number%2 == 0) - .first() - .ifPresent(evenNumber -> System.out.println(String.format("The first even number is: %d", evenNumber))); + SimpleFluentIterable + .fromCopyOf(integerList) + .filter(number -> number % 2 == 0) + .first() + .ifPresent( + evenNumber -> System.out.println(String.format("The first even number is: %d", + evenNumber))); - List transformedList = SimpleFluentIterable.from(integerList) - .filter(negatives()) - .map(transformToString()) - .asList(); - prettyPrint("A string-mapped list of negative numbers contains: ", transformedList); + List transformedList = + SimpleFluentIterable.fromCopyOf(integerList).filter(negatives()).map(transformToString()) + .asList(); + prettyPrint("A string-mapped list of negative numbers contains: ", transformedList); - List lastTwoOfFirstFourStringMapped = LazyFluentIterable.from(integerList) - .filter(positives()) - .first(4) - .last(2) - .map(number -> "String[" + String.valueOf(number) + "]") - .asList(); - prettyPrint("The lazy list contains the last two of the first four positive numbers mapped to Strings: ", lastTwoOfFirstFourStringMapped); + List lastTwoOfFirstFourStringMapped = + LazyFluentIterable.from(integerList).filter(positives()).first(4).last(2) + .map(number -> "String[" + String.valueOf(number) + "]").asList(); + prettyPrint( + "The lazy list contains the last two of the first four positive numbers mapped to Strings: ", + lastTwoOfFirstFourStringMapped); - LazyFluentIterable.from(integerList) - .filter(negatives()) - .first(2) - .last() - .ifPresent(lastOfFirstTwo -> System.out.println(String.format("The last of the first two negatives is: %d", lastOfFirstTwo))); + LazyFluentIterable + .from(integerList) + .filter(negatives()) + .first(2) + .last() + .ifPresent( + lastOfFirstTwo -> System.out.println(String.format( + "The last of the first two negatives is: %d", lastOfFirstTwo))); + } + + private static Function transformToString() { + return integer -> "String[" + valueOf(integer) + "]"; + } + + private static Predicate negatives() { + return integer -> (integer < 0); + } + + private static Predicate positives() { + return integer -> (integer > 0); + } + + private static void prettyPrint(String prefix, Iterable iterable) { + prettyPrint(", ", prefix, ".", iterable); + } + + private static void prettyPrint(String prefix, String suffix, Iterable iterable) { + prettyPrint(", ", prefix, suffix, iterable); + } + + private static void prettyPrint(String delimiter, String prefix, String suffix, + Iterable iterable) { + StringJoiner joiner = new StringJoiner(delimiter, prefix, "."); + Iterator iterator = iterable.iterator(); + while (iterator.hasNext()) { + joiner.add(iterator.next().toString()); } - private static Function transformToString() { - return integer -> "String[" + valueOf(integer) + "]"; - } - private static Predicate negatives() { - return integer -> (integer < 0); - } - private static Predicate positives() { - return integer -> (integer > 0); - } - - private static void prettyPrint(String prefix, Iterable iterable) { - prettyPrint(", ", prefix, ".", iterable); - } - private static void prettyPrint(String prefix, String suffix, Iterable iterable) { - prettyPrint(", ", prefix, suffix, iterable); - } - - private static void prettyPrint(String delimiter, String prefix, String suffix, Iterable iterable) { - StringJoiner joiner = new StringJoiner(delimiter, prefix, "."); - Iterator iterator = iterable.iterator(); - while (iterator.hasNext()) { - joiner.add(iterator.next().toString()); - } - - System.out.println(joiner); - } + System.out.println(joiner); + } } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java index 919cf5664..5c4df0391 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java @@ -8,73 +8,82 @@ import java.util.function.Function; import java.util.function.Predicate; /** - * The FluentIterable is a more convenient implementation of the common iterable interface based - * on the fluent interface design pattern. - * This interface defines common operations, but - * doesn't aim to be complete. It was inspired by Guava's com.google.common.collect.FluentIterable. + * The FluentIterable is a more convenient implementation of the common iterable interface based on + * the fluent interface design pattern. This interface defines common operations, but doesn't aim to + * be complete. It was inspired by Guava's com.google.common.collect.FluentIterable. + * * @param is the class of objects the iterable contains */ public interface FluentIterable extends Iterable { - /** - * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy the predicate. - * @param predicate the condition to test with for the filtering. If the test - * is negative, the tested object is removed by the iterator. - * @return a filtered FluentIterable - */ - FluentIterable filter(Predicate predicate); + /** + * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy + * the predicate. + * + * @param predicate the condition to test with for the filtering. If the test is negative, the + * tested object is removed by the iterator. + * @return a filtered FluentIterable + */ + FluentIterable filter(Predicate predicate); - /** - * Returns an Optional containing the first element of this iterable if present, - * else returns Optional.empty(). - * @return the first element after the iteration is evaluated - */ - Optional first(); + /** + * Returns an Optional containing the first element of this iterable if present, else returns + * Optional.empty(). + * + * @return the first element after the iteration is evaluated + */ + Optional first(); - /** - * Evaluates the iteration and leaves only the count first elements. - * @return the first count elements as an Iterable - */ - FluentIterable first(int count); + /** + * Evaluates the iteration and leaves only the count first elements. + * + * @return the first count elements as an Iterable + */ + FluentIterable first(int count); - /** - * Evaluates the iteration and returns the last element. This is a terminating operation. - * @return the last element after the iteration is evaluated - */ - Optional last(); + /** + * Evaluates the iteration and returns the last element. This is a terminating operation. + * + * @return the last element after the iteration is evaluated + */ + Optional last(); - /** - * Evaluates the iteration and leaves only the count last elements. - * @return the last counts elements as an Iterable - */ - FluentIterable last(int count); + /** + * Evaluates the iteration and leaves only the count last elements. + * + * @return the last counts elements as an Iterable + */ + FluentIterable last(int count); - /** - * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. - * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE - * @param the target type of the transformation - * @return a new FluentIterable of the new type - */ - FluentIterable map(Function function); + /** + * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. + * + * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE + * @param the target type of the transformation + * @return a new FluentIterable of the new type + */ + FluentIterable map(Function function); - /** - * Returns the contents of this Iterable as a List. - * @return a List representation of this Iterable - */ - List asList(); + /** + * Returns the contents of this Iterable as a List. + * + * @return a List representation of this Iterable + */ + List asList(); - /** - * Utility method that iterates over iterable and adds the contents to a list. - * @param iterable the iterable to collect - * @param the type of the objects to iterate - * @return a list with all objects of the given iterator - */ - static List copyToList(Iterable iterable) { - ArrayList copy = new ArrayList<>(); - Iterator iterator = iterable.iterator(); - while (iterator.hasNext()) { - copy.add(iterator.next()); - } - return copy; + /** + * Utility method that iterates over iterable and adds the contents to a list. + * + * @param iterable the iterable to collect + * @param the type of the objects to iterate + * @return a list with all objects of the given iterator + */ + static List copyToList(Iterable iterable) { + ArrayList copy = new ArrayList<>(); + Iterator iterator = iterable.iterator(); + while (iterator.hasNext()) { + copy.add(iterator.next()); } + return copy; + } } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java index 3c1230bce..e80356d8e 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java @@ -3,53 +3,58 @@ package com.iluwatar.fluentinterface.fluentiterable.lazy; import java.util.Iterator; /** - * This class is used to realize LazyFluentIterables. It decorates - * a given iterator. Does not support consecutive hasNext() calls. + * This class is used to realize LazyFluentIterables. It decorates a given iterator. Does not + * support consecutive hasNext() calls. + * * @param */ public abstract class DecoratingIterator implements Iterator { - protected final Iterator fromIterator; + protected final Iterator fromIterator; - private TYPE next = null; + private TYPE next = null; - /** - * Creates an iterator that decorates the given iterator. - * @param fromIterator - */ - public DecoratingIterator(Iterator fromIterator) { - this.fromIterator = fromIterator; + /** + * Creates an iterator that decorates the given iterator. + * + * @param fromIterator + */ + public DecoratingIterator(Iterator fromIterator) { + this.fromIterator = fromIterator; + } + + /** + * Precomputes and saves the next element of the Iterable. null is considered as end of data. + * + * @return true if a next element is available + */ + @Override + public final boolean hasNext() { + next = computeNext(); + return next != null; + } + + /** + * Returns the next element of the Iterable. + * + * @return the next element of the Iterable, or null if not present. + */ + @Override + public final TYPE next() { + if (next == null) { + return fromIterator.next(); + } else { + final TYPE result = next; + next = null; + return result; } + } - /** - * Precomputes and saves the next element of the Iterable. null is considered as end of data. - * @return true if a next element is available - */ - @Override - public final boolean hasNext() { - next = computeNext(); - return next != null; - } - - /** - * Returns the next element of the Iterable. - * @return the next element of the Iterable, or null if not present. - */ - @Override - public final TYPE next() { - if (next == null) { - return fromIterator.next(); - } else { - final TYPE result = next; - next = null; - return result; - } - } - - /** - * Computes the next object of the Iterable. Can be implemented to - * realize custom behaviour for an iteration process. null is considered as end of data. - * @return the next element of the Iterable. - */ - public abstract TYPE computeNext(); + /** + * Computes the next object of the Iterable. Can be implemented to realize custom behaviour for an + * iteration process. null is considered as end of data. + * + * @return the next element of the Iterable. + */ + public abstract TYPE computeNext(); } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java index 998bbd659..5adfa83ce 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/LazyFluentIterable.java @@ -11,209 +11,221 @@ import java.util.function.Function; import java.util.function.Predicate; /** - * This is a lazy implementation of the FluentIterable interface. It evaluates - * all chained operations when a terminating operation is applied. + * This is a lazy implementation of the FluentIterable interface. It evaluates all chained + * operations when a terminating operation is applied. + * * @param the type of the objects the iteration is about */ public class LazyFluentIterable implements FluentIterable { - private final Iterable iterable; + private final Iterable iterable; - /** - * This constructor creates a new LazyFluentIterable. It wraps the - * given iterable. - * @param iterable the iterable this FluentIterable works on. - */ - protected LazyFluentIterable(Iterable iterable) { - this.iterable = iterable; - } + /** + * This constructor creates a new LazyFluentIterable. It wraps the given iterable. + * + * @param iterable the iterable this FluentIterable works on. + */ + protected LazyFluentIterable(Iterable iterable) { + this.iterable = iterable; + } - /** - * This constructor can be used to implement anonymous subclasses - * of the LazyFluentIterable. - */ - protected LazyFluentIterable() { - iterable = this; - } + /** + * This constructor can be used to implement anonymous subclasses of the LazyFluentIterable. + */ + protected LazyFluentIterable() { + iterable = this; + } - /** - * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy the predicate. - * @param predicate the condition to test with for the filtering. If the test - * is negative, the tested object is removed by the iterator. - * @return a new FluentIterable object that decorates the source iterable - */ - @Override - public FluentIterable filter(Predicate predicate) { - return new LazyFluentIterable() { - @Override - public Iterator iterator() { - return new DecoratingIterator(iterable.iterator()) { - @Override - public TYPE computeNext() { - while(fromIterator.hasNext()) { - TYPE candidate = fromIterator.next(); - if(!predicate.test(candidate)) { - continue; - } - return candidate; - } - - return null; - } - }; - } - }; - } - - /** - * Can be used to collect objects from the iteration. Is a terminating operation. - * @return an Optional containing the first object of this Iterable - */ - @Override - public Optional first() { - Iterator resultIterator = first(1).iterator(); - return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); - } - - /** - * Can be used to collect objects from the iteration. - * @param count defines the number of objects to return - * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. - */ - @Override - public FluentIterable first(int count) { - return new LazyFluentIterable() { - @Override - public Iterator iterator() { - return new DecoratingIterator(iterable.iterator()) { - int currentIndex = 0; - - @Override - public TYPE computeNext() { - if(currentIndex < count) { - if(fromIterator.hasNext()) { - TYPE candidate = fromIterator.next(); - currentIndex++; - return candidate; - } - } - return null; - } - }; - } - }; - } - - /** - * Can be used to collect objects from the iteration. Is a terminating operation. - * @return an Optional containing the last object of this Iterable - */ - @Override - public Optional last() { - Iterator resultIterator = last(1).iterator(); - return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); - } - - /** - * Can be used to collect objects from the Iterable. Is a terminating operation. - * This operation is memory intensive, because the contents of this Iterable - * are collected into a List, when the next object is requested. - * @param count defines the number of objects to return - * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects - */ - @Override - public FluentIterable last(int count) {return new LazyFluentIterable() { - @Override - public Iterator iterator() { - return new DecoratingIterator(iterable.iterator()) { - public int stopIndex; - public int totalElementsCount; - private List list; - private int currentIndex = 0; - - @Override - public TYPE computeNext() { - initialize(); - - TYPE candidate = null; - while(currentIndex < stopIndex && fromIterator.hasNext()) { - currentIndex++; - fromIterator.next(); - } - if(currentIndex >= stopIndex && fromIterator.hasNext()) { - candidate = fromIterator.next(); - } - return candidate; - } - - private void initialize() { - if(list == null) { - list = new ArrayList<>(); - Iterator newIterator = iterable.iterator(); - while(newIterator.hasNext()) { - list.add(newIterator.next()); - } - - totalElementsCount = list.size(); - stopIndex = totalElementsCount - count; - } - } - }; - } - }; - } - - /** - * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. - * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE - * @param the target type of the transformation - * @return a new FluentIterable of the new type - */ - @Override - public FluentIterable map(Function function) { - return new LazyFluentIterable() { - @Override - public Iterator iterator() { - return new DecoratingIterator(null) { - Iterator oldTypeIterator = iterable.iterator(); - @Override - public NEW_TYPE computeNext() { - while(oldTypeIterator.hasNext()) { - TYPE candidate = oldTypeIterator.next(); - return function.apply(candidate); - } - return null; - } - }; - } - }; - } - - /** - * Collects all remaining objects of this iteration into a list. - * @return a list with all remaining objects of this iteration - */ - @Override - public List asList() { - List copy = FluentIterable.copyToList(iterable); - return copy; - } - - @Override - public Iterator iterator() { + /** + * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy + * the predicate. + * + * @param predicate the condition to test with for the filtering. If the test is negative, the + * tested object is removed by the iterator. + * @return a new FluentIterable object that decorates the source iterable + */ + @Override + public FluentIterable filter(Predicate predicate) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { return new DecoratingIterator(iterable.iterator()) { - @Override - public TYPE computeNext() { - return fromIterator.next(); + @Override + public TYPE computeNext() { + while (fromIterator.hasNext()) { + TYPE candidate = fromIterator.next(); + if (!predicate.test(candidate)) { + continue; + } + return candidate; } - }; - } - /** - * @return a FluentIterable from a given iterable. Calls the LazyFluentIterable constructor. - */ - public static final FluentIterable from(Iterable iterable) { - return new LazyFluentIterable<>(iterable); - } + return null; + } + }; + } + }; + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * + * @return an Optional containing the first object of this Iterable + */ + @Override + public Optional first() { + Iterator resultIterator = first(1).iterator(); + return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); + } + + /** + * Can be used to collect objects from the iteration. + * + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' first + * objects. + */ + @Override + public FluentIterable first(int count) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + int currentIndex = 0; + + @Override + public TYPE computeNext() { + if (currentIndex < count) { + if (fromIterator.hasNext()) { + TYPE candidate = fromIterator.next(); + currentIndex++; + return candidate; + } + } + return null; + } + }; + } + }; + } + + /** + * Can be used to collect objects from the iteration. Is a terminating operation. + * + * @return an Optional containing the last object of this Iterable + */ + @Override + public Optional last() { + Iterator resultIterator = last(1).iterator(); + return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); + } + + /** + * Can be used to collect objects from the Iterable. Is a terminating operation. This operation is + * memory intensive, because the contents of this Iterable are collected into a List, when the + * next object is requested. + * + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' last + * objects + */ + @Override + public FluentIterable last(int count) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + private int stopIndex; + private int totalElementsCount; + private List list; + private int currentIndex = 0; + + @Override + public TYPE computeNext() { + initialize(); + + TYPE candidate = null; + while (currentIndex < stopIndex && fromIterator.hasNext()) { + currentIndex++; + fromIterator.next(); + } + if (currentIndex >= stopIndex && fromIterator.hasNext()) { + candidate = fromIterator.next(); + } + return candidate; + } + + private void initialize() { + if (list == null) { + list = new ArrayList<>(); + Iterator newIterator = iterable.iterator(); + while (newIterator.hasNext()) { + list.add(newIterator.next()); + } + + totalElementsCount = list.size(); + stopIndex = totalElementsCount - count; + } + } + }; + } + }; + } + + /** + * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. + * + * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE + * @param the target type of the transformation + * @return a new FluentIterable of the new type + */ + @Override + public FluentIterable map(Function function) { + return new LazyFluentIterable() { + @Override + public Iterator iterator() { + return new DecoratingIterator(null) { + Iterator oldTypeIterator = iterable.iterator(); + + @Override + public NEW_TYPE computeNext() { + while (oldTypeIterator.hasNext()) { + TYPE candidate = oldTypeIterator.next(); + return function.apply(candidate); + } + return null; + } + }; + } + }; + } + + /** + * Collects all remaining objects of this iteration into a list. + * + * @return a list with all remaining objects of this iteration + */ + @Override + public List asList() { + List copy = FluentIterable.copyToList(iterable); + return copy; + } + + @Override + public Iterator iterator() { + return new DecoratingIterator(iterable.iterator()) { + @Override + public TYPE computeNext() { + return fromIterator.next(); + } + }; + } + + /** + * @return a FluentIterable from a given iterable. Calls the LazyFluentIterable constructor. + */ + public static final FluentIterable from(Iterable iterable) { + return new LazyFluentIterable<>(iterable); + } } diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java index 0736387e5..db7a31954 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java @@ -8,175 +8,191 @@ import java.util.function.Function; import java.util.function.Predicate; /** - * This is a simple implementation of the FluentIterable interface. It evaluates - * all chained operations eagerly. - * This implementation would be costly to be utilized in real applications. + * This is a simple implementation of the FluentIterable interface. It evaluates all chained + * operations eagerly. This implementation would be costly to be utilized in real applications. + * * @param the type of the objects the iteration is about */ public class SimpleFluentIterable implements FluentIterable { - private final Iterable iterable; + private final Iterable iterable; - /** - * This constructor creates a copy of a given iterable's contents. - * @param iterable the iterable this interface copies to work on. - */ - protected SimpleFluentIterable(Iterable iterable) { - List copy = FluentIterable.copyToList(iterable); - this.iterable = copy; + /** + * This constructor creates a copy of a given iterable's contents. + * + * @param iterable the iterable this interface copies to work on. + */ + protected SimpleFluentIterable(Iterable iterable) { + this.iterable = iterable; + } + + /** + * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy + * the predicate. + * + * @param predicate the condition to test with for the filtering. If the test is negative, the + * tested object is removed by the iterator. + * @return the same FluentIterable with a filtered collection + */ + @Override + public final FluentIterable filter(Predicate predicate) { + Iterator iterator = iterator(); + while (iterator.hasNext()) { + TYPE nextElement = iterator.next(); + if (!predicate.test(nextElement)) { + iterator.remove(); + } + } + return this; + } + + /** + * Can be used to collect objects from the Iterable. Is a terminating operation. + * + * @return an option of the first object of the Iterable + */ + @Override + public final Optional first() { + Iterator resultIterator = first(1).iterator(); + return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); + } + + /** + * Can be used to collect objects from the Iterable. Is a terminating operation. + * + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' first + * objects. + */ + @Override + public final FluentIterable first(int count) { + Iterator iterator = iterator(); + int currentCount = 0; + while (iterator.hasNext()) { + iterator.next(); + if (currentCount >= count) { + iterator.remove(); + } + currentCount++; + } + return this; + } + + /** + * Can be used to collect objects from the Iterable. Is a terminating operation. + * + * @return an option of the last object of the Iterable + */ + @Override + public final Optional last() { + List list = last(1).asList(); + if (list.isEmpty()) { + return Optional.empty(); + } + return Optional.of(list.get(0)); + } + + /** + * Can be used to collect objects from the Iterable. Is a terminating operation. + * + * @param count defines the number of objects to return + * @return the same FluentIterable with a collection decimated to a maximum of 'count' last + * objects + */ + @Override + public final FluentIterable last(int count) { + int remainingElementsCount = getRemainingElementsCount(); + Iterator iterator = iterator(); + int currentIndex = 0; + while (iterator.hasNext()) { + iterator.next(); + if (currentIndex < remainingElementsCount - count) { + iterator.remove(); + } + currentIndex++; } - /** - * Filters the contents of Iterable using the given predicate, leaving only the ones which satisfy the predicate. - * @param predicate the condition to test with for the filtering. If the test - * is negative, the tested object is removed by the iterator. - * @return the same FluentIterable with a filtered collection - */ - @Override - public final FluentIterable filter(Predicate predicate) { - Iterator iterator = iterator(); - while (iterator.hasNext()) { - TYPE nextElement = iterator.next(); - if(!predicate.test(nextElement)) { - iterator.remove(); - } - } - return this; + return this; + } + + /** + * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. + * + * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE + * @param the target type of the transformation + * @return a new FluentIterable of the new type + */ + @Override + public final FluentIterable map(Function function) { + List temporaryList = new ArrayList(); + Iterator iterator = iterator(); + while (iterator.hasNext()) { + temporaryList.add(function.apply(iterator.next())); } + return from(temporaryList); + } - /** - * Can be used to collect objects from the Iterable. Is a terminating operation. - * @return an option of the first object of the Iterable - */ - @Override - public final Optional first() { - Iterator resultIterator = first(1).iterator(); - return resultIterator.hasNext() ? Optional.of(resultIterator.next()) : Optional.empty(); + /** + * Collects all remaining objects of this Iterable into a list. + * + * @return a list with all remaining objects of this Iterable + */ + @Override + public List asList() { + return toList(iterable.iterator()); + } + + /** + * @return a FluentIterable from a given iterable. Calls the SimpleFluentIterable constructor. + */ + public static final FluentIterable from(Iterable iterable) { + return new SimpleFluentIterable<>(iterable); + } + + public static final FluentIterable fromCopyOf(Iterable iterable) { + List copy = FluentIterable.copyToList(iterable); + return new SimpleFluentIterable<>(copy); + } + + @Override + public Iterator iterator() { + return iterable.iterator(); + } + + @Override + public void forEach(Consumer action) { + iterable.forEach(action); + } + + + @Override + public Spliterator spliterator() { + return iterable.spliterator(); + } + + /** + * @return the count of remaining objects of the current Iterable + */ + public final int getRemainingElementsCount() { + int counter = 0; + Iterator iterator = iterator(); + while (iterator.hasNext()) { + iterator.next(); + counter++; } + return counter; + } - /** - * Can be used to collect objects from the Iterable. Is a terminating operation. - * @param count defines the number of objects to return - * @return the same FluentIterable with a collection decimated to a maximum of 'count' first objects. - */ - @Override - public final FluentIterable first(int count) { - Iterator iterator = iterator(); - int currentCount = 0; - while (iterator.hasNext()) { - iterator.next(); - if(currentCount >= count) { - iterator.remove(); - } - currentCount++; - } - return this; - } - - /** - * Can be used to collect objects from the Iterable. Is a terminating operation. - * @return an option of the last object of the Iterable - */ - @Override - public final Optional last() { - List list = last(1).asList(); - if(list.isEmpty()) { - return Optional.empty(); - } - return Optional.of(list.get(0)); - } - - /** - * Can be used to collect objects from the Iterable. Is a terminating operation. - * @param count defines the number of objects to return - * @return the same FluentIterable with a collection decimated to a maximum of 'count' last objects - */ - @Override - public final FluentIterable last(int count) { - int remainingElementsCount = getRemainingElementsCount(); - Iterator iterator = iterator(); - int currentIndex = 0; - while (iterator.hasNext()) { - iterator.next(); - if(currentIndex < remainingElementsCount - count) { - iterator.remove(); - } - currentIndex++; - } - - return this; - } - - /** - * Transforms this FluentIterable into a new one containing objects of the type NEW_TYPE. - * @param function a function that transforms an instance of TYPE into an instance of NEW_TYPE - * @param the target type of the transformation - * @return a new FluentIterable of the new type - */ - @Override - public final FluentIterable map(Function function) { - List temporaryList = new ArrayList(); - Iterator iterator = iterator(); - while (iterator.hasNext()) { - temporaryList.add(function.apply(iterator.next())); - } - return from(temporaryList); - } - - /** - * Collects all remaining objects of this Iterable into a list. - * @return a list with all remaining objects of this Iterable - */ - @Override - public List asList() { - return toList(iterable.iterator()); - } - - /** - * @return a FluentIterable from a given iterable. Calls the SimpleFluentIterable constructor. - */ - public static final FluentIterable from(Iterable iterable) { - return new SimpleFluentIterable<>(iterable); - } - - @Override - public Iterator iterator() { - return iterable.iterator(); - } - - @Override - public void forEach(Consumer action) { - iterable.forEach(action); - } - - - @Override - public Spliterator spliterator() { - return iterable.spliterator(); - } - - /** - * @return the count of remaining objects of the current Iterable - */ - public final int getRemainingElementsCount() { - int counter = 0; - Iterator iterator = iterator(); - while(iterator.hasNext()) { - iterator.next(); - counter++; - } - return counter; - } - - /** - * Collects the remaining objects of the given iterator into a List. - * @return a new List with the remaining objects. - */ - public static List toList(Iterator iterator) { - List copy = new ArrayList<>(); - while (iterator.hasNext()) { - copy.add(iterator.next()); - } - return copy; + /** + * Collects the remaining objects of the given iterator into a List. + * + * @return a new List with the remaining objects. + */ + public static List toList(Iterator iterator) { + List copy = new ArrayList<>(); + while (iterator.hasNext()) { + copy.add(iterator.next()); } + return copy; + } } diff --git a/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java b/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java index 32bbca430..d0abb7bf1 100644 --- a/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java +++ b/fluentinterface/src/test/java/com/iluwatar/fluentinterface/AppTest.java @@ -4,9 +4,9 @@ import org.junit.Test; public class AppTest { - @Test - public void test() { - String[] args = {}; - App.main(args); - } + @Test + public void test() { + String[] args = {}; + App.main(args); + } }