LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.common.CPath Class Reference

class to create a path structure More...

+ Inheritance diagram for org.lightjason.agentspeak.common.CPath:
+ Collaboration diagram for org.lightjason.agentspeak.common.CPath:

Classes

class  CPathCollector
 path collector More...
 

Public Member Functions

 CPath (final IPath p_path, final String... p_varargs)
 copy-ctor with arguments More...
 
 CPath ( @Nonnull final IPath p_path)
 copy-ctor More...
 
 CPath ( @Nullable final String... p_varargs)
 ctor More...
 
 CPath ( @Nonnull final Stream< String > p_stream)
 ctor More...
 
final IPath append ( @Nonnull final IPath p_path)
 appends a path at the current and returns a new object More...
 
final IPath append ( @Nonnull final String p_path)
 appends a string at the current path and returns the new object More...
 
final int compareTo ( @Nonnull final IPath p_path)
 
final boolean empty ()
 check if the path is empty More...
 
final synchronized boolean endswith ( @Nonnull final IPath p_path)
 check of a path ends with another path More...
 
final boolean equals (final Object p_object)
 
final String get (final int p_index)
 returns an part of the path More...
 
final int hashCode ()
 
final synchronized IPath lower ()
 changes all elements to lower-case More...
 
final String path ( @Nonnull final String p_separator)
 
final String path ()
 returns the full path as string More...
 
final IPath pushback ( @Nonnull final IPath p_path)
 adds a path at the end More...
 
final IPath pushback ( @Nonnull final String p_path)
 adds a path at the end More...
 
final IPath pushfront ( @Nonnull final String p_path)
 adds a path at the front More...
 
final synchronized IPath pushfront ( @Nonnull final IPath p_path)
 adds a path to the front of the path More...
 
final IPath remove (final int p_index)
 removes an element More...
 
final IPath remove (final int p_start, final int p_end)
 removes all elements from start index until end index (exclusive) More...
 
final String removesuffix ()
 remove the suffix from the path More...
 
final IPath reverse ()
 reverse path More...
 
final String separator ()
 returns the separator More...
 
final IPath separator ( @Nonnull final String p_separator)
 sets the separator More...
 
final int size ()
 returns the number of path elements More...
 
final boolean startswith ( @Nonnull final IPath p_path)
 
final boolean startswith (final String p_path)
 check of a path starts with another path More...
 
final Stream< String > stream ()
 stream over elements More...
 
final IPath subpath (final int p_fromindex)
 creates a path of the start index until the end More...
 
final IPath subpath (final int p_fromindex, final int p_toindex)
 creates a path of the indices More...
 
final synchronized String suffix ()
 returns the last part of the path More...
 
final String toString ()
 
final synchronized IPath upper ()
 changes all elements to uppercase More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.common.IPath
String path (final String p_separator)
 returns the full path as string with an individual separator More...
 
boolean startswith (final IPath p_path)
 check of a path starts with another path More...
 

Static Public Member Functions

static Collector< String, IPath, IPathcollect ()
 returns a collector to build a path from strings More...
 
static IPath createPath ( @Nonnull final String... p_varargs)
 creates a path object from different items More...
 
static IPath createPathWithSeperator ( @Nonnull final String... p_varargs)
 creates a path object by splitting a string More...
 
static IPath from ( @Nonnull final String p_string)
 factor method to build path More...
 

Private Member Functions

 CPath ()
 private ctor for empty path More...
 
synchronized void normalize ()
 normalize the internal path More...
 

Static Private Member Functions

static Collector< String, List< String >, List< String > > collectorfactory ()
 collector factory More...
 
static List< String > listfactory ()
 list factory More...
 

Private Attributes

final List< String > m_path
 list with path parts * More...
 
String m_separator = DEFAULTSEPERATOR
 separator of the path elements * More...
 

Static Private Attributes

static final long serialVersionUID = -8502900889333744887L
 serial id More...
 

