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
          .
protected  String[] names
          .
static Path.Absolute ROOT
          .
 
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)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROOT

public static final Path.Absolute ROOT
.


EMPTY

public static final Path.Relative EMPTY
.


dir

protected final boolean dir
.


names

protected final String[] names
.

Method Detail

get

public static Path get(File file)

get

public static Path get(String s)

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.