Closed GoogleCodeExporter closed 9 years ago
The following is a cleaner variant with name changed:
class Limit<A extends Comparable>
extends Comparable<Limit<? extends A>> {
static <A extends Comparable> Limit<A> least();
static <A extends Comparable> Limit<A> greatest();
static <A extends Comparable> Limit<A> at(A a);
/**
@throws NoSuchElementException
if least or greatest
*/
A get();
/**
@return
-1 if least, 0 if definite, or 1 if greatest
*/
int defnum(); // definitude number
int compareGetTo(A a); // -1 if least; 1 if greatest; otherwise, get().compareTo(a)
int compareTo(Limit<? extends A> val); // Note: least() == least(), greatest() == greatest()
}
Original comment by jamie.sp...@gmail.com
on 7 Feb 2014 at 12:32
I find this very difficult to understand and cannot envision a real-world use
case for it. If you want to reopen this, you should provide that real-world
use case (even one's a start, but the conventional wisdom says three), and show
us what the code looks like to accomplish it both with and without your
utility. Then convince us the need comes up often enough to be worth an
addition to Guava.
("You wish to define a distance operation" is not a use case; what are you
"really trying to do?")
Original comment by kevinb@google.com
on 10 Feb 2014 at 6:09
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:10
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:07
Original issue reported on code.google.com by
jamie.sp...@gmail.com
on 6 Feb 2014 at 5:37