Class Constant

  • All Implemented Interfaces:
    AstNode, Typed, Xmir

    public final class Constant
    extends Object
    implements AstNode, Typed
    Constant. This class represents LDC instruction in the JVM bytecode.
    Since:
    0.2
    To do:
    #229:90min Do we need Constant class? It seems that this class is rather similar to Literal class. We need to investigate if we can remove this class and use Literal instead. If we can't remove this class, we need to add more tests to cover all the cases where Constant is used.
    • Constructor Detail

      • Constant

        public Constant​(org.eolang.jeo.representation.xmir.XmlNode node)
        Constructor.
        Parameters:
        node - The XMIR node with value to parse.
      • Constant

        public Constant​(Object value)
        Constructor.
        Parameters:
        value - The constant value.
      • Constant

        public Constant​(Object value,
                        org.objectweb.asm.Type type)
        Constructor.
        Parameters:
        value - The constant value.
        type - The constant value type.
    • Method Detail

      • opcodes

        public List<AstNode> opcodes()
        Description copied from interface: AstNode
        Bytecode instructions.
        Specified by:
        opcodes in interface AstNode
        Returns:
        List of opcodes.
      • toXmir

        public Iterable<org.xembly.Directive> toXmir()
        Description copied from interface: Xmir
        Convert node to XMIR.
        Specified by:
        toXmir in interface Xmir
        Returns:
        XMIR XML.
      • type

        public org.objectweb.asm.Type type()
        Description copied from interface: Typed
        Node type.
        Specified by:
        type in interface Typed
        Returns:
        Type.