CompareTo Semantics

For the property types other than BOOLEAN, NAME, PATH and BINARY, comparison relationsare defined in terms of the result of the compareTo method oninstances V1 and V2 of the Java classcorresponding to the JCR property type (see each section below for the relevantclass). For those types:

·        V1 is equal to V2if and only if V1.compareTo(V2) == 0.

·        V1 is ordered before V2if and only if V1.compareTo(V2) < 0.

·        V1 is ordered after V2if and only if V1.compareTo(V2) > 0.

STRING ,URL,REFFERENCE  and    WEAKREFERENCE

If V1and V2 are values of type STRING, URI, REFERENCE or WEAKREFERENCE then the repository shoulduse the semantics of java.lang.String.compareTo, as described in CompareToSemantics.


DATE

If V1and V2 are values of type DATE then the repository mustuse the semantics of java.lang.Calendar.compareTo, as described in  CompareToSemantics.


DOUBLE

If V1and V2 are values of type DOUBLE then the repository mustuse the semantics of java.lang.Double.compareTo, as described in CompareToSemantics.


Long

If V1and V2 are values of type LONG then the repository mustuse the semantics of java.lang.Long.compareTo, as described in  CompareToSemantics.


DECIMAL

If V1and V2 are values of type DECIMAL then the repository mustuse the semantics of java.lang.BigDecimal.compareTo, as described in  CompareToSemantics.

BOOLEAN

If V1and V2 are values of type BOOLEAN then

·        V1 is equal to V2if and only if V1 == V2.

·        V1 is ordered before V2if and only if V1 == false and V2 == true.

·        V1 is ordered after V2if and only if V1 == true and V2 == false.

NAME

If V1and V2 are values of type NAME and V1 = (N1, L1) and V2= (N2, L2) where N1 and N2 are JCR namespaces and L1 and L2are JCR local names then

·        V1 is equal to V2if and only if N1 is equalto N2 and L1 is equal to L2, according to thesemantics of String.compareTo (see §3.2.7Equality of Names).

·        Ordering isimplementation-specific. The only requirement is that a total order on values of type NAME must be defined,meaning that if V1 and V2 are not equal then either V1 is ordered before V2 or V1 is ordered after V2.


PATH

If V1and V2 are values of type PATH then

·        V1 is equal to V2if and only if V1 and V2 are segment-equal (see §3.3.8 Equalityof Paths).

·        Ordering isimplementation-specific. The only requirement is that a total order on values of type PATH must be defined,meaning that if V1 and V2 are not equal then either V1 is ordered before V2 or V1 is ordered after V2.


BINARY

If V1and V2 are values of type BINARY and given,

·        V1 is equal to V2if and only if V1 and V2 are bitwise equivalent.

·        Ordering is implementation-specific.




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值