Class StringPath
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.StringPath
 
- 
- All Implemented Interfaces:
- Path,- java.io.Serializable,- java.lang.Comparable<StringPath>
 - Direct Known Subclasses:
- StringPath.CaseSensitiveStringPath
 
 public class StringPath extends java.lang.Object implements Path, java.lang.Comparable<StringPath> A simple path based on string based path components. Comparisons are made in a case-insensitive manner.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classStringPath.CaseSensitiveStringPathA case-sensitive subclass ofStringPath.
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringPATH_RELATIVEstatic java.lang.StringPATH_RELATIVE_UPstatic java.lang.StringPATH_SEPARATORstatic StringPathROOTAn emptyStringPath, i.e.- 
Fields inherited from interface com.inductiveautomation.ignition.common.PathSERIALIZATION_WHITELIST
 
- 
 - 
Constructor SummaryConstructors Constructor Description StringPath(java.lang.String[] parts)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringPath.CaseSensitiveStringPathcaseSensitive()Create a newStringPath.CaseSensitiveStringPaththat has the same parts as thisStringPath.intcompareTo(StringPath that)booleanequals(java.lang.Object obj)static StringPathextend(StringPath parent, StringPath other)static StringPathextend(StringPath parent, java.lang.String... subparts)static StringPathfrom(TagPath path)Creates a string path from a tag path.static StringPathfrom(TagPath path)Creates a string path from a tag path.StringPathgetChildPath(java.lang.String... pathParts)java.lang.StringgetLastPathComponent()Convenience function to return the last path element.StringPathgetParentPath()Returns the parent, or null if at the root level.java.lang.String[]getParts()java.lang.StringgetPathComponent(int i)Returns the path element at the specified location.intgetPathLength()Returns 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 StringPathof(java.lang.String... parts)static StringPathparse(java.lang.String value)static StringPathremoveRelative(StringPath relative, StringPath root)StringPathsubPath()Returns the path, minus the first element.StringPathsubPath(int start, int len)java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
ROOTpublic static final StringPath ROOT An emptyStringPath, i.e. a path with zero components and zero length.
 - 
PATH_SEPARATORpublic static final java.lang.String PATH_SEPARATOR - See Also:
- Constant Field Values
 
 - 
PATH_RELATIVEpublic static final java.lang.String PATH_RELATIVE - See Also:
- Constant Field Values
 
 - 
PATH_RELATIVE_UPpublic static final java.lang.String PATH_RELATIVE_UP - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getPartspublic java.lang.String[] getParts() 
 - 
ofpublic static StringPath of(java.lang.String... parts) 
 - 
frompublic static StringPath from(TagPath path) Creates a string path from a tag path. String paths do not support Source or Property, so those elements will be ignored.
 - 
frompublic static StringPath from(TagPath path) Creates a string path from a tag path. String paths do not support Source or Property, so those elements will be ignored.
 - 
parsepublic static StringPath parse(java.lang.String value) - 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.
 
 - 
extendpublic static StringPath extend(StringPath parent, java.lang.String... subparts) 
 - 
extendpublic static StringPath extend(StringPath parent, StringPath other) 
 - 
makeRelativepublic static StringPath makeRelative(StringPath toRelative, StringPath root) 
 - 
isRelativepublic static boolean isRelative(StringPath path) 
 - 
removeRelativepublic static StringPath removeRelative(StringPath relative, StringPath root) 
 - 
getPathLengthpublic int getPathLength() Description copied from interface:PathReturns the number of elements in the path, which can be retrieved through getPathComponent().- Specified by:
- getPathLengthin interface- Path
 
 - 
subPathpublic StringPath subPath() Returns the path, minus the first element.
 - 
subPathpublic StringPath subPath(int start, int len) 
 - 
getParentPathpublic StringPath getParentPath() Returns the parent, or null if at the root level.- Specified by:
- getParentPathin interface- Path
 
 - 
getChildPathpublic StringPath getChildPath(java.lang.String... pathParts) 
 - 
getPathComponentpublic java.lang.String getPathComponent(int i) Description copied from interface:PathReturns the path element at the specified location.- Specified by:
- getPathComponentin interface- Path
 
 - 
getLastPathComponentpublic java.lang.String getLastPathComponent() Description copied from interface:PathConvenience function to return the last path element.- Specified by:
- getLastPathComponentin interface- Path
 
 - 
isRootpublic boolean isRoot() - Returns:
- true if the path length is zero
 
 - 
isParentOfpublic boolean isParentOf(Path child) 
 - 
isAncestorOfpublic boolean isAncestorOf(Path child) Description copied from interface:PathReturns whether the provided path is a child path of this one.- Specified by:
- isAncestorOfin interface- Path
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
compareTopublic int compareTo(StringPath that) - Specified by:
- compareToin interface- java.lang.Comparable<StringPath>
 
 - 
caseSensitivepublic StringPath.CaseSensitiveStringPath caseSensitive() Create a newStringPath.CaseSensitiveStringPaththat has the same parts as thisStringPath.- Returns:
- a StringPath.CaseSensitiveStringPath.
 
 
- 
 
-