public final class PackagePartName extends Object implements 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. |
static int |
compare(String str1,
String str2)
A natural sort order for strings, consistent with the
requirements of
java.util.Comparator , but simply implemented
as a static method. |
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.
|
boolean |
equals(Object other)
Part name equivalence is determined by comparing part names as
case-insensitive ASCII strings.
|
String |
getExtension()
Retrieves the extension of the part name if any.
|
String |
getName()
Get this part name.
|
URI |
getURI()
Part name property getter.
|
int |
hashCode() |
boolean |
isRelationshipPartURI()
Know if this part name is a relationship part name.
|
String |
toString() |
public boolean isRelationshipPartURI()
true
if this part name respect the relationship
part naming convention else false
.public int compareTo(PackagePartName other)
compareTo
in interface Comparable<PackagePartName>
public String getExtension()
public String getName()
public boolean equals(Object other)
public 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]
obj1
- first PackagePartName
to compareobj2
- second PackagePartName
to comparepublic static int compare(String str1, 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)
str1
- first string to comparestr1
- second string to compareCopyright © 2010 - 2020 Adobe. All Rights Reserved