public abstract class CollectionUtils extends CollectionUtils
CollectionUtils は、Java コレクションフレームワークおよびクラスを操作するための抽象ユーティリティクラスです。CollectionSE, CollectionsSE, EnumerationSE, IteratorSE, ListSE, MapSE, SetSE, CollectionUtils| コンストラクターと説明 |
|---|
CollectionUtils() |
| 修飾子と型 | メソッドと説明 |
|---|---|
static <E,T extends CollectionSE<E>> | addAll(T collection, IterableSE<E> iterable) 指定された IterableSE のすべての要素を CollectionSE に追加します。 |
static <T> SetSE<T> | asSet(T... elements) 指定されたオブジェクト配列の要素を含む変更不可能な SetSE を返します。 |
static boolean | containsAny(CollectionSE<?> collection, ObjectSE... elements) 指定された CollectionSE に指定された配列の要素が含まれているかどうかを判断する null セーフメソッド。 |
static <T> IterableSE<T> | emptyIterable() 空の IterableSE オブジェクトを返します。 |
static <T> IterableSE<T> | iterable(EnumerationSE<T> enumeration) 指定された Enumeration を、for each ループ内で使用するために Iterable オブジェクトとして適応します。 |
static <T> IterableSE<T> | iterable(IteratorSE<T> iterator) 指定された Iterator を、for each ループ内で使用するために Iterable オブジェクトとして適応します。 |
static <T> CollectionSE<T> | nullSafeCollection(CollectionSE<T> collection) |
static <T> EnumerationSE<T> | nullSafeEnumeration(EnumerationSE<T> enumeration)null セーフな操作。null でない場合は指定された EnumerationSE を返し、null の場合は empty EnumerationSE を返します。 |
static boolean | nullSafeIsEmpty(CollectionSE<?> collection) 指定された CollectionSE が emptySE であるかどうかを判断します。 |
static boolean | nullSafeIsEmpty(MapSE<?,?> map) |
static <T> IterableSE<T> | nullSafeIterable(IterableSE<T> iterable)null 以外の場合は元の Iterable オブジェクトを返し、null の場合はデフォルトの空の Iterable 実装を返す null セーフ操作。 |
static <E,T extends IterableSE<E>> | nullSafeIterable(T iterable, T defaultIterable)null または空でない場合は指定された IterableSE を返し、それ以外の場合は defaultIterable を返します。 |
static <T> IteratorSE<T> | nullSafeIterator(IteratorSE<T> iterator)null セーフな操作。null でない場合は指定された IteratorSE を返し、null の場合は empty IteratorSE を返します。 |
static <T> ListSE<T> | nullSafeList(ListSE<T> list) |
static <K,V> MapSE<K,V> | nullSafeMap(MapSE<K,V> map) |
static <T> SetSE<T> | nullSafeSet(SetSE<T> set) |
static int | nullSafeSize(CollectionSE<?> collection) 指定された CollectionSE の Collection.size()SE を決定します。 |
static int | nullSafeSize(MapSE<?,?> map) 指定された MapSE の Map.size()SE を決定します。 |
static <T extends ComparableSE<T>> | sort(ListSE<T> list) 指定された ListSE の要素を自然な ComparableSE 順序で並べ替えます。 |
static <T> ListSE<T> | subList(ListSE<T> source, int... indices) 指定された indices に基づいて、指定された ListSE の要素のサブリストを返します。 |
static StringSE | toString(MapSE<?,?> map) |
arrayToList, contains, contains, containsAny, containsInstance, findCommonElementType, findFirstMatch, findValueOfType, findValueOfType, firstElement, firstElement, hasUniqueObject, isEmpty, isEmpty, lastElement, lastElement, mergeArrayIntoCollection, mergePropertiesIntoMap, toArray, toIterator, toMultiValueMap, unmodifiableMultiValueMapcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic static <E,T extends CollectionSE<E>> T addAll(@NonNull T collection, @Nullable IterableSE<E> iterable)
IterableSE のすべての要素を CollectionSE に追加します。E - CollectionSE および IterableSE 内の要素の ClassSE 型。T - CollectionSE の具体的な ClassSE 型。collection - IterableSE の要素を追加する CollectionSE。iterable - CollectionSE に追加する要素を含む IterableSE。CollectionSE。IllegalArgumentExceptionSE - CollectionSE が null の場合。IterableSE, CollectionSE@SafeVarargsSE public static <T> SetSE<T> asSet(@NonNull T... elements)
SetSE を返します。public static boolean containsAny(@Nullable CollectionSE<?> collection, @Nullable ObjectSE... elements)
CollectionSE に指定された配列の要素が含まれているかどうかを判断する null セーフメソッド。collection - 評価する CollectionSEelements - 評価する要素の配列。Collection.contains(Object)SE@NonNull public static <T> IterableSE<T> emptyIterable()
IterableSE オブジェクトを返します。T - IterableSE 内の要素の ClassSE 型。IterableSE。IterableSE, nullSafeIterable(Iterable)@NonNull public static <T> IterableSE<T> iterable(@Nullable EnumerationSE<T> enumeration)
T - 列挙要素のクラス型。enumeration - Iterable オブジェクトとして適応する列挙体。IterableSE, EnumerationSE@NonNull public static <T> IterableSE<T> iterable(@Nullable IteratorSE<T> iterator)
T - Iterator 要素のクラス型。iterator - Iterator を Iterable オブジェクトとして適応させます。IterableSE, IteratorSE@NonNull public static <T> CollectionSE<T> nullSafeCollection(@Nullable CollectionSE<T> collection)
T - CollectionSE 要素のクラス型。collection - 評価する CollectionSE。CollectionSE が null でない場合、または空の CollectionSE (ListSE で実装) を返します。Collections.emptyList()SE, CollectionSE@NonNull public static <T> EnumerationSE<T> nullSafeEnumeration(@Nullable EnumerationSE<T> enumeration)
EnumerationSE を返し、null の場合は empty EnumerationSE を返します。T - EnumerationSE に含まれる要素の typeSE。enumeration - 評価する EnumerationSE。EnumerationSE、または empty EnumerationSE。Collections.emptyEnumeration()SE, EnumerationSE@NonNull public static <T> IterableSE<T> nullSafeIterable(@Nullable IterableSE<T> iterable)
T - 反復可能な要素のクラス型。iterable - Iterable オブジェクトが null 参照として評価されました。emptyIterable(), IterableSE@Nullable public static <E,T extends IterableSE<E>> T nullSafeIterable(@Nullable T iterable, @Nullable T defaultIterable)
IterableSE を返し、それ以外の場合は defaultIterable を返します。T - IterableSE の具体的な ClassSE 型。E - IterablesSE 内の要素の ClassSE 型。iterable - 評価する IterableSE。defaultIterable - 指定された iterable が null または空の場合に返される IterableSE。iterable を返し、それ以外の場合は defaultIterable を返します。IterableSE@NonNull public static <T> IteratorSE<T> nullSafeIterator(@Nullable IteratorSE<T> iterator)
IteratorSE を返し、null の場合は empty IteratorSE を返します。T - IteratorSE に含まれる要素の typeSE。iterator - 評価する IteratorSE。IteratorSE、または empty IteratorSE。Collections.emptyIterator()SE, IteratorSEpublic static boolean nullSafeIsEmpty(@Nullable CollectionSE<?> collection)
CollectionSE が emptySE であるかどうかを判断します。collection - 評価する CollectionSE。CollectionSE が emptySE であるかどうかを示すブール値。nullSafeCollection(Collection), Collection.isEmpty()SEpublic static boolean nullSafeIsEmpty(@Nullable MapSE<?,?> map)
map - 評価する MapSE。MapSE が emptySE であるかどうかを示すブール値。nullSafeMap(Map), Map.isEmpty()SEpublic static int nullSafeSize(@Nullable CollectionSE<?> collection)
CollectionSE の Collection.size()SE を決定します。collection - 評価する CollectionSE。CollectionSE の Collection.size()SE。nullSafeCollection(Collection), Collection.size()SEpublic static int nullSafeSize(@Nullable MapSE<?,?> map)
MapSE の Map.size()SE を決定します。map - 評価する MapSE。MapSE の Map.size()SE。nullSafeMap(Map), Map.size()SEpublic static <T extends ComparableSE<T>> ListSE<T> sort(@NonNull ListSE<T> list)
ListSE の要素を自然な ComparableSE 順序で並べ替えます。T - コレクション要素の ComparableSE クラス型。list - ソートする要素の ListSE。ListSE は解決しました。Collections.sort(List)SE, ListSEpublic static <T> ListSE<T> subList(@NonNull ListSE<T> source, int... indices)
indices に基づいて、指定された ListSE の要素のサブリストを返します。T - リスト内の要素のクラス型。source - サブリストの要素が構築される ListSE。indices - サブリストの構築に使用される要素への source ListSE 内のインデックスの配列。indices に基づく、指定された ListSE からの要素のサブリスト。IndexOutOfBoundsExceptionSE - インデックスの配列にリストの範囲内にないインデックスが含まれている場合。NullPointerExceptionSE - リストまたはインデックスのいずれかが null の場合。ListSECopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.