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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • maven 打的包在哪_maven打包流程学习「建议收藏」

    maven 打的包在哪_maven打包流程学习「建议收藏」前言:最近工作中遇到了几次跟maven打包相关的问题,每个问题上网查资料解决都花了不少时间,很影响工作进度。既然遇到好几次,每次都能发现知识盲点,干脆总结整理一下,啃掉这个难啃的骨头。ps:最近看到了一个很有意思句子:因为今天不想跑步,所以才去跑,这是长距离跑者的思维方式。转载:正文:还是首先描述一下最近遇到的几个问题吧:一、初见springboot多模块项目mvn打包遇到的问题-存在依赖但却…

    2022年5月11日
    42
  • 一步一步写算法(检查表)

    一步一步写算法(检查表)

    2021年12月30日
    35
  • 补码乘法、booth算法、Wallace树

    补码乘法、booth算法、Wallace树补码乘法 booth 算法 Wallace 树补码乘法原理 booth 算法 booth 一位一乘算法 booth 两位一乘算法 Wallace 树补码乘法原理大家都来学习 booth 算法了 那么补码的加法一定了解了 即 X 补 Y 补 X Y 补 X 补 Y 补 X Y 补 X 补 Y 补 X Y 补 那么乘法同样的 我们也想用补码来表示 但是 X 补 Y 补 X Y 补 X 补 Y 补 neq X Y 补 X 补 Y 补 X Y 补 现在我们需要知道补码的定义 对于 n

    2025年6月7日
    2
  • tabnine激活码(注册激活)

    (tabnine激活码)好多小伙伴总是说激活码老是失效,太麻烦,关注/收藏全栈君太难教程,2021永久激活的方法等着你。IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.htmlS32PGH0SQB-eyJsaWNlbnNlSWQi…

    2022年3月26日
    41
  • pycharm教育版安装教程_pycharm专业版安装

    pycharm教育版安装教程_pycharm专业版安装1.打开百度搜索PyCharm进入官网,我们可以看到左边是专业版,右边是社区版,建议使用专业版,功能比较齐全。2. 双击安装包进行安装。自定义软件安装路径(建议路径中不要中文字符)。3.选择开始菜单文件夹(默认即可),点击安装。耐心等待安装。4.安装完成,勾选立即运行PyCharm。5.选择是否导入开发环境配置文件,我们选择不导入。6.阅读协议并同意7.如果有学生的edu邮箱的话可以免费使用…

    2025年6月7日
    3
  • 《chkconfig命令》-linux命令五分钟系列之四

    《chkconfig命令》-linux命令五分钟系列之四

    2021年9月8日
    60

发表回复

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

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