Interface Order

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALL
      stands for the amount "ALLES"
    • Method Detail

      • isEmpty

        boolean isEmpty()
        Returns:
        true if the order consists of no tokens or only the OrderToken.TT_EOC token.
      • isValid

        boolean isValid()
        This method returns true if there's a syntactic problem with the order. Use getProblem() to include other problems. If isValid returns true, getProblem() must return a problem.
        Returns:
        true if the order has been found valid by the order parser.
      • setPersistent

        void setPersistent​(boolean b)
        Determines if this is a persistent ("@") order.
      • isPersistent

        boolean isPersistent()
        Returns:
        true if this is a persistent ("@") order.
      • getToken

        OrderToken getToken​(int pos)
        Parameters:
        pos -
        Returns:
        the order at the specified position (between 0 and size()-1
      • getTokens

        java.util.List<OrderToken> getTokens()
        Returns a view on the order tokens. These includes the OrderToken.TT_EOC token at the end, but not the persistent ("@") token at the start.
        Returns:
        an unmodifiable view on the tokens
      • getText

        java.lang.String getText()
        Returns the original text that the order was parsed from, so it contains all white space characters and the "@".
        Returns:
        the original text that the order was parsed from.
      • size

        int size()
        Returns:
        The number of tokens (including the OrderToken.TT_EOC token.
      • execute

        void execute​(ExecutionState state,
                     GameData data,
                     Unit unit,
                     int line)
        Execute this order by registering UnitRelations etc.
        Parameters:
        state -
        data -
        unit -
        line -
      • isLong

        boolean isLong()
        Returns true if this is a "long" order.
      • setProblem

        void setProblem​(Problem problem)
        Sets a warning or error.
        Parameters:
        problem - The value for warning.
      • getProblem

        Problem getProblem()
        If a problem has been set, it is returned here. If the order is invalid, at least an OrderSyntaxProblem should is returned.
        Returns:
        Returns the problem or null