soot.coffi
Class Utf8_Enumeration
java.lang.Object
|
+--soot.coffi.Utf8_Enumeration
- All Implemented Interfaces:
- java.util.Enumeration
- public class Utf8_Enumeration
- extends java.lang.Object
- implements java.util.Enumeration
An enumeration of a Utf8 allows one to run through the characters in a
unicode string; used primarily for comparing unicode strings. Note that
unlike regular enumerations, and to be efficient (ie to avoid allocating
an object in each call to nextElement), the return value is accessed by
this object's 'c' field, and nextElement merely returns this.
- See Also:
CONSTANT_Utf8_info
,
c
,
nextElement()
Field Summary |
int |
c
The latest character, as determined by nextElement. |
Constructor Summary |
Utf8_Enumeration()
For creating an empty enumeration; you must use reset() after this
to initialize the enumeration. |
Utf8_Enumeration(byte[] b)
For creating a normal enumeration of the given Utf8 string. |
Method Summary |
boolean |
hasMoreElements()
true if the entire string hasn't been enumerated yet. |
java.lang.Object |
nextElement()
Determines the next Utf8 character, and stores it in c. |
void |
reset(byte[] b)
Resets this object to be an enumeration of the given Utf8 string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
c
public int c
- The latest character, as determined by nextElement.
- See Also:
nextElement()
Utf8_Enumeration
public Utf8_Enumeration()
- For creating an empty enumeration; you must use reset() after this
to initialize the enumeration.
- See Also:
reset(byte[])
Utf8_Enumeration
public Utf8_Enumeration(byte[] b)
- For creating a normal enumeration of the given Utf8 string.
- Parameters:
b
- array of bytes in Utf8 format.
reset
public void reset(byte[] b)
- Resets this object to be an enumeration of the given Utf8 string.
- Parameters:
b
- array of bytes in Utf8 format.
hasMoreElements
public boolean hasMoreElements()
- true if the entire string hasn't been enumerated yet.
- Specified by:
hasMoreElements
in interface java.util.Enumeration
nextElement
public java.lang.Object nextElement()
- Determines the next Utf8 character, and stores it in c.
- Specified by:
nextElement
in interface java.util.Enumeration
- Returns:
- this
- See Also:
c