Additional Inherited Members

- Public Attributes inherited from org.lightjason.agentspeak.common.IPath
String DEFAULTSEPERATOR = "/"
 default seperator More...
 
IPath EMPTY
 empty path More...
 

Detailed Description

Definition at line 53 of file CPath.java.

Constructor & Destructor Documentation

◆ CPath() [1/5]

org.lightjason.agentspeak.common.CPath.CPath ( final IPath  p_path,
final String...  p_varargs 
)
Parameters
p_pathpath object
p_varargsstring arguments

Definition at line 74 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.normalize().

+ Here is the call graph for this function:

◆ CPath() [2/5]

org.lightjason.agentspeak.common.CPath.CPath ( @Nonnull final IPath  p_path)
Parameters
p_pathpath object

Definition at line 86 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.collectorfactory().

+ Here is the call graph for this function:

◆ CPath() [3/5]

org.lightjason.agentspeak.common.CPath.CPath ( @Nullable final String...  p_varargs)
Parameters
p_varargspath component

Definition at line 97 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.collect(), org.lightjason.agentspeak.common.CPath.collectorfactory(), org.lightjason.agentspeak.common.CCommon.languagestring(), org.lightjason.agentspeak.common.CPath.listfactory(), and org.lightjason.agentspeak.common.CPath.normalize().

+ Here is the call graph for this function:

◆ CPath() [4/5]

org.lightjason.agentspeak.common.CPath.CPath ( @Nonnull final Stream< String >  p_stream)
Parameters
p_streamstring collection

Definition at line 118 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.collectorfactory(), and org.lightjason.agentspeak.common.CPath.normalize().

+ Here is the call graph for this function:

◆ CPath() [5/5]

Member Function Documentation

◆ append() [1/2]

final IPath org.lightjason.agentspeak.common.CPath.append ( @Nonnull final IPath  p_path)
Parameters
p_pathpath
Returns
new path

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 173 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the call graph for this function:

◆ append() [2/2]

final IPath org.lightjason.agentspeak.common.CPath.append ( @Nonnull final String  p_path)
Parameters
p_pathstring with path
Returns
new path

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 180 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the call graph for this function:

◆ collect()

static Collector<String, IPath, IPath> org.lightjason.agentspeak.common.CPath.collect ( )
static
Returns
collector

Definition at line 506 of file CPath.java.

Referenced by org.lightjason.agentspeak.common.TestCPath.collector(), org.lightjason.agentspeak.common.CPath.CPath(), org.lightjason.agentspeak.beliefbase.view.CViewMap.path(), org.lightjason.agentspeak.beliefbase.view.CView.path(), and org.lightjason.agentspeak.common.CPath.pushfront().

+ Here is the caller graph for this function:

◆ collectorfactory()

static Collector<String, List<String>, List<String> > org.lightjason.agentspeak.common.CPath.collectorfactory ( )
staticprivate
Returns
collector

Definition at line 450 of file CPath.java.

Referenced by org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the caller graph for this function:

◆ compareTo()

final int org.lightjason.agentspeak.common.CPath.compareTo ( @Nonnull final IPath  p_path)

Definition at line 410 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.hashCode().

+ Here is the call graph for this function:

◆ createPath()

static IPath org.lightjason.agentspeak.common.CPath.createPath ( @Nonnull final String...  p_varargs)
static
Parameters
p_varargslist of strings
Returns
path object

Definition at line 139 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the call graph for this function:

◆ createPathWithSeperator()

static IPath org.lightjason.agentspeak.common.CPath.createPathWithSeperator ( @Nonnull final String...  p_varargs)
static
Parameters
p_varargslist of string (first element is the seperator)
Returns
path object

Definition at line 151 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath().

Referenced by org.lightjason.agentspeak.common.CPath.from().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ empty()

final boolean org.lightjason.agentspeak.common.CPath.empty ( )
Returns
empty flag

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 330 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.m_path.

