Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //declaration section
- Multimap<Location, Interconnect> interconnects;
- interconnects = TreeMultimap.create(Ordering.natural(),
- Interconnect.ORDER_NATURAL_NULLCHECK);
- //comparator provider
- static final Ordering<Interconnect> ORDER_NATURAL_NULLCHECK = new Ordering<Interconnect>() {
- @Override
- public int compare(@Nullable final Interconnect arg0,
- @Nullable final Interconnect arg1) {
- return Ordering.natural().nullsFirst().compare(arg0, arg1);
- }
- };
- //and I can do kind of the following quite happily:
- interconnects.put(new Location(), null);
- interconnects.put(new Location(), null);
- interconnects.put(new Location(), null);
- interconnects.put(new Location(), new Interconnect("A"));
- interconnects.put(new Location(), new Interconnect("A");
Add Comment
Please, Sign In to add comment