2010-12-23 4 views

답변

7

정확합니다. 그게 전부입니다. 로 이동 기본 구현을 사용합니다 Ordered의 다른 방법은 다음과 같습니다

def < (that: A): Boolean = (this compare that) < 0 
def > (that: A): Boolean = (this compare that) > 0 
def <= (that: A): Boolean = (this compare that) <= 0 
def >= (that: A): Boolean = (this compare that) >= 0 
def compareTo(that: A): Int = compare(that) 

당신이 이전 compareTo 방법을 사용하여 정의됩니다 Ordered의 기본 구현이 비교되어이없는 유일한 것은, . 위의 내용이 다른 비교를 위해 원하는 경우 작동해야합니다.

+1

감사합니다. – soc

관련 문제