|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.data.PathBuilder
public class PathBuilder
A builder class for Path.
Since Paths are immutable, you have to construct them in one go and
not change them. This is a mutable path; it has methods for building a Path
from scratch, or modifying an existing Path structure.
Copyright 2006 Partner Software, Inc.
| Constructor Summary | |
|---|---|
PathBuilder()
Creates a builder initialized with an empty, relative Path. |
|
PathBuilder(Path source)
Creates a builder based upon the given Path. |
|
PathBuilder(PathBuilder nother)
Creates a builder with the same contents as the given builder. |
|
PathBuilder(java.lang.String pathString)
Creates a builder and initializes it by parsing the given path string. |
|
PathBuilder(java.lang.String[] parts,
boolean absolute)
Creates a builder initialized with the given parts and absoluteness |
|
| Method Summary | |
|---|---|
void |
invert()
Inverts the path, so that the parts are in reverse order. |
boolean |
isAbsolute()
Is this path absolute? |
java.util.Iterator<java.lang.String> |
iterator()
|
java.lang.String |
pop()
Removes and returns the last part of the path. |
void |
push(java.lang.String name)
Adds a part to the path. |
void |
pushArray(java.lang.String[] parts)
Treats the given array as a path, and pushes all parts just like pushPath(Path). |
void |
pushPath(Path nother)
Pushes all parts of the given Path onto this one. |
void |
setAbsolute(boolean tizit)
Set whether path is absolute. |
java.lang.String[] |
toArray()
Returns an array copy of the path's parts. |
Path |
toPath()
The actual goal of building a path is to create a path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathBuilder()
public PathBuilder(Path source)
source - path to start withpublic PathBuilder(PathBuilder nother)
nother - builder to copypublic PathBuilder(java.lang.String pathString)
pathString - string representation of initial path for builder
public PathBuilder(java.lang.String[] parts,
boolean absolute)
parts - parts of the pathabsolute - true if an absolute path| Method Detail |
|---|
public Path toPath()
public void push(java.lang.String name)
name - part name to add to the pathpublic java.lang.String pop()
public void pushPath(Path nother)
nother - path to push onto currently built pathpublic void pushArray(java.lang.String[] parts)
pushPath(Path).
parts - public boolean isAbsolute()
public void setAbsolute(boolean tizit)
tizit - true if path is absolutepublic java.lang.String[] toArray()
public java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>public void invert()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||