org.omnaest.utils.strings
Class CharacterPathBuilder.CharacterPath

java.lang.Object
  extended by org.omnaest.utils.strings.CharacterPathBuilder.CharacterPath
Enclosing class:
CharacterPathBuilder

public static class CharacterPathBuilder.CharacterPath
extends Object

A CharacterPathBuilder.CharacterPath represents a path of characters. A path can have multiple junctions so a CharacterPathBuilder.CharacterPath can represent a Set of multiple Strings

Author:
Omnaest

Constructor Summary
CharacterPathBuilder.CharacterPath(Character character, List<CharacterPathBuilder.CharacterPath> characterPathChildrenList, boolean leaf)
           
 
Method Summary
 List<String> buildStringList()
          Builds all String combinations of the current CharacterPathBuilder.CharacterPath and all descending CharacterPathBuilder.CharacterPath instances related to the first one.
 String determineFirstCharactersOfChildrenAsString()
          Returns a the first characters of the children of the current CharacterPathBuilder.CharacterPath as a concatenated String
 Character getCharacter()
           
 List<CharacterPathBuilder.CharacterPath> getCharacterPathChildrenList()
           
 boolean hasNoChildren()
          Returns true if the current CharacterPathBuilder.CharacterPath has no children
 boolean isLeaf()
          Returns true if the current CharacterPathBuilder.CharacterPath represents a leaf node.
 boolean isRoot()
          Returns true if the current CharacterPathBuilder.CharacterPath is the root node and returns null for the getCharacter()
 CharacterPathBuilder.CharacterPath matchingPath(String relativePath)
          Returns the CharacterPathBuilder.CharacterPath which matches the last character of the given relative path to the current CharacterPathBuilder.CharacterPath.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharacterPathBuilder.CharacterPath

public CharacterPathBuilder.CharacterPath(Character character,
                                          List<CharacterPathBuilder.CharacterPath> characterPathChildrenList,
                                          boolean leaf)
Method Detail

determineFirstCharactersOfChildrenAsString

public String determineFirstCharactersOfChildrenAsString()
Returns a the first characters of the children of the current CharacterPathBuilder.CharacterPath as a concatenated String

Returns:

getCharacter

public Character getCharacter()

getCharacterPathChildrenList

public List<CharacterPathBuilder.CharacterPath> getCharacterPathChildrenList()

matchingPath

public CharacterPathBuilder.CharacterPath matchingPath(String relativePath)
Returns the CharacterPathBuilder.CharacterPath which matches the last character of the given relative path to the current CharacterPathBuilder.CharacterPath. The beginning of the relative path has to match the currents getCharacter().

Parameters:
relativePath -
Returns:

buildStringList

public List<String> buildStringList()
Builds all String combinations of the current CharacterPathBuilder.CharacterPath and all descending CharacterPathBuilder.CharacterPath instances related to the first one.

Returns:

hasNoChildren

public boolean hasNoChildren()
Returns true if the current CharacterPathBuilder.CharacterPath has no children

Returns:

toString

public String toString()
Overrides:
toString in class Object

isLeaf

public boolean isLeaf()
Returns true if the current CharacterPathBuilder.CharacterPath represents a leaf node. This does not mean that there are no further children.

Returns:

isRoot

public boolean isRoot()
Returns true if the current CharacterPathBuilder.CharacterPath is the root node and returns null for the getCharacter()

Returns:


Copyright © 2013. All Rights Reserved.