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


相关推荐

  • 生成mysql亿级压测数据程序

    生成mysql亿级压测数据程序

    2021年5月15日
    115
  • java.lang.String cannot be cast to java.lang.Integer错误解决

    java.lang.String cannot be cast to java.lang.Integer错误解决java.lang.Stringcannotbecasttojava.lang.Integer错误解决当遇到t.service()forservlet[springmvc]incontextwithpath[]threwexception…java.lang.Stringcannotbecasttojava.lang.Integer上面是原来的代码,但是这里出现错与不能将object类型的数据库转成integer类型,可以使用Integer.valueOf(S

    2022年7月16日
    27
  • markdown导出为html_python html转word

    markdown导出为html_python html转word关于前端HTML转换为Markdown,发现了一个非常好用的npm项目:https://sitdown.mdnice.com/zh-hans/首先确保本机已经安装nodejs,并根据下面的文章安装execjs并修改其源码:execjs执行包含中文参数的JavaScripthttps://xxmdmst.blog.csdn.net/article/details/123099139在python所在目录安装sitdown:>npminstallsitdownadded2pac

    2022年9月7日
    0
  • 使用npm安装依赖,尽量别使用cnpm,会漏掉很多依赖的

    使用npm安装依赖,尽量别使用cnpm,会漏掉很多依赖的

    2021年10月11日
    51
  • ActivityManager 讲解

    ActivityManager 讲解1.ActivityManager是android框架的一个重要部分,它负责一新ActivityThread进程创建,Activity生命周期的维护,本blog就是着手对ActivityManager框架作一个整体的了解       2.先看一个静态类结构图:       上图很清楚地描述了ActivityManager框架的几个主要类之间的关系,我们做应用开发接触很多的

    2022年9月6日
    3
  • python的jieba库教程_python下载jieba库

    python的jieba库教程_python下载jieba库jieba是python的一个中文分词库,下面介绍它的使用方法。安装方式1:pipinstalljieba方式2:先下载http://pypi.python.org/pypi/jieba/然后解压,运行pythonsetup.pyinstall功能下面介绍下jieba的主要功能,具体信息可参考github文档:https://github.com/fxsjy/jieba分词jieba常用的三种模式:精确模式,试图将句子最精确地切开,适合文本分析; 全模式

    2022年9月15日
    0

发表回复

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

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