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 Stringstatic final Stringstatic final Stringstatic final StringPathAn emptyStringPath, i.e.Fields inherited from interface com.inductiveautomation.ignition.common.Path
SERIALIZATION_WHITELIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a newStringPath.CaseSensitiveStringPaththat has the same parts as thisStringPath.intcompareTo(StringPath that) booleanstatic StringPathextend(StringPath parent, StringPath other) static StringPathextend(StringPath parent, String... subparts) static StringPathCreates a string path from a tag path.static StringPathCreates 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.intReturns the number of elements in the path, which can be retrieved through getPathComponent().inthashCode()booleanisAncestorOf(Path child) Returns whether the provided path is a child path of this one.booleanisParentOf(Path child) static booleanisRelative(StringPath path) booleanisRoot()static StringPathmakeRelative(StringPath toRelative, StringPath root) static StringPathstatic StringPathstatic StringPathremoveRelative(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:PathReturns the number of elements in the path, which can be retrieved through getPathComponent().- Specified by:
getPathLengthin interfacePath
-
subPath
Returns the path, minus the first element. -
subPath
-
getParentPath
Returns the parent, or null if at the root level.- Specified by:
getParentPathin interfacePath
-
getChildPath
-
getPathComponent
Description copied from interface:PathReturns the path element at the specified location.- Specified by:
getPathComponentin interfacePath
-
getLastPathComponent
Description copied from interface:PathConvenience function to return the last path element.- Specified by:
getLastPathComponentin interfacePath
-
isRoot
public boolean isRoot()- Returns:
- true if the path length is zero
-
isParentOf
-
isAncestorOf
Description copied from interface:PathReturns whether the provided path is a child path of this one.- Specified by:
isAncestorOfin interfacePath
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<StringPath>
-
caseSensitive
Create a newStringPath.CaseSensitiveStringPaththat has the same parts as thisStringPath.- Returns:
- a
StringPath.CaseSensitiveStringPath.
-