org.cubeengine.converter.node
Class Path

java.lang.Object
  extended by org.cubeengine.converter.node.Path

public class Path
extends Object

Represents a path to a node.


Constructor Summary
Path(char separator, String path)
          Constructs a path using given separator and path.
Path(List<String> parts)
          Constructs a path using give parts
Path(String... parts)
          Constructs a path using given parts.
Path(String separator, String path)
          Constructs a path using given separator and path.
 
Method Summary
 String asString(char separator)
          Gets a String representation of this Path with given separator
 String asString(String separator)
          Gets a String representation of this Path with given separator
 String getFirst()
          Returns the first part of this path
 String getLast()
          Returns the last part of this path
 List<String> getParts()
          Gets the parts making up this part
 int getSize()
          Gets the amount of parts of this path
 boolean isBasePath()
          Returns whether this path has only one part
 Path subPath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Path

public Path(String... parts)
Constructs a path using given parts.

Parameters:
parts - the parts

Path

public Path(String separator,
            String path)
Constructs a path using given separator and path.

Parameters:
separator - the separator
path - the path

Path

public Path(char separator,
            String path)
Constructs a path using given separator and path.

Parameters:
separator - the separator
path - the path

Path

public Path(List<String> parts)
Constructs a path using give parts

Parameters:
parts - the parts
Method Detail

getParts

public List<String> getParts()
Gets the parts making up this part

Returns:
the parts

getSize

public int getSize()
Gets the amount of parts of this path

Returns:
the amount of parts

asString

public String asString(String separator)
Gets a String representation of this Path with given separator

Parameters:
separator - the separator
Returns:
the String representation

asString

public String asString(char separator)
Gets a String representation of this Path with given separator

Parameters:
separator - the separator
Returns:
the String representation

getLast

public String getLast()
Returns the last part of this path

Returns:
the last part

getFirst

public String getFirst()
Returns the first part of this path

Returns:
the first part

isBasePath

public boolean isBasePath()
Returns whether this path has only one part

Returns:
true when this path has one part

subPath

public Path subPath()


Copyright © 2013–2017. All rights reserved.