CompareTo Semantics[通俗易懂]

CompareTo Semantics[通俗易懂]ForthepropertytypesotherthanBOOLEAN,NAME,PATHandBINARY,comparisonrelationsaredefinedintermsoftheresultofthecompareTomethodoninstancesV1andV2oftheJavaclasscorrespondingto

大家好,又见面了,我是你们的朋友全栈君。

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.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/159793.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • mapminmax 用法

    mapminmax 用法mapminmax是MATLAB实现归一化的工具包,默认:(1)将矩阵的每行分别进行归一化;(2)每行的最大值最小值作为每行归一化的xmin和xmax;(3)将数据归一化到[-1,1].若要将数据归一化到0到1之间,即y∈[0,1],使用b=mapminmax(a,0,1);若给与确定的最大值和最小值作为每行的xmin和xmax,使用:b= mapminmax(a,0,1);PS.xmin…

    2022年6月30日
    32
  • android刘海屏适配(刘海屏或圆角适配)

    安卓P版本也就是刚发布的安卓9.0其中就加入了刘海屏相关的API。其相关行为与功能变更也是非常多的,从其变更的趋势及功能来看,google在进一步的收紧权限。其P版本变更行为中就加入了对非SDK接口使用的新限制。无论是直接,通过反射还是通过JNI。只要应用程序引用非SDK接口或尝试使用反射或JNI获取其句柄,就会应用这些限制。通常,应用程序应仅使用SDK中类的官方记录部分。特别是,这意味着…

    2022年4月10日
    170
  • centos6.5防火墙关闭命令(cmd关闭防火墙)

    cmd命令关闭防火墙netstopmpssvc CentOS6关闭防火墙使用以下命令,//临时关闭serviceiptablesstop//禁止开机启动chkconfigiptablesoffCentOS7中若使用同样的命令会报错,stop iptables.serviceFailedtostopiptables.service:Unitipt…

    2022年4月11日
    178
  • 查看Linux内核版本命令[通俗易懂]

    查看Linux内核版本命令[通俗易懂]查看Linux内核版本命令(两种方法):1、cat/proc/version[root@S-CentOShome]#cat/proc/versionLinuxversion2.6.32-431.el6.x86_64(mockbuild@c6b8.bsys.dev.centos.org)(gccversion4.4.720120313(RedHat4.4.7-4)(GCC))#1SMPFriNov2203:15:09UTC20132、uname-a[ro

    2025年7月14日
    0
  • linux mysql mysql.sock(mysqldump命令详解)

    什么是socat?socat是一个实用的命令行工具。常用方法端口转发#端口转发#socat-d-d-lf/var/log/socat.logTCP4-LISTEN:6666,bind=127.0.0.1,reuseaddr,forkTCP:127.0.0.1:3306#mysql-uroot-h127.0.0.1-P6666-p文件写入#不使用group则默认当前用户soc…

    2022年4月10日
    135
  • php怎么查看一个变量的占用内存

    php怎么查看一个变量的占用内存php怎么查看一个变量的占用内存

    2022年4月24日
    178

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号