org.jnetpcap.util
Class JStringBuilder

java.lang.Object
  extended by org.jnetpcap.util.JStringBuilder
All Implemented Interfaces:
java.lang.Appendable
Direct Known Subclasses:
ExpandableString

public class JStringBuilder
extends java.lang.Object
implements java.lang.Appendable

Subclassible delagate StringBuilder class. All the calls to this class are delegated to a private instance of StringBuilder.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Constructor Summary
JStringBuilder()
          Instantiates a new j string builder.
JStringBuilder(java.lang.CharSequence seq)
          Instantiates a new j string builder.
JStringBuilder(int capacity)
          Instantiates a new j string builder.
JStringBuilder(java.lang.String str)
          Instantiates a new j string builder.
 
Method Summary
 java.lang.StringBuilder append(boolean b)
          Append.
 java.lang.StringBuilder append(char c)
          Append.
 java.lang.StringBuilder append(char[] str)
          Append.
 java.lang.StringBuilder append(char[] str, int offset, int len)
          Append.
 java.lang.StringBuilder append(java.lang.CharSequence s)
          Append.
 java.lang.StringBuilder append(java.lang.CharSequence s, int start, int end)
          Append.
 java.lang.StringBuilder append(double d)
          Append.
 java.lang.StringBuilder append(float f)
          Append.
 java.lang.StringBuilder append(int i)
          Append.
 java.lang.StringBuilder append(long lng)
          Append.
 java.lang.StringBuilder append(java.lang.Object obj)
          Append.
 java.lang.StringBuilder append(java.lang.String str)
          Append.
 java.lang.StringBuilder append(java.lang.StringBuffer sb)
          Append.
 java.lang.StringBuilder appendCodePoint(int codePoint)
          Append code point.
 int capacity()
          Capacity.
 char charAt(int index)
          Char at.
 int codePointAt(int index)
          Code point at.
 int codePointBefore(int index)
          Code point before.
 int codePointCount(int beginIndex, int endIndex)
          Code point count.
 java.lang.StringBuilder delete(int start, int end)
          Delete.
 java.lang.StringBuilder deleteCharAt(int index)
          Delete char at.
 void ensureCapacity(int minimumCapacity)
          Ensure capacity.
 boolean equals(java.lang.Object obj)
          Equals.
 void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
          Gets the chars.
 int hashCode()
          Hash code.
 int indexOf(java.lang.String str)
          Index of.
 int indexOf(java.lang.String str, int fromIndex)
          Index of.
 java.lang.StringBuilder insert(int offset, boolean b)
          Insert.
 java.lang.StringBuilder insert(int offset, char c)
          Insert.
 java.lang.StringBuilder insert(int offset, char[] str)
          Insert.
 java.lang.StringBuilder insert(int index, char[] str, int offset, int len)
          Insert.
 java.lang.StringBuilder insert(int dstOffset, java.lang.CharSequence s)
          Insert.
 java.lang.StringBuilder insert(int dstOffset, java.lang.CharSequence s, int start, int end)
          Insert.
 java.lang.StringBuilder insert(int offset, double d)
          Insert.
 java.lang.StringBuilder insert(int offset, float f)
          Insert.
 java.lang.StringBuilder insert(int offset, int i)
          Insert.
 java.lang.StringBuilder insert(int offset, long l)
          Insert.
 java.lang.StringBuilder insert(int offset, java.lang.Object obj)
          Insert.
 java.lang.StringBuilder insert(int offset, java.lang.String str)
          Insert.
 int lastIndexOf(java.lang.String str)
          Last index of.
 int lastIndexOf(java.lang.String str, int fromIndex)
          Last index of.
 int length()
          Length.
 int offsetByCodePoints(int index, int codePointOffset)
          Offset by code points.
 java.lang.StringBuilder replace(int start, int end, java.lang.String str)
          Replace.
 java.lang.StringBuilder reverse()
          Reverse.
 void setCharAt(int index, char ch)
          Sets the char at.
 void setLength(int newLength)
          Sets the length.
 java.lang.CharSequence subSequence(int start, int end)
          Sub sequence.
 java.lang.String substring(int start)
          Substring.
 java.lang.String substring(int start, int end)
          Substring.
 java.lang.String toString()
          To string.
 void trimToSize()
          Trim to size.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JStringBuilder

public JStringBuilder()
Instantiates a new j string builder.

See Also:
StringBuilder.StringBuilder()

JStringBuilder

public JStringBuilder(java.lang.CharSequence seq)
Instantiates a new j string builder.

Parameters:
seq - the seq
See Also:
StringBuilder.StringBuilder(java.lang.CharSequence)

JStringBuilder

public JStringBuilder(int capacity)
Instantiates a new j string builder.

Parameters:
capacity - the capacity
See Also:
StringBuilder.StringBuilder(int)

JStringBuilder

public JStringBuilder(java.lang.String str)
Instantiates a new j string builder.

Parameters:
str - the str
See Also:
StringBuilder.StringBuilder(String)
Method Detail

append

public java.lang.StringBuilder append(boolean b)
Append.

Parameters:
b - the b
Returns:
the string builder
See Also:
StringBuilder.append(boolean)

append

public java.lang.StringBuilder append(char c)
Append.

Specified by:
append in interface java.lang.Appendable
Parameters:
c - the c
Returns:
the string builder
See Also:
StringBuilder.append(char)

append

public java.lang.StringBuilder append(char[] str)
Append.

Parameters:
str - the str
Returns:
the string builder
See Also:
StringBuilder.append(char[])

append

public java.lang.StringBuilder append(char[] str,
                                      int offset,
                                      int len)
Append.

Parameters:
str - the str
offset - the offset
len - the len
Returns:
the string builder
See Also:
StringBuilder.append(char[], int, int)

append

public java.lang.StringBuilder append(java.lang.CharSequence s)
Append.

Specified by:
append in interface java.lang.Appendable
Parameters:
s - the s
Returns:
the string builder
See Also:
StringBuilder.append(java.lang.CharSequence)

append

public java.lang.StringBuilder append(java.lang.CharSequence s,
                                      int start,
                                      int end)
Append.

Specified by:
append in interface java.lang.Appendable
Parameters:
s - the s
start - the start
end - the end
Returns:
the string builder
See Also:
StringBuilder.append(java.lang.CharSequence, int, int)

append

public java.lang.StringBuilder append(double d)
Append.

Parameters:
d - the d
Returns:
the string builder
See Also:
StringBuilder.append(double)

append

public java.lang.StringBuilder append(float f)
Append.

Parameters:
f - the f
Returns:
the string builder
See Also:
StringBuilder.append(float)

append

public java.lang.StringBuilder append(int i)
Append.

Parameters:
i - the i
Returns:
the string builder
See Also:
StringBuilder.append(int)

append

public java.lang.StringBuilder append(long lng)
Append.

Parameters:
lng - the lng
Returns:
the string builder
See Also:
StringBuilder.append(long)

append

public java.lang.StringBuilder append(java.lang.Object obj)
Append.

Parameters:
obj - the obj
Returns:
the string builder
See Also:
StringBuilder.append(java.lang.Object)

append

public java.lang.StringBuilder append(java.lang.String str)
Append.

Parameters:
str - the str
Returns:
the string builder
See Also:
StringBuilder.append(java.lang.String)

append

public java.lang.StringBuilder append(java.lang.StringBuffer sb)
Append.

Parameters:
sb - the sb
Returns:
the string builder
See Also:
StringBuilder.append(java.lang.StringBuffer)

appendCodePoint

public java.lang.StringBuilder appendCodePoint(int codePoint)
Append code point.

Parameters:
codePoint - the code point
Returns:
the string builder
See Also:
StringBuilder.appendCodePoint(int)

capacity

public int capacity()
Capacity.

Returns:
the int
See Also:
AbstractStringBuilder.capacity()

charAt

public char charAt(int index)
Char at.

Parameters:
index - the index
Returns:
the char
See Also:
AbstractStringBuilder.charAt(int)

codePointAt

public int codePointAt(int index)
Code point at.

Parameters:
index - the index
Returns:
the int
See Also:
AbstractStringBuilder.codePointAt(int)

codePointBefore

public int codePointBefore(int index)
Code point before.

Parameters:
index - the index
Returns:
the int
See Also:
AbstractStringBuilder.codePointBefore(int)

codePointCount

public int codePointCount(int beginIndex,
                          int endIndex)
Code point count.

Parameters:
beginIndex - the begin index
endIndex - the end index
Returns:
the int
See Also:
AbstractStringBuilder.codePointCount(int, int)

delete

public java.lang.StringBuilder delete(int start,
                                      int end)
Delete.

Parameters:
start - the start
end - the end
Returns:
the string builder
See Also:
StringBuilder.delete(int, int)

deleteCharAt

public java.lang.StringBuilder deleteCharAt(int index)
Delete char at.

Parameters:
index - the index
Returns:
the string builder
See Also:
StringBuilder.deleteCharAt(int)

ensureCapacity

public void ensureCapacity(int minimumCapacity)
Ensure capacity.

Parameters:
minimumCapacity - the minimum capacity
See Also:
AbstractStringBuilder.ensureCapacity(int)

equals

public boolean equals(java.lang.Object obj)
Equals.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the obj
Returns:
true, if successful
See Also:
Object.equals(java.lang.Object)

getChars

public void getChars(int srcBegin,
                     int srcEnd,
                     char[] dst,
                     int dstBegin)
Gets the chars.

Parameters:
srcBegin - the src begin
srcEnd - the src end
dst - the dst
dstBegin - the dst begin
See Also:
AbstractStringBuilder.getChars(int, int, char[], int)

hashCode

public int hashCode()
Hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
the int
See Also:
Object.hashCode()

indexOf

public int indexOf(java.lang.String str)
Index of.

Parameters:
str - the str
Returns:
the int
See Also:
StringBuilder.indexOf(java.lang.String)

indexOf

public int indexOf(java.lang.String str,
                   int fromIndex)
Index of.

Parameters:
str - the str
fromIndex - the from index
Returns:
the int
See Also:
StringBuilder.indexOf(java.lang.String, int)

insert

public java.lang.StringBuilder insert(int offset,
                                      boolean b)
Insert.

Parameters:
offset - the offset
b - the b
Returns:
the string builder
See Also:
StringBuilder.insert(int, boolean)

insert

public java.lang.StringBuilder insert(int offset,
                                      char c)
Insert.

Parameters:
offset - the offset
c - the c
Returns:
the string builder
See Also:
StringBuilder.insert(int, char)

insert

public java.lang.StringBuilder insert(int offset,
                                      char[] str)
Insert.

Parameters:
offset - the offset
str - the str
Returns:
the string builder
See Also:
StringBuilder.insert(int, char[])

insert

public java.lang.StringBuilder insert(int index,
                                      char[] str,
                                      int offset,
                                      int len)
Insert.

Parameters:
index - the index
str - the str
offset - the offset
len - the len
Returns:
the string builder
See Also:
StringBuilder.insert(int, char[], int, int)

insert

public java.lang.StringBuilder insert(int dstOffset,
                                      java.lang.CharSequence s)
Insert.

Parameters:
dstOffset - the dst offset
s - the s
Returns:
the string builder
See Also:
StringBuilder.insert(int, java.lang.CharSequence)

insert

public java.lang.StringBuilder insert(int dstOffset,
                                      java.lang.CharSequence s,
                                      int start,
                                      int end)
Insert.

Parameters:
dstOffset - the dst offset
s - the s
start - the start
end - the end
Returns:
the string builder
See Also:
StringBuilder.insert(int, java.lang.CharSequence, int, int)

insert

public java.lang.StringBuilder insert(int offset,
                                      double d)
Insert.

Parameters:
offset - the offset
d - the d
Returns:
the string builder
See Also:
StringBuilder.insert(int, double)

insert

public java.lang.StringBuilder insert(int offset,
                                      float f)
Insert.

Parameters:
offset - the offset
f - the f
Returns:
the string builder
See Also:
StringBuilder.insert(int, float)

insert

public java.lang.StringBuilder insert(int offset,
                                      int i)
Insert.

Parameters:
offset - the offset
i - the i
Returns:
the string builder
See Also:
StringBuilder.insert(int, int)

insert

public java.lang.StringBuilder insert(int offset,
                                      long l)
Insert.

Parameters:
offset - the offset
l - the l
Returns:
the string builder
See Also:
StringBuilder.insert(int, long)

insert

public java.lang.StringBuilder insert(int offset,
                                      java.lang.Object obj)
Insert.

Parameters:
offset - the offset
obj - the obj
Returns:
the string builder
See Also:
StringBuilder.insert(int, java.lang.Object)

insert

public java.lang.StringBuilder insert(int offset,
                                      java.lang.String str)
Insert.

Parameters:
offset - the offset
str - the str
Returns:
the string builder
See Also:
StringBuilder.insert(int, java.lang.String)

lastIndexOf

public int lastIndexOf(java.lang.String str)
Last index of.

Parameters:
str - the str
Returns:
the int
See Also:
StringBuilder.lastIndexOf(java.lang.String)

lastIndexOf

public int lastIndexOf(java.lang.String str,
                       int fromIndex)
Last index of.

Parameters:
str - the str
fromIndex - the from index
Returns:
the int
See Also:
StringBuilder.lastIndexOf(java.lang.String, int)

length

public int length()
Length.

Returns:
the int
See Also:
AbstractStringBuilder.length()

offsetByCodePoints

public int offsetByCodePoints(int index,
                              int codePointOffset)
Offset by code points.

Parameters:
index - the index
codePointOffset - the code point offset
Returns:
the int
See Also:
AbstractStringBuilder.offsetByCodePoints(int, int)

replace

public java.lang.StringBuilder replace(int start,
                                       int end,
                                       java.lang.String str)
Replace.

Parameters:
start - the start
end - the end
str - the str
Returns:
the string builder
See Also:
StringBuilder.replace(int, int, java.lang.String)

reverse

public java.lang.StringBuilder reverse()
Reverse.

Returns:
the string builder
See Also:
StringBuilder.reverse()

setCharAt

public void setCharAt(int index,
                      char ch)
Sets the char at.

Parameters:
index - the index
ch - the ch
See Also:
AbstractStringBuilder.setCharAt(int, char)

setLength

public void setLength(int newLength)
Sets the length.

Parameters:
newLength - the new length
See Also:
AbstractStringBuilder.setLength(int)

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)
Sub sequence.

Parameters:
start - the start
end - the end
Returns:
the char sequence
See Also:
AbstractStringBuilder.subSequence(int, int)

substring

public java.lang.String substring(int start)
Substring.

Parameters:
start - the start
Returns:
the string
See Also:
AbstractStringBuilder.substring(int)

substring

public java.lang.String substring(int start,
                                  int end)
Substring.

Parameters:
start - the start
end - the end
Returns:
the string
See Also:
AbstractStringBuilder.substring(int, int)

toString

public java.lang.String toString()
To string.

Overrides:
toString in class java.lang.Object
Returns:
the string
See Also:
StringBuilder.toString()

trimToSize

public void trimToSize()
Trim to size.

See Also:
AbstractStringBuilder.trimToSize()