Class HxmValue

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class HxmValue
    extends java.lang.Object
    implements java.lang.AutoCloseable
    General value container. Any value in a Hexaly Modeler can be contained in an instance of this class (integer, double, boolean, string, HxExpression, module, map, function and also non exposed types like files or dates).
    Since:
    10.0
    • Method Detail

      • close

        public void close()

        Releases the reference. If this value was already released, returns immediately and does nothing. Invoking any method on this object after this operation will throw an exception.

        Note: Releasing a reference does not necessarily imply that the underlying value object is destroyed. It is only destroyed if no more references point to it.

        Specified by:
        close in interface java.lang.AutoCloseable
        Since:
        11.0
      • getType

        public HxmType getType()
        Returns the type of the value.
        Returns:
        Type of the value.
        See Also:
        HxmType
      • isInt

        public boolean isInt()
        Returns true if the value is an integer value.
      • isDouble

        public boolean isDouble()
        Returns true if the value is a double value.
      • isBool

        public boolean isBool()
        Returns true if the value is a boolean value.
      • isMap

        public boolean isMap()
        Returns true if the value is an HxmMap.
      • isModule

        public boolean isModule()
        Returns true if the value is an HxmModule.
      • isExpression

        public boolean isExpression()
        Returns true if the value is an HxExpression.
      • isFunction

        public boolean isFunction()
        Returns true if the value is a HxmFunction.
      • isString

        public boolean isString()
        Returns true if the value is a string.
      • isNil

        public boolean isNil()
        Returns true if the value is nil.
      • asInt

        public long asInt()
        Returns the value as an integer. The value must be an integer.
      • asDouble

        public double asDouble()
        Returns the value as a double. The value must be a double.
      • asBool

        public boolean asBool()
        Returns the value as a boolean. The value must be a boolean.
      • asString

        public java.lang.String asString()
        Returns the value as a String. The value must be a string.
      • asMap

        public HxmMap asMap()
        Returns the value as a HxmMap. The value must be a map.
      • asModule

        public HxmModule asModule()
        Returns the value as a HxmModule. The value must be a module.
      • asFunction

        public HxmFunction asFunction()
        Returns the value as a HxmFunction. The value must be a function.
      • asExpression

        public HxExpression asExpression()
        Returns the value as a HxExpression. The value must be an expression.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object