| java.lang.Object com.quadcap.util.OctetString
OctetString | public class OctetString (Code) | | An OctetString is a variable length string of octets.
author: Stan Bailes |
Constructor Summary | |
public | OctetString(byte[] data) Construct a new OctetString using the specified byte array. | public | OctetString(byte[] data, int offset, int len) Construct a new OctetString using a substring from the specified byte
array. | public | OctetString(String str) Construct a new OctetString from the specified java.lang.String value. |
Method Summary | |
public OctetString | afterLast(char c) A truly general purpose function designed for a specified task,
this returns a new string containing the portion of this string
after the last occurrence of the specified character. | public OctetString | append(String s) | public OctetString | append(OctetString s) | public OctetString | append(byte[] b) | public OctetString | before(char c) Return substring containing the portion of this string before the
first occurence of the specified character. | public OctetString | beforeLast(char c) A truly general purpose function designed for a specified task,
this returns a new string containing the portion of this string
before the last occurrence of the specified character. | public boolean | equals(Object obj) | public static boolean | equals(OctetString s1, int pos1, OctetString s2, int pos2, int len) | public boolean | equalsIgnoreCase(Object obj) | public byte[] | getBytes() For types which can be directly handled by comparators, return this
object as a byte array. | public int | getIntSubString(int start, int end) Another general purpose routine :-)
This one converts a particular substring of this string to an
integer. | public int | hashCode() | public int | indexOf(char c) String search for character. | public int | lastIndexOf(char c) String search for character. | public int | size() Return the size of this string. | public OctetString | substring(int start, int end) Return a new string containing the specified substring of this string. | public OctetString | substring(int start) Return a new string containing the specified substring of this string,
starting with the specified character, and ending with the last
character of the string. | public String | toString() Return the string representation of this item. |
OctetString | public OctetString(byte[] data)(Code) | | Construct a new OctetString using the specified byte array. Note
that we simply acquire the byte array -- no copying is done!
Parameters: data - the byte array making up the string |
OctetString | public OctetString(byte[] data, int offset, int len)(Code) | | Construct a new OctetString using a substring from the specified byte
array. This constructor does allocate a new byte array and
copies data from the original array.
Parameters: data - the source byte array Parameters: offset - the position of the first character in the substring Parameters: len - the number of bytes in the new string |
OctetString | public OctetString(String str)(Code) | | Construct a new OctetString from the specified java.lang.String value.
Parameters: str - the string value |
afterLast | public OctetString afterLast(char c)(Code) | | A truly general purpose function designed for a specified task,
this returns a new string containing the portion of this string
after the last occurrence of the specified character.
For example:
"/addressbook/user/stan/ABC457".afterLast('/') returns "ABC457"
Parameters: c - the character a new OctetString containing the required suffix |
before | public OctetString before(char c)(Code) | | Return substring containing the portion of this string before the
first occurence of the specified character.
Parameters: c - the character a new OctetString containing the substring. |
beforeLast | public OctetString beforeLast(char c)(Code) | | A truly general purpose function designed for a specified task,
this returns a new string containing the portion of this string
before the last occurrence of the specified character.
For example:
"/addressbook/user/stan/ABC457".beforeLast('/') returns
"/addressbook/user/stan"
Parameters: c - the character a new OctetString containing the required prefix |
equals | public static boolean equals(OctetString s1, int pos1, OctetString s2, int pos2, int len)(Code) | | String comparison using the binary equality comparator
|
equalsIgnoreCase | public boolean equalsIgnoreCase(Object obj)(Code) | | |
getBytes | public byte[] getBytes()(Code) | | For types which can be directly handled by comparators, return this
object as a byte array. For special types (e.g., NIL or List),
return null.
|
getIntSubString | public int getIntSubString(int start, int end)(Code) | | Another general purpose routine :-)
This one converts a particular substring of this string to an
integer.
Parameters: start - the position of the first character of the substring Parameters: end - the position of the character after the substring |
hashCode | public int hashCode()(Code) | | |
indexOf | public int indexOf(char c)(Code) | | String search for character. Should this use a comparator? XXX
Parameters: c - the character to search for the index of the first occurrence of the character in thisstring, or -1 if the character does not occur in the string. |
lastIndexOf | public int lastIndexOf(char c)(Code) | | String search for character. Should this use a comparator? XXX
Parameters: c - the character to search for the index of the last occurrence of the character in thisstring, or -1 if the character does not occur in the string. |
size | public int size()(Code) | | Return the size of this string.
|
substring | public OctetString substring(int start, int end)(Code) | | Return a new string containing the specified substring of this string.
Parameters: start - the position of the first character of the substring Parameters: end - the position of the character after the substring the substring |
substring | public OctetString substring(int start)(Code) | | Return a new string containing the specified substring of this string,
starting with the specified character, and ending with the last
character of the string.
Parameters: start - the position of the first character of the substring the substring |
toString | public String toString()(Code) | | Return the string representation of this item.
the string value |
|
|