Referenced by org.lightjason.agentspeak.common.CPath.removesuffix().

+ Here is the caller graph for this function:

◆ endswith()

final synchronized boolean org.lightjason.agentspeak.common.CPath.endswith ( @Nonnull final IPath  p_path)
Parameters
p_pathpath
Returns
boolean

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 203 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.equals(), and org.lightjason.agentspeak.common.CPath.size().

+ Here is the call graph for this function:

◆ equals()

final boolean org.lightjason.agentspeak.common.CPath.equals ( final Object  p_object)

Definition at line 313 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.hashCode(), and org.lightjason.agentspeak.common.CPath.path().

Referenced by org.lightjason.agentspeak.common.CPath.endswith(), org.lightjason.agentspeak.common.CPath.normalize(), and org.lightjason.agentspeak.common.CPath.startswith().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ from()

static IPath org.lightjason.agentspeak.common.CPath.from ( @Nonnull final String  p_string)
static
Parameters
p_stringinput string
Returns
path

Definition at line 166 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.createPathWithSeperator(), org.lightjason.agentspeak.common.IPath.DEFAULTSEPERATOR, and org.lightjason.agentspeak.common.IPath.EMPTY.

Referenced by org.lightjason.agentspeak.action.binding.CMethodAction.CMethodAction(), org.lightjason.agentspeak.common.TestCPath.collision(), org.lightjason.agentspeak.common.TestCPath.comparing(), org.lightjason.agentspeak.language.TestCTermVariablesConstant.constantcopy(), org.lightjason.agentspeak.beliefbase.TestCViewMap.containsliteral(), org.lightjason.agentspeak.beliefbase.TestCViewMap.containsview(), org.lightjason.agentspeak.language.CRawTerm< T >.CRawTerm(), org.lightjason.agentspeak.language.variable.CVariable< T >.CVariable(), org.lightjason.agentspeak.language.variable.CRelocateMutexVariable< T >.deepcopysuffix(), org.lightjason.agentspeak.language.variable.CRelocateVariable< T >.deepcopysuffix(), org.lightjason.agentspeak.language.CLiteral.deepcopysuffix(), org.lightjason.agentspeak.action.builtin.agent.CClearBeliefbase.execute(), org.lightjason.agentspeak.action.builtin.agent.CBeliefList.execute(), org.lightjason.agentspeak.language.CLiteral.from(), org.lightjason.agentspeak.language.TestCTermVariablesConstant.literal(), org.lightjason.agentspeak.agent.TestCUnifier.literalvaluesequentialtraversing(), org.lightjason.agentspeak.agent.TestCUnifier.literalvaluetraversing(), org.lightjason.agentspeak.agent.TestCAgent.CEmptyPrint.name(), org.lightjason.agentspeak.beliefbase.TestCViewMap.CEmptyPrint.name(), org.lightjason.agentspeak.agent.TestCAgent.CTestResult.name(), org.lightjason.agentspeak.beliefbase.TestCViewMap.CTestResult.name(), org.lightjason.agentspeak.agent.TestCAgentExecution.CStop.name(), org.lightjason.agentspeak.agent.TestCAgentExecution.CLog.name(), org.lightjason.agentspeak.agent.TestCHanoiTowers.CEmptyPrint.name(), org.lightjason.agentspeak.agent.TestCHanoiTowers.CStop.name(), org.lightjason.agentspeak.agent.TestCHanoiTowers.CTowerSize.name(), org.lightjason.agentspeak.agent.TestCHanoiTowers.CTowerPush.name(), org.lightjason.agentspeak.agent.TestCHanoiTowers.CTowerPop.name(), org.lightjason.agentspeak.language.CLiteral.shallowcopysuffix(), org.lightjason.agentspeak.beliefbase.TestCView.testManual(), org.lightjason.agentspeak.language.TestCTermVariablesConstant.variablecopy(), org.lightjason.agentspeak.language.TestCTermVariablesConstant.variablefunctor(), org.lightjason.agentspeak.grammar.CASTVisitorType.visitLiteral(), org.lightjason.agentspeak.grammar.CASTVisitorPlanBundle.visitLiteral(), org.lightjason.agentspeak.grammar.CASTVisitorAgent.visitLiteral(), org.lightjason.agentspeak.grammar.CASTVisitorPlanBundle.visitTest_action(), and org.lightjason.agentspeak.grammar.CASTVisitorAgent.visitTest_action().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

