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)
上一篇 2022年7月15日 上午9:16
下一篇 2022年7月15日 上午9:36


相关推荐

  • 进程间通信和线程间通信的区别_有些线程包含多个进程

    进程间通信和线程间通信的区别_有些线程包含多个进程进程间通信转自https://www.cnblogs.com/LUO77/p/5816326.html线程间通信https://www.cnblogs.com/jobs1/p/10784021.html线程间通信进程和线程的区别程序只是一组指令的有序集合,它本身没有任何运行的含义,它只是一个静态的实体。而进程则不同,它是程序在某个数据集上的执行。进程是一个动态的实体,它有自己的生命周期。它因创建而产生,因调度而运行,因等待资源或事件而被处于等待状态,因完成任务而被撤消。反映…

    2022年10月7日
    5
  • Linux中解压zip文件

    Linux中解压zip文件简单记录一下linux中如何解压zip文件首先要安装unzipsudoaptinstallunzip之后可以使用下面命令来解压文件:unzipfile.zip将文件解压到指定文件夹中,如果该文件夹不存在,将会被创建unzipfile.zip-ddirectory…

    2022年5月23日
    54
  • java中文输出乱码_java汉字乱码解决办法

    java中文输出乱码_java汉字乱码解决办法自从接触Java和JSP以来,就不断与Java的中文乱码问题打交道,现在终于得到了彻底的解决,现将我们的解决心得与大家共享。一、Java中文问题的由来Java的内核和class文件是基于unicode的,这使Java程序具有良好的跨平台性,但也带来了一些中文乱码问题的麻烦。原因主要有两方面,Java和JSP文件本身编译时产生的乱码问题和Java程序于其他媒介交互产生的乱码问题。首先Java(包括J…

    2022年7月9日
    140
  • 量子计算核心突破!Shor算法实现或使密码成摆设

    量子计算核心突破!Shor算法实现或使密码成摆设http tech sina com cn d i 2016 03 05 doc ifxqafha0387 shtml 互联网时代绝大多数的加密 都由 RSA 算法完成 过去我们认为 RSA 不可激活成功教程 但随着量子计算的发展 RSA 的安全性正受到挑战 今天刊发在 科学 杂志的最新论文 量子计算机有史以来第一次以可扩展的方式 用 Shor 算法完成对数字 15 的质因数分解 IBM 物理科

    2026年3月17日
    1
  • linux查看端口占用的方法有哪些_docker查看端口占用情况

    linux查看端口占用的方法有哪些_docker查看端口占用情况一、liof命令lsof命令的英文是:listopenfiles,用于列出当前系统打开文件。lsof-i:<端口号>例如:lsof-i:8188二、netstat命令netstat-tunlp|grep<port>例如:netstat-tunlp|grep8188…

    2025年7月7日
    5
  • JavaScript使用闭包定义JS模块

    JavaScript使用闭包定义JS模块JavaScript 使用闭包定义 JS 模块可以使用下面的方法定义 JS 模块 对函数操作进行封装 由于闭包的特殊属性 函数内的变量不会被销毁 functionmyMo 私有的数据 varmsg aBcD functiondoSo console log doSomething msg toUpperCase

    2026年3月19日
    2

发表回复

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

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