Java Object Comparable using many attributes

I have some orders to be loaded and unloaded in delivery routes, one route can have one OrderDocument asigned to it to be loaded, unloaded or both.

Each order-document is ordered by an index in the route assigned. So the class looks like this:

class OrderDocument implements Comparable{

int order_id; // The document ID

int route_load_id; // The route this order is assigned to be loaded

int route_unload_id; // The route this order is assigned to be loaded, may be same as route_load_id and viceversa

int route_load_index; // The index order in load route

int route_unload_index; //...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts