|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.content.PathString
public class PathString
A PathString is a cpu and memory efficient implementation of path names. Previously, a complete path was just a String. However, there is a lot to be gained by a dedicated class for this type of String usage. A PathString is IMMUTABLE!
| Field Summary | |
|---|---|
protected String[] |
_chunks
The path chunks |
protected int |
_hashCode
|
| Constructor Summary | |
|---|---|
PathString(PathString pre,
Object post)
Construct a new PathString, concatenating a PathStrings and an Object. |
|
PathString(PathString pre,
PathString post)
Construct a new PathString, concatenating two existing PathStrings. |
|
PathString(String path)
Construct a new PathString. |
|
PathString(String[] chunks)
Construct PathString by taking an existing chunks array. |
|
| Method Summary | |
|---|---|
static String |
bestMatch(Vector names,
String aName,
int matchPercentage)
Find the best matching String from a Vector of Strings. |
static int |
bestMatchIndex(Vector names,
String aName,
int matchPercentage)
|
static int |
chunkCompare(String one,
String two)
Due to the special interpretation of numbers we can not use the original String compare. |
int |
compareTo(Object other)
|
int |
depth()
|
boolean |
equals(Object other)
|
String |
getChunk(int index)
|
String[] |
getChunks()
Get a clone of the Chunk array. |
String |
getLastName()
|
PathString |
getParent()
|
PathString |
getParent(int g)
|
int |
hashCode()
|
boolean |
isChildOf(PathString other)
|
PathString |
remainder(PathString prefix)
|
boolean |
startsWith(PathString other)
|
PathString |
subPath(int beginIndex)
|
PathString |
subPath(int beginIndex,
int endIndex)
Note that subPath will automatically adapt the parameters to valid ones. |
String |
toSafeString()
Avoid ' in section names when used in javascript arguments. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String[] _chunks
protected int _hashCode
| Constructor Detail |
|---|
public PathString(String path)
public PathString(PathString pre,
PathString post)
public PathString(PathString pre,
Object post)
public PathString(String[] chunks)
| Method Detail |
|---|
public int depth()
public String toString()
toString in class Objectpublic String toSafeString()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectpublic int compareTo(Object other)
compareTo in interface Comparable
public static int chunkCompare(String one,
String two)
public PathString getParent()
public PathString getParent(int g)
g - the number of generations up
public boolean startsWith(PathString other)
public boolean isChildOf(PathString other)
public PathString remainder(PathString prefix)
public String getLastName()
public String getChunk(int index)
public String[] getChunks()
public static String bestMatch(Vector names,
String aName,
int matchPercentage)
names - the names to match againstaName - the name to matchmatchPercentage - between 0 and 100 (exact match only)
public static int bestMatchIndex(Vector names,
String aName,
int matchPercentage)
public PathString subPath(int beginIndex)
String.substring(int)
public PathString subPath(int beginIndex,
int endIndex)
String.substring(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||