Class BooleanValue

java.lang.Object
svm.value.Value
svm.value.BooleanValue

public class BooleanValue extends Value

BooleanValue.

boolean_value ::= true | false

Link to GitHub: Source File.

Author:
S-Port: Definition of S-code, Øystein Myhre Andersen
  • Field Details

    • value

      public boolean value
      The value
  • Constructor Details

    • BooleanValue

      public BooleanValue()
      Default Constructor
    • BooleanValue

      private BooleanValue(boolean value)
      Construct a new BooleanValue
      Parameters:
      value - true or false
  • Method Details

    • of

      public static BooleanValue of(boolean value)
      Create an Object to represent a boolean value. true: new BooleanValue, otherwise null
      Parameters:
      value - true or false
      Returns:
      the newly created BooleanValue
    • emit

      public void emit(DataSegment dseg)
      Description copied from class: Value
      Add this value to the given DataSegment
      Overrides:
      emit in class Value
      Parameters:
      dseg - the DataSegment
    • and

      public Value and(Value other)
      Description copied from class: Value
      Returns the result of: this value and other value
      Overrides:
      and in class Value
      Parameters:
      other - the other value
      Returns:
      the result of: this value and other value
    • or

      public BooleanValue or(Value other)
      Description copied from class: Value
      Returns the result of: this value or other value
      Overrides:
      or in class Value
      Parameters:
      other - the other value
      Returns:
      the result of: this value or other value
    • xor

      public BooleanValue xor(Value other)
      Description copied from class: Value
      Returns the result of: this value xor other value
      Overrides:
      xor in class Value
      Parameters:
      other - the other value
      Returns:
      the result of: this value xor other value
    • imp

      public BooleanValue imp(Value other)
      Description copied from class: Value
      Returns the result of: this value imp other value
      Overrides:
      imp in class Value
      Parameters:
      other - the other value
      Returns:
      the result of: this value imp other value
    • eqv

      public BooleanValue eqv(Value other)
      Description copied from class: Value
      Returns the result of: this value eqv other value
      Overrides:
      eqv in class Value
      Parameters:
      other - the other value
      Returns:
      the result of: this value eqv other value
    • compare

      public boolean compare(int relation, Value other)
      Description copied from class: Value
      Compare this Value with the given Value according to the given relation.
      Overrides:
      compare in class Value
      Parameters:
      relation - one of: LT, LE, EQ, GE, GT, NE
      other - the other Value
      Returns:
      true: if the relation holds
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • write

      public void write(AttributeOutputStream oupt) throws IOException
      Description copied from class: Value
      Writes this Value to the given output.
      Overrides:
      write in class Value
      Parameters:
      oupt - the output stream
      Throws:
      IOException - if IOException occur
    • read

      public static BooleanValue read(AttributeInputStream inpt) throws IOException
      Reads a BooleanValue from the given input.
      Parameters:
      inpt - the AttributeInputStream
      Returns:
      the BooleanValue read
      Throws:
      IOException - if IOException occur