Class ListExpression

    • Constructor Detail

      • ListExpression

        public ListExpression​(Tag type,
                              Collection<Expression> expressions,
                              String separator,
                              String startOfList,
                              String endOfList)
        Instantiates a new List expression.
        Parameters:
        type - the type
        expressions - the expressions
    • Method Detail

      • handler

        public static PrefixHandler handler​(Tag startOfListTag,
                                            Tag endOfListTag,
                                            Tag separatorTag,
                                            String startOfListStr,
                                            String endOfListStr,
                                            String separatorStr)
        Handler prefix handler.
        Parameters:
        startOfListTag - the operator
        endOfListTag - the end of list
        separatorTag - the separator
        Returns:
        the prefix handler
      • get

        public Expression get​(int index)
        Get expression.
        Parameters:
        index - the index
        Returns:
        the expression
      • numberOfExpressions

        public int numberOfExpressions()
        Number of expressions int.
        Returns:
        the int
      • isEmpty

        public boolean isEmpty()
        Checks if there no expressions in the list
        Returns:
        True if the list of expressions is empty
      • elementsAs

        public <E extends ExpressionList<E> elementsAs​(Class<E> eClass)
        Generates the list of elements casting them to the desired expression type
        Type Parameters:
        E - the expression type parameter
        Parameters:
        eClass - the expression class
        Returns:
        the list of expression as the given type
      • stream

        public Stream<Expression> stream()
        Streams the elements.
        Returns:
        the stream of elements
      • stream

        public <E extends ExpressionStream<Expression> stream​(Class<E> eClass)
        Streams the elements as the given type.
        Type Parameters:
        E - the expression type parameter
        Parameters:
        eClass - the expression class
        Returns:
        the stream of elements as the given type