본문 바로가기

Java/API

[Java API] Interface Comparator<T>


Interface Comparator<T>


Type Parameters:

T - the type of objects that may be compared by this comparator




@FunctionalInterface

public interface Comparator<T>


객체의 일부 Collection에 순서를 부과하는 비교 함수입니다. sort 순서를 제어할 수 있습니다.


Method


int compare(T o1, T o2)


o1와 o2를 비교합니다. o1 > o2이면 양수, o1 < o2이면 음수, o1 == o2이면 0을 반환합니다.







'Java > API' 카테고리의 다른 글

[Java API] Interface IntStream  (0) 2019.03.30
[Java API] Class Collections  (0) 2019.03.29
[Java API] Class String  (0) 2019.03.28
[Java API] Class Calendar.Builder  (0) 2019.03.28
[Java API] Class Calendar  (0) 2019.03.28