I'm writing a utility class that displays a series of data points and instead of having to loop through every instance of the class to set it I'd like to set it all at once (keeping the option of setting an individual object if I want). Is this possible? Thanks!
Hello all,
I've used an instance of the Comparable interface in my class to reorder the object by id and I'm wondering if it's possible to resort the object by other criteria (such as date) by using two instances of the interface.
My apologies ahead of time if this is a bit of a JAVA newb question. I'm still getting the hang of diving deeper into the language from Processing. Example of what I'm doing below (I believe Comparable's been discussed before in this forum but not asked about like this):
public class Joe implements Comparable {
...
int compareTo(Object o)
{
Joe other=(Joe)o;
if (other.id>id)
return -1;
if (other.id==id)
return 0;
else
return 1;
}
...