Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
of course it could be used for anything which needs the last item from the
elements.
Original comment by ikara...@gmail.com
on 19 Nov 2010 at 1:20
Why not use Iterators.filter(Iterator, Predicate) or Ordering.min/max(Iterable)
?
Original comment by amer...@gmail.com
on 19 Nov 2010 at 1:51
[deleted comment]
ohh, I see. thanks :)
Original comment by ikara...@gmail.com
on 19 Nov 2010 at 2:04
It looks like @amertum solved the issue that generated this report.
Just one thing I thought I'd point out from the original report as a caution...
In the sample code, Predicates.min() and Predicates.max() would have to be
stateful, which is strongly discouraged by the contract of Predicate.apply():
"This method is generally expected, but not absolutely required, to have the
following properties:
- Its execution does not cause any observable side effects.
- The computation is consistent with equals; that is, Objects.equal(a, b) implies that predicate.apply(a) == predicate.apply(b))."
Original comment by boppenh...@google.com
on 20 Nov 2010 at 5:31
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:15
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:09
Original issue reported on code.google.com by
ikara...@gmail.com
on 19 Nov 2010 at 12:21