Class MCValueBoolean

java.lang.Object
de.monticore.values.MCValueBoolean
All Implemented Interfaces:
MCValue

public class MCValueBoolean extends Object implements MCValue
  • Field Details

    • value

      protected boolean value
  • Constructor Details

    • MCValueBoolean

      public MCValueBoolean(boolean value)
  • Method Details

    • isBoolean

      public boolean isBoolean()
      Specified by:
      isBoolean in interface MCValue
    • isPrimitive

      public boolean isPrimitive()
      Specified by:
      isPrimitive in interface MCValue
    • asBoolean

      public boolean asBoolean()
      Specified by:
      asBoolean in interface MCValue
    • asNativeObject

      public Boolean asNativeObject()
      Description copied from interface: MCValue
      Used to pass the value to native Java classes and similar, e.g., collections.

      Note: not all values can have a native representation, as such, their native version is the MIValue itself.

      Specified by:
      asNativeObject in interface MCValue
      Returns:
      The value as a Java native Object.
    • asString

      public String asString()
      Specified by:
      asString in interface MCValue
    • checkEqualityOperator

      public boolean checkEqualityOperator(MCValue other)
      Description copied from interface: MCValue
      basically implements ==
      Specified by:
      checkEqualityOperator in interface MCValue
      Parameters:
      other - the value to check against this
      Returns:
      whether they are considered equal
    • printType

      public String printType()
      Description copied from interface: MCValue
      Print the type of the MIValue in human-readable form
      Specified by:
      printType in interface MCValue
    • printValue

      public String printValue()
      Description copied from interface: MCValue
      Print the value in human-readable form
      Specified by:
      printValue in interface MCValue