ppt4j 1.0
 
Loading...
Searching...
No Matches
ppt4j.analysis.java.ConstPropAnalysis< R extends CtElement > Class Template Reference
Inheritance diagram for ppt4j.analysis.java.ConstPropAnalysis< R extends CtElement >:
ppt4j.analysis.AbstractAnalysis

Public Member Functions

 ConstPropAnalysis (R element)
 
ConstPropAnalysis< R > analyze ()
 
boolean isLiteral ()
 
CtLiteral<?> getLiteral ()
 

Constructor & Destructor Documentation

◆ ConstPropAnalysis()

ppt4j.analysis.java.ConstPropAnalysis< R extends CtElement >.ConstPropAnalysis ( R element)

Member Function Documentation

◆ analyze()

ConstPropAnalysis< R > ppt4j.analysis.java.ConstPropAnalysis< R extends CtElement >.analyze ( )

This method performs constant propagation analysis on the given element. It evaluates the element using a ConstEvaluator and checks various conditions based on the type of element (CtFieldRead) and its modifiers. If the element is a CtFieldRead representing a specific key ("int#length") or has certain modifiers (static without final or non-Java library field with no modifiers), the element itself is marked as the result. If the key corresponds to a value in a predefined library, a new literal element is created with that value and set as the result. If the element represents a platform-specific field, it is also marked as the result. Otherwise, the element is evaluated using the ConstEvaluator and the result is set accordingly. The method returns an instance of ConstPropAnalysis representing the result of the analysis.

Implements ppt4j.analysis.AbstractAnalysis.

◆ getLiteral()

CtLiteral<?> ppt4j.analysis.java.ConstPropAnalysis< R extends CtElement >.getLiteral ( )

Retrieves the CtLiteral object from the result.

Returns
the CtLiteral object contained in the result

◆ isLiteral()

boolean ppt4j.analysis.java.ConstPropAnalysis< R extends CtElement >.isLiteral ( )

Checks if the result is a literal value that is not null.

Returns
true if the result is a literal value that is not null, false otherwise

The documentation for this class was generated from the following file: