|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.util.JStringBuilder
org.jnetpcap.util.ExpandableString
public class ExpandableString
A special string that allows easy expandibility within it. The ExpandableString is made up of 2 parts. A template string and a work buffer. Whenever a reset() call is made, the buffer is replaced with the contents of the template. The various replace calls, change the buffer by replacing certain parts, recursively. Subclasses perform specific expand operations, that are suited for their needs. Substitutions between single quotes are omitted and returned untouched. Everything else that is not single quoted, can be expanded. Escape character, the back-slash, is treated with a lot of respect.
For example ConfigString subclass replaces variables and properties (marked with $ and @ signs respectively) with contents from various maps and properties.
| Field Summary | |
|---|---|
protected int |
count
The count. |
protected int |
end
The end. |
protected int |
start
The start. |
| Constructor Summary | |
|---|---|
ExpandableString(java.lang.String template)
Instantiates a new expandable string. |
|
| Method Summary | |
|---|---|
java.lang.String |
getTemplate()
Gets the template. |
boolean |
remove(java.lang.String seq)
Removes the. |
boolean |
replaceSequence(java.lang.String open,
java.lang.String close,
java.lang.String with)
Replace sequence. |
ExpandableString |
reset()
Reset. |
protected boolean |
restoreQuotes()
Restore quotes. |
protected boolean |
saveQuotes()
Save quotes. |
protected boolean |
scanNext(java.lang.String open,
java.lang.String close)
Scan next. |
protected boolean |
scanNext(java.lang.String open,
java.lang.String close,
int offset)
Scan next. |
void |
setTemplate(java.lang.String template)
Sets the template. |
java.lang.String |
template()
Template. |
java.lang.String |
toString()
To string. |
| Methods inherited from class org.jnetpcap.util.JStringBuilder |
|---|
append, append, append, append, append, append, append, append, append, append, append, append, append, appendCodePoint, capacity, charAt, codePointAt, codePointBefore, codePointCount, delete, deleteCharAt, ensureCapacity, equals, getChars, hashCode, indexOf, indexOf, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, lastIndexOf, lastIndexOf, length, offsetByCodePoints, replace, reverse, setCharAt, setLength, subSequence, substring, substring, trimToSize |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int count
protected int end
protected int start
| Constructor Detail |
|---|
public ExpandableString(java.lang.String template)
template - the template| Method Detail |
|---|
public final java.lang.String getTemplate()
public boolean remove(java.lang.String seq)
seq - the seq
public boolean replaceSequence(java.lang.String open,
java.lang.String close,
java.lang.String with)
open - the openclose - the closewith - the with
public ExpandableString reset()
protected boolean restoreQuotes()
protected boolean saveQuotes()
protected boolean scanNext(java.lang.String open,
java.lang.String close)
open - the openclose - the close
protected boolean scanNext(java.lang.String open,
java.lang.String close,
int offset)
open - the openclose - the closeoffset - the offset
public final void setTemplate(java.lang.String template)
template - the template to setpublic java.lang.String template()
public java.lang.String toString()
toString in class JStringBuilderJStringBuilder.toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||