Collectors クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コレクションへの要素の Collector
蓄積、さまざまな基準に従った要素の集計など、さまざまな有用な削減操作を実装する の実装。
[Android.Runtime.Register("java/util/stream/Collectors", ApiSince=24, DoNotGenerateAcw=true)]
public sealed class Collectors : Java.Lang.Object
[<Android.Runtime.Register("java/util/stream/Collectors", ApiSince=24, DoNotGenerateAcw=true)>]
type Collectors = class
inherit Object
- 継承
- 属性
注釈
コレクションへの要素の Collector
蓄積、さまざまな基準に従った要素の集計など、さまざまな有用な削減操作を実装する の実装。
定義済みのコレクターを使用して一般的な変更可能な削減タスクを実行する例を次に示します。
{@code
// Accumulate names into a List
List<String> list = people.stream()
.map(Person::getName)
.collect(Collectors.toList());
// Accumulate names into a TreeSet
Set<String> set = people.stream()
.map(Person::getName)
.collect(Collectors.toCollection(TreeSet::new));
// Convert elements to strings and concatenate them, separated by commas
String joined = things.stream()
.map(Object::toString)
.collect(Collectors.joining(", "));
// Compute sum of salaries of employee
int total = employees.stream()
.collect(Collectors.summingInt(Employee::getSalary));
// Group employees by department
Map<Department, List<Employee>> byDept = employees.stream()
.collect(Collectors.groupingBy(Employee::getDepartment));
// Compute sum of salaries by department
Map<Department, Integer> totalByDept = employees.stream()
.collect(Collectors.groupingBy(Employee::getDepartment,
Collectors.summingInt(Employee::getSalary)));
// Partition students into passing and failing
Map<Boolean, List<Student>> passingFailing = students.stream()
.collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD));
}
1.8 で追加されました。
の java.util.stream.Collectors
Java ドキュメント。
このページの一部は、によって作成および共有された作業に基づく変更であり、に記載されている条件に従って使用されます。
プロパティ
Class |
この |
Handle |
基になる Android インスタンスへのハンドル。 (継承元 Object) |
JniIdentityHashCode |
コレクションへの要素の |
JniPeerMembers |
コレクションへの要素の |
PeerReference |
コレクションへの要素の |
ThresholdClass |
この API は Mono for Android インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。 (継承元 Object) |
ThresholdType |
この API は Mono for Android インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。 (継承元 Object) |
メソッド
AveragingDouble(IToDoubleFunction) |
|
AveragingInt(IToIntFunction) |
|
AveragingLong(IToLongFunction) |
|
Clone() |
このオブジェクトのコピーを作成して返します。 (継承元 Object) |
CollectingAndThen(ICollector, IFunction) |
追加の |
Counting() |
入力要素の数を |
Dispose() |
コレクションへの要素の |
Dispose(Boolean) |
コレクションへの要素の |
Equals(Object) |
他のオブジェクトがこのオブジェクトと "等しい" かどうかを示します。 (継承元 Object) |
Filtering(IPredicate, ICollector) |
|
GetHashCode() |
オブジェクトのハッシュ コード値を返します。 (継承元 Object) |
GroupingBy(IFunction) |
型 |
GroupingBy(IFunction, ICollector) |
型 |
GroupingBy(IFunction, ISupplier, ICollector) |
型 |
GroupingByConcurrent(IFunction) |
型 |
GroupingByConcurrent(IFunction, ICollector) |
型 |
GroupingByConcurrent(IFunction, ISupplier, ICollector) |
型 |
JavaFinalize() |
オブジェクトへの参照がなくなったとガベージ コレクションが判断したときに、オブジェクトのガベージ コレクターによって呼び出されます。 (継承元 Object) |
Joining() |
入力要素 |
Joining(ICharSequence) |
|
Joining(ICharSequence, ICharSequence, ICharSequence) |
|
Joining(String) |
|
Joining(String, String, String) |
|
Mapping(IFunction, ICollector) |
型の |
MaxBy(IComparator) |
指定された |
MinBy(IComparator) |
指定 |
Notify() |
このオブジェクトのモニターで待機している 1 つのスレッドを起動します。 (継承元 Object) |
NotifyAll() |
このオブジェクトのモニターで待機しているすべてのスレッドを起動します。 (継承元 Object) |
PartitioningBy(IPredicate) |
|
PartitioningBy(IPredicate, ICollector) |
|
Reducing(IBinaryOperator) |
指定した の |
Reducing(Object, IBinaryOperator) |
|
Reducing(Object, IFunction, IBinaryOperator) |
|
SetHandle(IntPtr, JniHandleOwnership) |
Handle プロパティを設定します。 (継承元 Object) |
SummarizingDouble(IToDoubleFunction) |
|
SummarizingInt(IToIntFunction) |
|
SummarizingLong(IToLongFunction) |
|
SummingDouble(IToDoubleFunction) |
|
SummingInt(IToIntFunction) |
|
SummingLong(IToLongFunction) |
|
ToArray<T>() |
コレクションへの要素の |
ToCollection(ISupplier) |
入力要素を |
ToConcurrentMap(IFunction, IFunction) |
指定されたマッピング関数を入力要素に |
ToConcurrentMap(IFunction, IFunction, IBinaryOperator) |
指定されたマッピング関数を入力要素に |
ToConcurrentMap(IFunction, IFunction, IBinaryOperator, ISupplier) |
指定されたマッピング関数を入力要素に |
ToList() |
入力要素を |
ToMap(IFunction, IFunction) |
指定された |
ToMap(IFunction, IFunction, IBinaryOperator) |
指定された |
ToMap(IFunction, IFunction, IBinaryOperator, ISupplier) |
指定された |
ToSet() |
入力要素を |
ToString() |
オブジェクトの文字列形式を返します。 (継承元 Object) |
ToUnmodifiableList() |
|
ToUnmodifiableMap(IFunction, IFunction) |
|
ToUnmodifiableMap(IFunction, IFunction, IBinaryOperator) |
|
ToUnmodifiableSet() |
|
UnregisterFromRuntime() |
コレクションへの要素の |
Wait() |
現在のスレッドが起動するまで待機します。通常<は、通知</em> または>< em 中断</em によって待機します>。> (継承元 Object) |
Wait(Int64) |
現在のスレッドが起動するまで待機します。通常<は、通知></em> または <>em 中断</em>、または特定のリアルタイムが経過するまで待機します。 (継承元 Object) |
Wait(Int64, Int32) |
現在のスレッドが起動するまで待機します。通常<は、通知></em> または <>em 中断</em>、または特定のリアルタイムが経過するまで待機します。 (継承元 Object) |
明示的なインターフェイスの実装
IJavaPeerable.Disposed() |
コレクションへの要素の |
IJavaPeerable.DisposeUnlessReferenced() |
コレクションへの要素の |
IJavaPeerable.Finalized() |
コレクションへの要素の |
IJavaPeerable.JniManagedPeerState |
コレクションへの要素の |
IJavaPeerable.SetJniIdentityHashCode(Int32) |
コレクションへの要素の |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
コレクションへの要素の |
IJavaPeerable.SetPeerReference(JniObjectReference) |
コレクションへの要素の |
拡張メソッド
JavaCast<TResult>(IJavaObject) |
Android ランタイムチェック型変換を実行します。 |
JavaCast<TResult>(IJavaObject) |
コレクションへの要素の |
GetJniTypeName(IJavaPeerable) |
コレクションへの要素の |