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 설명서입니다 java.util.stream.Collectors
.
이 페이지의 일부는 만들고 공유하며 에 설명된 용어에 따라 사용되는 작업을 기반으로 수정됩니다.
속성
Class |
이 |
Handle |
기본 Android instance 대한 핸들입니다. (다음에서 상속됨 Object) |
JniIdentityHashCode |
의 구현은 |
JniPeerMembers |
의 구현은 |
PeerReference |
의 구현은 |
ThresholdClass |
이 API는 Android용 Mono 인프라를 지원하며 코드에서 직접 사용할 수 없습니다. (다음에서 상속됨 Object) |
ThresholdType |
이 API는 Android용 Mono 인프라를 지원하며 코드에서 직접 사용할 수 없습니다. (다음에서 상속됨 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() |
이 개체의 모니터에서 대기 중인 단일 스레드를 해제합니다. (다음에서 상속됨 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>합니다. (다음에서 상속됨 Object) |
Wait(Int64) |
현재 스레드가 깨어날 때까지 대기하게 하며, 일반적으로 <알림을 받<>거나 중단</>em>>을 받거나 <일정량의 실시간이 경과할 때까지 대기합니다. (다음에서 상속됨 Object) |
Wait(Int64, Int32) |
현재 스레드가 깨어날 때까지 대기하게 하며, 일반적으로 <알림을 받<>거나 중단</>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) |
의 구현은 |