2

Something like:

Ordering<Iterable<ImportXmlRecord>> comparator =
                Ordering.natural().lexicographical().onResultOf();

But sort by ImportXmlRecord field?

4

1 に答える 1

3

そうではありません:

Ordering<Iterable<ImportXmlRecord>> comparator = Ordering.natural()
  .onResultOf(new Function<ImportXmlRecord, Whatever>() {
    public Whatever apply(ImportXmlRecord x) { return x.getWhatever(); }
  }.lexicographical();
于 2012-08-26T22:52:31.400 に答える