Class Name
java.lang.Object
com.google.common.jimfs.Name
Immutable representation of a file name. Used both for the name components of paths and as the
keys for directory entries.
A name has both a display string (used in the toString() form of a Path as
well as for Path equality and sort ordering) and a canonical string, which is used for
determining equality of the name during file lookup.
Note: all factory methods return a constant name instance when given the original string "." or "..", ensuring that those names can be accessed statically elsewhere in the code while still being equal to any names created for those values, regardless of normalization settings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate static final Comparator<Name> private final Stringprivate static final Comparator<Name> (package private) static final NameThe empty name.static final NameThe name to use for a link from a directory to its parent directory.static final NameThe name to use for a link from a directory to itself. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Comparator<Name> Returns a comparator that orders names by their canonical representation.static NameCreates a name with the given display representation and the given canonical representation.(package private) static Comparator<Name> Returns a comparator that orders names by their display representation.booleaninthashCode()(package private) static NameCreates a new name with no normalization done on the given string.toString()
-
Field Details
-
EMPTY
The empty name. -
SELF
The name to use for a link from a directory to itself. -
PARENT
The name to use for a link from a directory to its parent directory. -
display
-
canonical
-
DISPLAY_COMPARATOR
-
CANONICAL_COMPARATOR
-
-
Constructor Details
-
Name
-
-
Method Details
-
simple
-
create
-
equals
-
hashCode
-
toString
-
displayComparator
Returns a comparator that orders names by their display representation. -
canonicalComparator
Returns a comparator that orders names by their canonical representation.
-