MCPcopy Create free account
hub / github.com/Card-Forge/forge / compareTo

Method compareTo

forge-core/src/main/java/forge/item/PaperCard.java:412–429  ·  view source on GitHub ↗
(final IPaperCard o)

Source from the content-addressed store, hash-verified

410 }
411
412 @Override
413 public int compareTo(final IPaperCard o) {
414 final int nameCmp = name.compareToIgnoreCase(o.getName());
415 if (0 != nameCmp) {
416 return nameCmp;
417 }
418 //FIXME: compare sets properly
419 int setDiff = edition.compareTo(o.getEdition());
420 if (0 != setDiff)
421 return setDiff;
422 String thisCollNrKey = getCollectorNumberSortingKey();
423 String othrCollNrKey = makeCollectorNumberSortingKey(o.getCollectorNumber());
424 final int collNrCmp = thisCollNrKey.compareTo(othrCollNrKey);
425 if (0 != collNrCmp) {
426 return collNrCmp;
427 }
428 return Integer.compare(artIndex, o.getArtIndex());
429 }
430
431 @Serial
432 private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {

Callers

nothing calls this directly

Calls 7

getNameMethod · 0.65
getEditionMethod · 0.65
getCollectorNumberMethod · 0.65
getArtIndexMethod · 0.65
compareMethod · 0.45

Tested by

no test coverage detected