final String org.lightjason.agentspeak.common.CPath.get ( final int  p_index)
Parameters
p_indexindex position (negativ index is element from the end)
Returns
element

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 219 of file CPath.java.

◆ hashCode()

final int org.lightjason.agentspeak.common.CPath.hashCode ( )

Definition at line 304 of file CPath.java.

References org.lightjason.agentspeak.language.CCommon.getTermHashing().

Referenced by org.lightjason.agentspeak.common.CPath.compareTo(), and org.lightjason.agentspeak.common.CPath.equals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listfactory()

static List<String> org.lightjason.agentspeak.common.CPath.listfactory ( )
staticprivate
Returns
list

Definition at line 496 of file CPath.java.

Referenced by org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the caller graph for this function:

◆ lower()

final synchronized IPath org.lightjason.agentspeak.common.CPath.lower ( )
Returns
object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 258 of file CPath.java.

◆ normalize()

synchronized void org.lightjason.agentspeak.common.CPath.normalize ( )
private

Definition at line 418 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.equals(), and org.lightjason.agentspeak.common.CPath.m_path.

Referenced by org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ path() [1/2]

final String org.lightjason.agentspeak.common.CPath.path ( @Nonnull final String  p_separator)

Definition at line 226 of file CPath.java.

◆ path() [2/2]

final String org.lightjason.agentspeak.common.CPath.path ( )
Returns
string path

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 233 of file CPath.java.

Referenced by org.lightjason.agentspeak.common.CPath.equals(), and org.lightjason.agentspeak.common.CPath.toString().

+ Here is the caller graph for this function:

◆ pushback() [1/2]

final IPath org.lightjason.agentspeak.common.CPath.pushback ( @Nonnull final IPath  p_path)
Parameters
p_pathpath
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 337 of file CPath.java.

References org.lightjason.agentspeak.common.IPath.stream().

Referenced by org.lightjason.agentspeak.common.CPath.pushback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pushback() [2/2]

final IPath org.lightjason.agentspeak.common.CPath.pushback ( @Nonnull final String  p_path)
Parameters
p_pathstring path
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 345 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath(), and org.lightjason.agentspeak.common.CPath.pushback().

+ Here is the call graph for this function:

◆ pushfront() [1/2]

final IPath org.lightjason.agentspeak.common.CPath.pushfront ( @Nonnull final String  p_path)
Parameters
p_pathstring path
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 353 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath().

+ Here is the call graph for this function:

◆ pushfront() [2/2]

final synchronized IPath org.lightjason.agentspeak.common.CPath.pushfront ( @Nonnull final IPath  p_path)
Parameters
p_pathpath
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 361 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.collect(), and org.lightjason.agentspeak.common.CPath.m_path.

+ Here is the call graph for this function:

◆ remove() [1/2]

final IPath org.lightjason.agentspeak.common.CPath.remove ( final int  p_index)
Parameters
p_indexindex position
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 187 of file CPath.java.

References org.lightjason.agentspeak.common.IPath.remove().

+ Here is the call graph for this function:

◆ remove() [2/2]

final IPath org.lightjason.agentspeak.common.CPath.remove ( final int  p_start,
final int  p_end 
)
Parameters
p_startstart index
p_endend index (exclusive)
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 196 of file CPath.java.

◆ removesuffix()

final String org.lightjason.agentspeak.common.CPath.removesuffix ( )
Returns
last item of the path

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 371 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.empty(), org.lightjason.agentspeak.common.CPath.m_path, and org.lightjason.agentspeak.common.CPath.suffix().

