Class StringPath
java.lang.Object
com.inductiveautomation.ignition.common.StringPath
- All Implemented Interfaces:
Path
,Serializable
,Comparable<StringPath>
- Direct Known Subclasses:
StringPath.CaseSensitiveStringPath
A simple path based on string based path components. Comparisons are made in a case-insensitive manner.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final StringPath
An emptyStringPath
, i.e.Fields inherited from interface com.inductiveautomation.ignition.common.Path
SERIALIZATION_WHITELIST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a newStringPath.CaseSensitiveStringPath
that has the same parts as thisStringPath
.int
compareTo
(StringPath that) boolean
static StringPath
extend
(StringPath parent, StringPath other) static StringPath
extend
(StringPath parent, String... subparts) static StringPath
Creates a string path from a tag path.static StringPath
Creates a string path from a tag path.getChildPath
(String... pathParts) Convenience function to return the last path element.Returns the parent, or null if at the root level.String[]
getParts()
getPathComponent
(int i) Returns the path element at the specified location.int
Returns the number of elements in the path, which can be retrieved through getPathComponent().int
hashCode()
boolean
isAncestorOf
(Path child) Returns whether the provided path is a child path of this one.boolean
isParentOf
(Path child) static boolean
isRelative
(StringPath path) boolean
isRoot()
static StringPath
makeRelative
(StringPath toRelative, StringPath root) static StringPath
static StringPath
static StringPath
removeRelative
(StringPath relative, StringPath root) subPath()
Returns the path, minus the first element.subPath
(int start, int len) toString()
-
Field Details
-
ROOT
An emptyStringPath
, i.e. a path with zero components and zero length. -
PATH_SEPARATOR
- See Also:
-
PATH_RELATIVE
- See Also:
-
PATH_RELATIVE_UP
- See Also:
-
-
Constructor Details
-
StringPath
-
-
Method Details
-
getParts
-
of
-
from
Creates a string path from a tag path. String paths do not support Source or Property, so those elements will be ignored. -
from
Creates a string path from a tag path. String paths do not support Source or Property, so those elements will be ignored. -
parse
- Parameters:
value
- A path to parse, like "path/to/thing". Null will be treated like empty string: both will create a path of zero length.
-
extend
-
extend
-
makeRelative
-
isRelative
-
removeRelative
-
getPathLength
public int getPathLength()Description copied from interface:Path
Returns the number of elements in the path, which can be retrieved through getPathComponent().- Specified by:
getPathLength
in interfacePath
-
subPath
Returns the path, minus the first element. -
subPath
-
getParentPath
Returns the parent, or null if at the root level.- Specified by:
getParentPath
in interfacePath
-
getChildPath
-
getPathComponent
Description copied from interface:Path
Returns the path element at the specified location.- Specified by:
getPathComponent
in interfacePath
-
getLastPathComponent
Description copied from interface:Path
Convenience function to return the last path element.- Specified by:
getLastPathComponent
in interfacePath
-
isRoot
public boolean isRoot()- Returns:
- true if the path length is zero
-
isParentOf
-
isAncestorOf
Description copied from interface:Path
Returns whether the provided path is a child path of this one.- Specified by:
isAncestorOf
in interfacePath
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<StringPath>
-
caseSensitive
Create a newStringPath.CaseSensitiveStringPath
that has the same parts as thisStringPath
.- Returns:
- a
StringPath.CaseSensitiveStringPath
.
-