APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.javac.util

public Class StringNameTable

extends Table
Class Inheritance
Imports
java.util.HashMap

Straightforward implementation of Name.Table using Strings.

This is NOT part of any supported API. 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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final HashMap<String, Name>
Inherited from com.sun.tools.javac.util.Name.Table:
names

Constructor Summary

AccessConstructor and Description
public
StringNameTable(Names names, boolean intern)

public
StringNameTable(Names names, int initialCapacity, boolean intern)

Method Summary

Modifier and TypeMethod and Description
public static StringNameTable
create(Names names, boolean intern)

public void
dispose()

Implements abstract com.sun.tools.javac.util.Name.Table.dispose.

Release any resources used by this table.

public Name
fromChars(char[] buf, int off, int len)

Implements abstract com.sun.tools.javac.util.Name.Table.fromChars.

Get the unique Name corresponding to the given characters.

public Name
fromString(String string)

Overrides com.sun.tools.javac.util.Name.Table.fromString.

Get the unique Name corresponding to the given string.

public Name
fromUtf(byte[] buf, int off, int len, Convert.Validation validation)

Implements abstract com.sun.tools.javac.util.Name.Table.fromUtf.

Get the unique Name corresponding to the given Modified UTF-8 encoding.

Inherited from com.sun.tools.javac.util.Name.Table:
fromUtf

Field Detail

internback to summary
private final boolean intern
nameMapback to summary
private final HashMap<String, Name> nameMap

Constructor Detail

StringNameTableback to summary
public StringNameTable(Names names, boolean intern)
StringNameTableback to summary
public StringNameTable(Names names, int initialCapacity, boolean intern)

Method Detail

createback to summary
public static StringNameTable create(Names names, boolean intern)
disposeback to summary
public void dispose()

Implements abstract com.sun.tools.javac.util.Name.Table.dispose.

Doc from com.sun.tools.javac.util.Name.Table.dispose.

Release any resources used by this table.

Annotations
@Override
fromCharsback to summary
public Name fromChars(char[] buf, int off, int len)

Implements abstract com.sun.tools.javac.util.Name.Table.fromChars.

Doc from com.sun.tools.javac.util.Name.Table.fromChars.

Get the unique Name corresponding to the given characters.

Annotations
@Override
fromStringback to summary
public Name fromString(String string)

Overrides com.sun.tools.javac.util.Name.Table.fromString.

Doc from com.sun.tools.javac.util.Name.Table.fromString.

Get the unique Name corresponding to the given string.

The implementation in Table delegates to String#toCharArray and then fromChars.

Annotations
@Override
fromUtfback to summary
public Name fromUtf(byte[] buf, int off, int len, Convert.Validation validation) throws InvalidUtfException

Implements abstract com.sun.tools.javac.util.Name.Table.fromUtf.

Doc from com.sun.tools.javac.util.Name.Table.fromUtf.

Get the unique Name corresponding to the given Modified UTF-8 encoding.

Annotations
@Override
Exceptions
InvalidUtfException:
if invalid Modified UTF-8 is encountered
com.sun.tools.javac.util back to summary

private final Class StringNameTable.NameImpl

extends Name
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
Inherited from com.sun.tools.javac.util.Name:
table

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
contentEquals(CharSequence cs)

Overrides com.sun.tools.javac.util.Name.contentEquals.

Implements javax.lang.model.element.Name.contentEquals.

Compares this name to the specified CharSequence.

public void
getUtf8Bytes(byte[] buf, int off)

Implements abstract com.sun.tools.javac.util.Name.getUtf8Bytes.

Write the Modified UTF-8 encoding of this name into the given buffer starting at the specified offset.

public int
getUtf8Length()

Implements abstract com.sun.tools.javac.util.Name.getUtf8Length.

Get the length of the Modified UTF-8 encoding of this name.

public int
hashCode()

Implements abstract com.sun.tools.javac.util.Name.hashCode.

Implements javax.lang.model.element.Name.hashCode.

Obeys the general contract of Object.hashCode.

protected boolean
nameEquals(Name that)

Implements abstract com.sun.tools.javac.util.Name.nameEquals.

Subclass check for equality.

public String
toString()

Implements abstract com.sun.tools.javac.util.Name.toString.

Implements java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence.

Inherited from com.sun.tools.javac.util.Name:
appendappendcharAtcompareToequalsisEmptylastIndexOfAsciilengthmappoolTagstartsWithsubNamesubNamesubSequencetoUtf

Field Detail

stringback to summary
private final String string

Constructor Detail

NameImplback to summary
pack-priv NameImpl(StringNameTable table, String string)

Method Detail

contentEqualsback to summary
public boolean contentEquals(CharSequence cs)

Overrides com.sun.tools.javac.util.Name.contentEquals.

Implements javax.lang.model.element.Name.contentEquals.

Doc from com.sun.tools.javac.util.Name.contentEquals.

Compares this name to the specified CharSequence. The result is true if and only if this name represents the same sequence of char values as the specified sequence.

The implementation in Name invokes Object#toString on this instance and then delegates to String#equals.

Annotations
@Override
getUtf8Bytesback to summary
public void getUtf8Bytes(byte[] buf, int off)

Implements abstract com.sun.tools.javac.util.Name.getUtf8Bytes.

Doc from com.sun.tools.javac.util.Name.getUtf8Bytes.

Write the Modified UTF-8 encoding of this name into the given buffer starting at the specified offset.

Annotations
@Override
getUtf8Lengthback to summary
public int getUtf8Length()

Implements abstract com.sun.tools.javac.util.Name.getUtf8Length.

Doc from com.sun.tools.javac.util.Name.getUtf8Length.

Get the length of the Modified UTF-8 encoding of this name.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract com.sun.tools.javac.util.Name.hashCode.

Implements javax.lang.model.element.Name.hashCode.

Doc from javax.lang.model.element.Name.hashCode.

Obeys the general contract of Object.hashCode.

Annotations
@Override
nameEqualsback to summary
protected boolean nameEquals(Name that)

Implements abstract com.sun.tools.javac.util.Name.nameEquals.

Doc from com.sun.tools.javac.util.Name.nameEquals.

Subclass check for equality.

This method can assume that the given instance is the same type as this instance and is associated to the same Table.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract com.sun.tools.javac.util.Name.toString.

Implements java.lang.CharSequence.toString.

Doc from java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

Annotations
@Override