+ Here is the call graph for this function:

◆ reverse()

final IPath org.lightjason.agentspeak.common.CPath.reverse ( )
Returns
return the changed object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 384 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.m_path, and org.lightjason.agentspeak.common.IPath.reverse().

+ Here is the call graph for this function:

◆ separator() [1/2]

final String org.lightjason.agentspeak.common.CPath.separator ( )
Returns
separator

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 240 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.m_separator.

Referenced by org.lightjason.agentspeak.common.CPath.subpath().

+ Here is the caller graph for this function:

◆ separator() [2/2]

final IPath org.lightjason.agentspeak.common.CPath.separator ( @Nonnull final String  p_separator)
Parameters
p_separatorseparator
Returns
path object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 247 of file CPath.java.

References org.lightjason.agentspeak.common.CCommon.languagestring().

+ Here is the call graph for this function:

◆ size()

final int org.lightjason.agentspeak.common.CPath.size ( )
Returns
size

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 391 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.m_path.

Referenced by org.lightjason.agentspeak.common.CPath.endswith(), org.lightjason.agentspeak.common.CPath.startswith(), and org.lightjason.agentspeak.common.CPath.subpath().

+ Here is the caller graph for this function:

◆ startswith() [1/2]

final boolean org.lightjason.agentspeak.common.CPath.startswith ( @Nonnull final IPath  p_path)

Definition at line 210 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.equals(), and org.lightjason.agentspeak.common.CPath.size().

Referenced by org.lightjason.agentspeak.common.CPath.startswith().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startswith() [2/2]

final boolean org.lightjason.agentspeak.common.CPath.startswith ( final String  p_path)
Parameters
p_pathpath
Returns
boolean

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 397 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath(), and org.lightjason.agentspeak.common.CPath.startswith().

+ Here is the call graph for this function:

◆ stream()

final Stream<String> org.lightjason.agentspeak.common.CPath.stream ( )
Returns
sequential stream

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 404 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.m_path.

◆ subpath() [1/2]

final IPath org.lightjason.agentspeak.common.CPath.subpath ( final int  p_fromindex)
Parameters
p_fromindexstart index
Returns
path

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 274 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.size().

+ Here is the call graph for this function:

◆ subpath() [2/2]

final IPath org.lightjason.agentspeak.common.CPath.subpath ( final int  p_fromindex,
final int  p_toindex 
)
Parameters
p_fromindexstart index
p_toindexend index (exclusive) / negative values from the end
Returns
path

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 281 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.CPath(), org.lightjason.agentspeak.common.CPath.separator(), and org.lightjason.agentspeak.common.CPath.size().

+ Here is the call graph for this function:

◆ suffix()

final synchronized String org.lightjason.agentspeak.common.CPath.suffix ( )
Returns
string

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 296 of file CPath.java.

Referenced by org.lightjason.agentspeak.common.CPath.removesuffix().

+ Here is the caller graph for this function:

◆ toString()

final String org.lightjason.agentspeak.common.CPath.toString ( )

Definition at line 320 of file CPath.java.

References org.lightjason.agentspeak.common.CPath.path().

+ Here is the call graph for this function:

◆ upper()

final synchronized IPath org.lightjason.agentspeak.common.CPath.upper ( )
Returns
object

Implements org.lightjason.agentspeak.common.IPath.

Definition at line 266 of file CPath.java.

Member Data Documentation

◆ m_path

◆ m_separator

String org.lightjason.agentspeak.common.CPath.m_separator = DEFAULTSEPERATOR
private

Definition at line 66 of file CPath.java.

Referenced by org.lightjason.agentspeak.common.CPath.separator().

◆ serialVersionUID

final long org.lightjason.agentspeak.common.CPath.serialVersionUID = -8502900889333744887L
staticprivate

Definition at line 58 of file CPath.java.