public final class PackagePartName extends java.lang.Object implements java.lang.Comparable<PackagePartName>
Modifier and Type | Method and Description |
---|---|
static int |
compare(PackagePartName obj1, PackagePartName obj2)
A natural sort order for package part names, consistent with the requirements of
java.util.Comparator , but simply implemented as a static method.
(包部分名称的自然排序顺序,符合 java.util.Comparator 的要求,但只是作为静态方法实现。)
|
static int |
compare(java.lang.String str1, java.lang.String str2)
A natural sort order for strings, consistent with the requirements of
java.util.Comparator , but simply implemented as a static method.
(字符串的自然排序顺序,符合 java.util.Comparator 的要求,但简单地实现为静态方法。)
|
int |
compareTo(PackagePartName other)
Compare two part names following the rule M1.12 : Part name equivalence is determined by comparing part names as case-insensitive ASCII strings.
(遵循规则 M1.12 比较两个部件名称:部件名称等效性是通过将部件名称作为不区分大小写的 ASCII 字符串进行比较来确定的。)
|
boolean |
equals(java.lang.Object other)
Part name equivalence is determined by comparing part names as case-insensitive ASCII strings.
(部件名称等效性是通过将部件名称作为不区分大小写的 ASCII 字符串进行比较来确定的。)
|
java.lang.String |
getExtension()
Retrieves the extension of the part name if any.
(检索部件名称的扩展名(如果有)。)
|
java.lang.String |
getName()
Get this part name.
(获取此部件名称。)
|
java.net.URI |
getURI()
Part name property getter.
(部件名称属性获取器。)
|
int |
hashCode() |
boolean |
isRelationshipPartURI()
Know if this part name is a relationship part name.
(知道此部件名称是否是关系部件名称。)
|
java.lang.String |
toString() |
public boolean isRelationshipPartURI()
true
if this part name respect the relationship part naming convention else
false
.
(如果此部分名称尊重关系部分命名约定,则为 true,否则为 false。)
public int compareTo(PackagePartName other)
compareTo
in interface
java.lang.Comparable<PackagePartName>
(接口 java.lang.Comparable 中的 compareTo
public java.lang.String getExtension()
public java.lang.String getName()
public boolean equals(java.lang.Object other)
equals
in class
java.lang.Object
public int hashCode()
hashCode
in class
java.lang.Object
public java.lang.String toString()
toString
in class
java.lang.Object
public java.net.URI getURI()
public static int compare(PackagePartName obj1, PackagePartName obj2)
java.util.Comparator
, but simply implemented as a static method.
For example, this sorts "file10.png" after "file2.png" (comparing the numerical portion), but sorts "File10.png" before "file2.png" (lexigraphical sort)
When comparing part names, the rule M1.12 is followed: Part name equivalence is determined by comparing part names as case-insensitive ASCII strings. Packages shall not contain equivalent part names and package implementers shall neither create nor recognize packages with equivalent part names. [M1.12]
(包部分名称的自然排序顺序,符合 java.util.Comparator 的要求,但只是作为静态方法实现。例如,这会将“file10.png”排在“file2.png”之后(比较数字部分),但将“File10.png”排在“file2.png”之前(字典排序) 比较零件名称时,规则 M1.12遵循:部件名称等效性是通过将部件名称作为不区分大小写的 ASCII 字符串进行比较来确定的。包不应包含等效的部分名称,并且包实现者不应创建或识别具有等效部分名称的包。 [M1.12])obj1
- first
PackagePartName
to compare
(obj1 - 要比较的第一个 PackagePartName)
obj2
- second
PackagePartName
to compare
(obj2 - 要比较的第二个 PackagePartName)
public static int compare(java.lang.String str1, java.lang.String str2)
java.util.Comparator
, but simply implemented as a static method.
For example, this sorts "file10.png" after "file2.png" (comparing the numerical portion), but sorts "File10.png" before "file2.png" (lexigraphical sort)
(字符串的自然排序顺序,符合 java.util.Comparator 的要求,但简单地实现为静态方法。例如,这会将“file10.png”排在“file2.png”之后(比较数字部分),但将“File10.png”排在“file2.png”之前(字典排序))str1
- first string to compare
(str1 - 要比较的第一个字符串)
str2
- second string to compare
(str2 - 要比较的第二个字符串)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.