| java.lang.Object com.sun.tools.javac.util.Name
Name | public class Name implements javax.lang.model.element.Name(Code) | | An abstraction for internal compiler strings. For efficiency reasons,
GJC uses hashed strings that are stored in a common large buffer.
Names represent unique hashable strings. Two names are equal
if their indices are equal. Utf8 representation is used
for storing names internally.
This is NOT part of any API supported by Sun Microsystems. If
you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.
|
Inner Class :public static class Table | |
Field Summary | |
public int | index The index where the bytes of this name are stored in the global name
buffer `names'. | public int | len The number of bytes in this name. | Name | next The next name occupying the same hash bucket. | public Table | table |
Method Summary | |
public Name | append(Name n) Return the concatenation of this name and name `n'. | public Name | append(char c, Name n) Return the concatenation of this name, the given ASCII
character, and name `n'. | public byte | byteAt(int i) Returns i'th byte of this name. | public char | charAt(int index) | public int | compareTo(Name other) An arbitrary but consistent complete order among all Names. | public static Name | concat(Table table, Name ns) Return the concatenation of all names in the array `ns'. | public boolean | contentEquals(CharSequence cs) | public boolean | endsWith(Name suffix) | public boolean | equals(Object other) | public static Name | fromChars(Table table, char[] cs, int start, int len) Create a name from the characters in cs[start..start+len-1]. | public static Name | fromString(Table table, String s) Create a name from the characters in string s. | public static Name | fromString(Table table, CharSequence s) Create a name from the characters in char sequence s. | public static Name | fromUtf(Table table, byte cs, int start, int len) Create a name from the bytes in cs[start..start+len-1]. | public static Name | fromUtf(Table table, byte cs) Create a name from the bytes in array cs. | public void | getBytes(byte cs, int start) Copy all bytes of this name to buffer cs, starting at start. | public int | hashCode() Return the hash value of this name. | public int | indexOf(byte b) Returns first occurrence of byte b in this name, len if not found. | public boolean | isEmpty() | public int | lastIndexOf(byte b) Returns last occurrence of byte b in this name, -1 if not found. | public int | length() Returns the length of this name. | public boolean | less(Name that) Compare this name to other name, yielding -1 if smaller, 0 if equal,
1 if greater. | public Name | replace(byte from, byte to) Replace all `from' bytes in this name with `to' bytes. | public boolean | startsWith(Name prefix) | public Name | subName(int start, int end) Returns the sub-name starting at position start, up to and
excluding position end. | public CharSequence | subSequence(int start, int end) | public String | toString() Return the string representation of this name. | public byte[] | toUtf() Return the Utf8 representation of this name. |
index | public int index(Code) | | The index where the bytes of this name are stored in the global name
buffer `names'.
|
len | public int len(Code) | | The number of bytes in this name.
|
next | Name next(Code) | | The next name occupying the same hash bucket.
|
table | public Table table(Code) | | The table structure where the name is stored
|
append | public Name append(Name n)(Code) | | Return the concatenation of this name and name `n'.
|
append | public Name append(char c, Name n)(Code) | | Return the concatenation of this name, the given ASCII
character, and name `n'.
|
byteAt | public byte byteAt(int i)(Code) | | Returns i'th byte of this name.
|
charAt | public char charAt(int index)(Code) | | |
compareTo | public int compareTo(Name other)(Code) | | An arbitrary but consistent complete order among all Names.
|
concat | public static Name concat(Table table, Name ns)(Code) | | Return the concatenation of all names in the array `ns'.
|
endsWith | public boolean endsWith(Name suffix)(Code) | | Does this name end with suffix?
|
equals | public boolean equals(Object other)(Code) | | Is this name equal to other?
|
fromChars | public static Name fromChars(Table table, char[] cs, int start, int len)(Code) | | Create a name from the characters in cs[start..start+len-1].
|
fromString | public static Name fromString(Table table, String s)(Code) | | Create a name from the characters in string s.
|
fromString | public static Name fromString(Table table, CharSequence s)(Code) | | Create a name from the characters in char sequence s.
|
fromUtf | public static Name fromUtf(Table table, byte cs, int start, int len)(Code) | | Create a name from the bytes in cs[start..start+len-1].
Assume that bytes are in utf8 format.
|
fromUtf | public static Name fromUtf(Table table, byte cs)(Code) | | Create a name from the bytes in array cs.
Assume that bytes are in utf8 format.
|
getBytes | public void getBytes(byte cs, int start)(Code) | | Copy all bytes of this name to buffer cs, starting at start.
|
hashCode | public int hashCode()(Code) | | Return the hash value of this name.
|
indexOf | public int indexOf(byte b)(Code) | | Returns first occurrence of byte b in this name, len if not found.
|
isEmpty | public boolean isEmpty()(Code) | | |
lastIndexOf | public int lastIndexOf(byte b)(Code) | | Returns last occurrence of byte b in this name, -1 if not found.
|
length | public int length()(Code) | | Returns the length of this name.
|
less | public boolean less(Name that)(Code) | | Compare this name to other name, yielding -1 if smaller, 0 if equal,
1 if greater.
|
replace | public Name replace(byte from, byte to)(Code) | | Replace all `from' bytes in this name with `to' bytes.
|
startsWith | public boolean startsWith(Name prefix)(Code) | | Does this name start with prefix?
|
subName | public Name subName(int start, int end)(Code) | | Returns the sub-name starting at position start, up to and
excluding position end.
|
toString | public String toString()(Code) | | Return the string representation of this name.
|
toUtf | public byte[] toUtf()(Code) | | Return the Utf8 representation of this name.
|
|
|