24 package org.lightjason.agentspeak.common;
26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
28 import javax.annotation.Nonnull;
29 import java.io.Serializable;
30 import java.util.stream.Stream;
38 public interface IPath extends Serializable, Comparable<IPath>
53 private static final long serialVersionUID = -8529008893337445887L;
64 public final IPath append( @Nonnull
final String p_path )
71 public final IPath remove(
final int p_index )
78 public final IPath remove(
final int p_start,
final int p_end )
90 public final boolean empty()
97 public final String
get(
final int p_index )
104 public final String
path(
final String p_separator )
111 public final String
path()
153 public final IPath subpath(
final int p_fromindex,
final int p_toindex )
160 public final String
suffix()
208 public final int size()
220 public final boolean startswith(
final String p_path )
227 public final Stream<String>
stream()
229 return Stream.empty();
233 public final int compareTo( @Nonnull
final IPath p_path )
235 return Integer.compare( p_path.hashCode(), this.hashCode() );
239 public final int hashCode()
245 @SuppressFBWarnings(
"EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS" )
246 public final boolean equals(
final Object p_object )
248 return ( ( p_object instanceof
IPath ) && ( this.hashCode() == p_object.hashCode() ) )
249 || ( ( p_object instanceof String ) && ( this.
path().hashCode() == p_object.hashCode() ) );
278 IPath remove(
final int p_index );
288 IPath remove(
final int p_start,
final int p_end );
312 String
get(
final int p_index );
321 String
path(
final String p_separator );
381 IPath subpath(
final int p_fromindex,
final int p_toindex );
String DEFAULTSEPERATOR
default seperator
IPath upper()
changes all elements to uppercase
boolean endswith( @Nonnull final IPath p_path)
check of a path ends with another path
IPath reverse()
reverse path
IPath subpath(final int p_fromindex)
creates a path of the start index until the end
String removesuffix()
remove the suffix from the path
String path()
returns the full path as string
IPath pushfront( @Nonnull final String p_path)
adds a path at the front
Stream< String > stream()
stream over elements
boolean startswith(final IPath p_path)
check of a path starts with another path
boolean empty()
check if the path is empty
IPath append( @Nonnull final IPath p_path)
appends a path at the current and returns a new object
IPath pushback( @Nonnull final IPath p_path)
adds a path at the end
String suffix()
returns the last part of the path
IPath lower()
changes all elements to lower-case
String separator()
returns the separator
int size()
returns the number of path elements