Top Description Inners Methods
com.sun.tools.javac.jvm

public Interface PoolConstant

Known Direct Subinterfaces
com.sun.tools.javac.jvm.PoolConstant.LoadableConstant, com.sun.tools.javac.jvm.PoolConstant.Dynamic
Known Direct Implementers
com.sun.tools.javac.jvm.PoolConstant.NameAndType, com.sun.tools.javac.util.Name, com.sun.tools.javac.code.Symbol, com.sun.tools.javac.code.Type
Imports
com.sun.tools.javac.code.Type, .Types, .Types.UniqueType, com.sun.tools.javac.util.List, .Name, .Pair, java.util.Objects, java.util.stream.Stream

This interface models all javac entities that can be used to represent constant pool entries. A pool constant entity must (i) be associated with a constant pool entry tag and have a function which generates a key for the desired pool entry (so as to avoid duplicate entries when writing the constant pool).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
PoolConstant.Dynamic

This interface models a dynamic pool constant (either of kind InvokeDynamic or ConstantDynamic).

public static interface
PoolConstant.LoadableConstant

The root of pool constants that can be loaded (e.g. with ldc, or appear as static arguments to a bootstrap method.

public static class
PoolConstant.NameAndType

A pool constant implementation describing a name and type pool entry.

Method Summary

Modifier and TypeMethod and Description
public default Object
poolKey(Types types)

The constant pool entry key.

public int
poolTag()

The constant pool entry tag.

Method Detail

poolKeyback to summary
public default Object poolKey(Types types)

The constant pool entry key.

poolTagback to summary
public int poolTag()

The constant pool entry tag.

com.sun.tools.javac.jvm back to summary

public Interface PoolConstant.Dynamic

extends PoolConstant
Known Direct Implementers
com.sun.tools.javac.code.Symbol.DynamicMethodSymbol, com.sun.tools.javac.code.Symbol.DynamicVarSymbol

This interface models a dynamic pool constant (either of kind InvokeDynamic or ConstantDynamic). In addition to the functionalities provided by the base interface, a dynamic pool constant must expose its dynamic type, bootstrap method and static argument list. Finally, a dynamic constant must have a way to compute a bootstrap method key - that is, a unique key for the bootstrap method entry it refers to, to avoid duplicates when writing the BootstrapMethods attribute.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PoolConstant.Dynamic.BsmKey

A class modelling a bootstrap method key.

public static record

Method Summary

Modifier and TypeMethod and Description
public PoolConstant.LoadableConstant
bootstrapMethod()

The dynamic constant's bootstrap method.

public default PoolConstant.Dynamic.BsmKey
bsmKey(Types types)

public PoolConstant
dynamicType()

The dynamic constant's dynamic type.

public Name
name()

The dynamic constant's name.

public default Object
poolKey(Types types)

Overrides default com.sun.tools.javac.jvm.PoolConstant.poolKey.

The constant pool entry key.
public PoolConstant.LoadableConstant[]
staticArgs()

The dynamic constant's static argument list.

Inherited from com.sun.tools.javac.jvm.PoolConstant:
poolTag

Method Detail

bootstrapMethodback to summary
public PoolConstant.LoadableConstant bootstrapMethod()

The dynamic constant's bootstrap method.

bsmKeyback to summary
public default PoolConstant.Dynamic.BsmKey bsmKey(Types types)
dynamicTypeback to summary
public PoolConstant dynamicType()

The dynamic constant's dynamic type.

nameback to summary
public Name name()

The dynamic constant's name.

poolKeyback to summary
public default Object poolKey(Types types)

Overrides default com.sun.tools.javac.jvm.PoolConstant.poolKey.

Doc from com.sun.tools.javac.jvm.PoolConstant.poolKey.

The constant pool entry key.

Annotations
@Override
staticArgsback to summary
public PoolConstant.LoadableConstant[] staticArgs()

The dynamic constant's static argument list.

com.sun.tools.javac.jvm back to summary

public Class PoolConstant.Dynamic.BsmKey

extends Object
Class Inheritance

A class modelling a bootstrap method key.

Field Summary

Modifier and TypeField and Description
public final PoolConstant.LoadableConstant
bsm

The key's bootstrap method constant.

private final Object
private final List<?>
public final PoolConstant.LoadableConstant[]
staticArgs

The key's static argument list.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

bsmback to summary
public final PoolConstant.LoadableConstant bsm

The key's bootstrap method constant.

bsmKeyback to summary
private final Object bsmKey
staticArgKeysback to summary
private final List<?> staticArgKeys
staticArgsback to summary
public final PoolConstant.LoadableConstant[] staticArgs

The key's static argument list.

Constructor Detail

BsmKeyback to summary
private BsmKey(Types types, PoolConstant.LoadableConstant bsm, PoolConstant.LoadableConstant[] staticArgs)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
com.sun.tools.javac.jvm back to summary

public final Record PoolConstant.Dynamic.PoolKey

extends Record
Class Inheritance
Record Components
name:Name
bsmKey:PoolConstant.Dynamic.BsmKey
dynamicType:Object

Field Summary

Modifier and TypeField and Description
private final PoolConstant.Dynamic.BsmKey
bsmKey

Record Component accessed by bsmKey().

private final Object
dynamicType

Record Component accessed by dynamicType().

private final Name
name

Record Component accessed by name().

Constructor Summary

AccessConstructor and Description
public
PoolKey(Name name, PoolConstant.Dynamic.BsmKey bsmKey, Object dynamicType)

Method Summary

Modifier and TypeMethod and Description
public PoolConstant.Dynamic.BsmKey
bsmKey()

Record Component getter of bsmKey.

public Object
dynamicType()

Record Component getter of dynamicType.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public Name
name()

Record Component getter of name.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

bsmKeyback to summary
private final PoolConstant.Dynamic.BsmKey bsmKey

Record Component accessed by bsmKey().

dynamicTypeback to summary
private final Object dynamicType

Record Component accessed by dynamicType().

nameback to summary
private final Name name

Record Component accessed by name().

Constructor Detail

PoolKeyback to summary
public PoolKey(Name name, PoolConstant.Dynamic.BsmKey bsmKey, Object dynamicType)

Method Detail

bsmKeyback to summary
public PoolConstant.Dynamic.BsmKey bsmKey()

Record Component getter of bsmKey.

dynamicTypeback to summary
public Object dynamicType()

Record Component getter of dynamicType.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

nameback to summary
public Name name()

Record Component getter of name.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

com.sun.tools.javac.jvm back to summary

public Interface PoolConstant.LoadableConstant

extends PoolConstant
Known Direct Implementers
com.sun.tools.javac.jvm.PoolConstant.LoadableConstant.BasicConstant, com.sun.tools.javac.code.Symbol.DynamicVarSymbol, com.sun.tools.javac.code.Symbol.MethodHandleSymbol, com.sun.tools.javac.code.Type.ClassType, com.sun.tools.javac.code.Type.ArrayType, com.sun.tools.javac.code.Type.MethodType

The root of pool constants that can be loaded (e.g. with ldc, or appear as static arguments to a bootstrap method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PoolConstant.LoadableConstant.BasicConstant

This class models a pool constant of given basic type, one of int, float, long, double or String.

Method Summary

Modifier and TypeMethod and Description
public static PoolConstant.LoadableConstant
Double(double d)

Create a pool constant describing a given double value.

public static PoolConstant.LoadableConstant
Float(float f)

Create a pool constant describing a given float value.

public static PoolConstant.LoadableConstant
Int(int i)

Create a pool constant describing a given int value.

public static PoolConstant.LoadableConstant
Long(long l)

Create a pool constant describing a given long value.

public static PoolConstant.LoadableConstant
String(String s)

Create a pool constant describing a given String value.

Inherited from com.sun.tools.javac.jvm.PoolConstant:
poolKeypoolTag

Method Detail

Doubleback to summary
public static PoolConstant.LoadableConstant Double(double d)

Create a pool constant describing a given double value.

Floatback to summary
public static PoolConstant.LoadableConstant Float(float f)

Create a pool constant describing a given float value.

Intback to summary
public static PoolConstant.LoadableConstant Int(int i)

Create a pool constant describing a given int value.

Longback to summary
public static PoolConstant.LoadableConstant Long(long l)

Create a pool constant describing a given long value.

Stringback to summary
public static PoolConstant.LoadableConstant String(String s)

Create a pool constant describing a given String value.

com.sun.tools.javac.jvm back to summary

public Class PoolConstant.LoadableConstant.BasicConstant

extends Object
implements LoadableConstant
Class Inheritance
  • java.lang.Object
  • com.sun.tools.javac.jvm.PoolConstant.LoadableConstant.BasicConstant
All Implemented Interfaces
com.sun.tools.javac.jvm.PoolConstant.LoadableConstant, com.sun.tools.javac.jvm.PoolConstant

This class models a pool constant of given basic type, one of int, float, long, double or String.

Field Summary

Modifier and TypeField and Description
pack-priv Object
pack-priv int

Constructor Summary

AccessConstructor and Description
private
BasicConstant(int tag, Object data)

Method Summary

Modifier and TypeMethod and Description
public Object
poolKey(Types types)

Overrides default com.sun.tools.javac.jvm.PoolConstant.poolKey.

The constant pool entry key.
public int
poolTag()

Implements com.sun.tools.javac.jvm.PoolConstant.poolTag.

The constant pool entry tag.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
pack-priv Object data
tagback to summary
pack-priv int tag

Constructor Detail

BasicConstantback to summary
private BasicConstant(int tag, Object data)

Method Detail

poolKeyback to summary
public Object poolKey(Types types)

Overrides default com.sun.tools.javac.jvm.PoolConstant.poolKey.

Doc from com.sun.tools.javac.jvm.PoolConstant.poolKey.

The constant pool entry key.

Annotations
@Override
poolTagback to summary
public int poolTag()

Implements com.sun.tools.javac.jvm.PoolConstant.poolTag.

Doc from com.sun.tools.javac.jvm.PoolConstant.poolTag.

The constant pool entry tag.

Annotations
@Override
com.sun.tools.javac.jvm back to summary

public final Class PoolConstant.NameAndType

extends Object
implements PoolConstant
Class Inheritance
All Implemented Interfaces
com.sun.tools.javac.jvm.PoolConstant

A pool constant implementation describing a name and type pool entry.

Field Summary

Modifier and TypeField and Description
pack-priv final Name
pack-priv final Type

Constructor Summary

AccessConstructor and Description
pack-priv
NameAndType(Name name, Type type)

Method Summary

Modifier and TypeMethod and Description
public Object
poolKey(Types types)

Overrides default com.sun.tools.javac.jvm.PoolConstant.poolKey.

The constant pool entry key.
public int
poolTag()

Implements com.sun.tools.javac.jvm.PoolConstant.poolTag.

The constant pool entry tag.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
pack-priv final Name name
typeback to summary
pack-priv final Type type

Constructor Detail

NameAndTypeback to summary
pack-priv NameAndType(Name name, Type type)

Method Detail

poolKeyback to summary
public Object poolKey(Types types)

Overrides default com.sun.tools.javac.jvm.PoolConstant.poolKey.

Doc from com.sun.tools.javac.jvm.PoolConstant.poolKey.

The constant pool entry key.

Annotations
@Override
poolTagback to summary
public int poolTag()

Implements com.sun.tools.javac.jvm.PoolConstant.poolTag.

Doc from com.sun.tools.javac.jvm.PoolConstant.poolTag.

The constant pool entry tag.

Annotations
@Override