/** * Sort by short name. */ public int compareTo(PluginWrapper pw) { return shortName.compareToIgnoreCase(pw.shortName); }
public int compare(String lhs, String rhs) { return lhs.compareToIgnoreCase(rhs); }
@Override public int compare(String o1, String o2) { return o1.compareToIgnoreCase(o2); } });
protected int compare(long idA, long idB) { String tga = map.get(idA), tgb = map.get(idB); int result = (tga!=null?-1:0) + (tgb!=null?1:0); // Will be non-zero if only one is null if (result==0 && tga!=null) result = tga.compareToIgnoreCase(tgb); return result; } }
@Override public boolean test(String a, String b) { return a.compareToIgnoreCase(b) == 0; } })
@Override public boolean test(String a, String b) { return a.compareToIgnoreCase(b) == 0; } })
/** * Compares two strings using the case-sensitivity rule. * <p> * This method mimics {@link String#compareTo} but takes case-sensitivity * into account. * * @param str1 the first string to compare, not null * @param str2 the second string to compare, not null * @return true if equal using the case rules * @throws NullPointerException if either string is null */ public int checkCompareTo(final String str1, final String str2) { if (str1 == null || str2 == null) { throw new NullPointerException("The strings must not be null"); } return sensitive ? str1.compareTo(str2) : str1.compareToIgnoreCase(str2); }
@Override public int compare(String s1, String s2) { if (s1 == null && s2 == null) { return 0; } if (s1 == null) { return -1; } if (s2 == null) { return 1; } int i1 = s1.lastIndexOf('.'); if (i1 >= 0) { s1 = s1.substring(i1 + 1); } int i2 = s2.lastIndexOf('.'); if (i2 >= 0) { s2 = s2.substring(i2 + 1); } return s1.compareToIgnoreCase(s2); } };
@Override public int compare(String s1, String s2) { if (s1 == null && s2 == null) { return 0; } if (s1 == null) { return -1; } if (s2 == null) { return 1; } int i1 = s1.lastIndexOf('.'); if (i1 >= 0) { s1 = s1.substring(i1 + 1); } int i2 = s2.lastIndexOf('.'); if (i2 >= 0) { s2 = s2.substring(i2 + 1); } return s1.compareToIgnoreCase(s2); } };
public int compare(Thread a, Thread b) { int result = compare(a.getId(), b.getId()); if (result == 0) result = a.getName().compareToIgnoreCase(b.getName()); return result; } }
public int compare(ThreadInfo a, ThreadInfo b) { int result = compare(a.getThreadId(), b.getThreadId()); if (result == 0) result = a.getThreadName().compareToIgnoreCase(b.getThreadName()); return result; } }
public int compare(File file1, File file2) { String ext1 = FileNameUtil.getExtension(file1.getName()); String ext2 = FileNameUtil.getExtension(file2.getName()); long diff = ext1.compareToIgnoreCase(ext2); if (diff == 0) { return 0; } if (diff > 0) { return order; } return -order; } }
/** * Does case-insensitive comparison. * {@inheritDoc} */ @Override public final int compareTo(VirtualFile o) { return getName().compareToIgnoreCase(o.getName()); }
@Override public int compare(Item i1, Item i2) { return name(i1).compareToIgnoreCase(name(i2)); }
@Override public int compare(Item i1, Item i2) { return name(i1).compareToIgnoreCase(name(i2)); }
public int compareTo(PluginEntry o) { int r = category.compareTo(o.category); if (r==0) r = plugin.name.compareToIgnoreCase(o.plugin.name); if (r==0) r = new VersionNumber(plugin.version).compareTo(new VersionNumber(o.plugin.version)); return r; }
private List<InfoItem> getSubscriptionItems(List<SubscriptionEntity> subscriptions) { List<InfoItem> items = new ArrayList<>(); for (final SubscriptionEntity subscription : subscriptions) { items.add(subscription.toChannelInfoItem()); } Collections.sort(items, (InfoItem o1, InfoItem o2) -> o1.getName().compareToIgnoreCase(o2.getName())); return items; }
@Override public int compareTo(MachineInfo o) { if (this == o) { return 0; } if (!port.equals(o.getPort())) { return port.compareTo(o.getPort()); } if (!StringUtil.equals(app, o.getApp())) { return app.compareToIgnoreCase(o.getApp()); } return ip.compareToIgnoreCase(o.getIp()); }
@Override public int compare(BlockWorkerInfo o1, BlockWorkerInfo o2) { return o1.getNetAddress().toString().compareToIgnoreCase(o2.getNetAddress().toString()); } });
@Override public int compare(ServerName o1, ServerName o2) { int compare = o1.getHostname().compareToIgnoreCase(o2.getHostname()); if (compare != 0) return compare; compare = o1.getPort() - o2.getPort(); if (compare != 0) return compare; return 0; } }