org.crsh.vfs
Class Path

java.lang.Object
  extended by org.crsh.vfs.Path
All Implemented Interfaces:
Iterable<String>
Direct Known Subclasses:
Path.Absolute, Path.Relative

public abstract class Path
extends Object
implements Iterable<String>


Nested Class Summary
static class Path.Absolute
           
static class Path.Relative
           
 
Field Summary
protected  boolean dir
          .
static Path.Relative EMPTY
          .
private static String[] EMPTY_STRING
          .
protected  String[] names
          .
static Path.Absolute ROOT
          .
private  String value
          .
 
Constructor Summary
private Path(boolean dir, String[] names)
           
 
Method Summary
abstract  Path.Absolute absolute()
           
 Path append(String name, boolean dir)
           
protected abstract  Path create(boolean dir, String[] names)
           
 boolean equals(Object o)
           
static Path get(File file)
           
static Path get(String s)
           
 String getName()
           
 int getSize()
           
 String getValue()
          Returns the canonical path value.
 int hashCode()
           
abstract  boolean isAbsolute()
           
 boolean isChildOf(Path parent)
           
 boolean isDir()
           
 Iterator<String> iterator()
           
 String nameAt(int index)
           
private static String[] parseNames(String s, int prev, int end, int count)
           
private static String[] path(File file, int size)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_STRING

private static final String[] EMPTY_STRING
.


ROOT

public static final Path.Absolute ROOT
.


EMPTY

public static final Path.Relative EMPTY
.


dir

protected final boolean dir
.


names

protected final String[] names
.


value

private String value
.

Constructor Detail

Path

private Path(boolean dir,
             String[] names)
Method Detail

path

private static String[] path(File file,
                             int size)

get

public static Path get(File file)

get

public static Path get(String s)

parseNames

private static String[] parseNames(String s,
                                   int prev,
                                   int end,
                                   int count)

iterator

public Iterator<String> iterator()
Specified by:
iterator in interface Iterable<String>

append

public Path append(String name,
                   boolean dir)

create

protected abstract Path create(boolean dir,
                               String[] names)

isAbsolute

public abstract boolean isAbsolute()

absolute

public abstract Path.Absolute absolute()

getSize

public int getSize()

isDir

public boolean isDir()

getName

public String getName()

nameAt

public String nameAt(int index)
              throws IndexOutOfBoundsException
Throws:
IndexOutOfBoundsException

isChildOf

public boolean isChildOf(Path parent)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getValue

public String getValue()
Returns the canonical path value.

Returns:
the value

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 eXo Platform SAS. All Rights Reserved.