T
- このコンパレータで比較できるオブジェクトの型 public class NullSafeComparator<T> extends ObjectSE implements ComparatorSE<T>
Comparable
SE修飾子と型 | フィールドと説明 |
---|---|
static NullSafeComparator | NULLS_HIGH このコンパレーターの共有デフォルトインスタンス。null 以外のオブジェクトよりも null を扱います。 |
static NullSafeComparator | NULLS_LOW このコンパレーターの共有デフォルトインスタンス。null 以外のオブジェクトよりも null を扱います。 |
コンストラクターと説明 |
---|
NullSafeComparator(ComparatorSE<T> comparator, boolean nullsLow) 提供されたフラグに基づいて null をソートする NullSafeComparator を作成し、指定されたコンパレータを装飾します。 |
修飾子と型 | メソッドと説明 |
---|---|
int | compare(T o1, T o2) |
boolean | equals(ObjectSE other) |
int | hashCode() |
StringSE | toString() |
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
comparingSE, comparingSE, comparingDoubleSE, comparingIntSE, comparingLongSE, naturalOrderSE, nullsFirstSE, nullsLastSE, reversedSE, reverseOrderSE, thenComparingSE, thenComparingSE, thenComparingSE, thenComparingDoubleSE, thenComparingIntSE, thenComparingLongSE
public static final NullSafeComparator NULLS_LOW
public static final NullSafeComparator NULLS_HIGH
public NullSafeComparator(ComparatorSE<T> comparator, boolean nullsLow)
null
をソートする NullSafeComparator を作成し、指定されたコンパレータを装飾します。null 以外の 2 つのオブジェクトを比較する場合、指定されたコンパレータが使用されます。指定された基になるコンパレータは、このコンパレータが適用される要素を処理できる必要があります。
comparator
- 2 つの null 以外のオブジェクトを比較するときに使用するコンパレータ nullsLow
- null を、null 以外のオブジェクトよりも低いか高いかで処理するかどうか public int compare(@Nullable T o1, @Nullable T o2)
ComparatorSE<T>
の compareSE
public boolean equals(ObjectSE other)
ComparatorSE<T>
の equalsSE
ObjectSE
の equalsSE
public int hashCode()
ObjectSE
の hashCodeSE
public StringSE toString()
ObjectSE
の toStringSE