Enum Pipeline.Operator

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Pipeline.Operator>
    Enclosing interface:
    Pipeline

    public static enum Pipeline.Operator
    extends java.lang.Enum<Pipeline.Operator>
    Operators that connect commands in a pipeline.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AND
      Logical AND: execute next command only if previous succeeded (&&)
      APPEND
      Append redirection: append output to file (>>)
      COMBINED_REDIRECT
      Combined redirection: redirect both stdout and stderr to file (&>)
      FLIP
      Flip pipe: appends output as argument to next command (|;)
      HEREDOC
      Here-document: provide stdin inline (<<)
      INPUT_REDIRECT
      Input redirection: read stdin from file (<)
      OR
      Logical OR: execute next command only if previous failed (||)
      PIPE
      Standard pipe: sends output of left command to right command (|)
      REDIRECT
      Output redirection: write output to file (>)
      SEQUENCE
      Sequence: execute next command unconditionally (;)
      STDERR_REDIRECT
      Stderr redirection: redirect stderr to file (2>)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Pipeline.Operator fromSymbol​(java.lang.String symbol)
      Returns the operator matching the given symbol, or null if none matches.
      java.lang.String symbol()
      Returns the string symbol for this operator.
      static Pipeline.Operator valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Pipeline.Operator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • PIPE

        public static final Pipeline.Operator PIPE
        Standard pipe: sends output of left command to right command (|)
      • FLIP

        public static final Pipeline.Operator FLIP
        Flip pipe: appends output as argument to next command (|;)
      • AND

        public static final Pipeline.Operator AND
        Logical AND: execute next command only if previous succeeded (&&)
      • OR

        public static final Pipeline.Operator OR
        Logical OR: execute next command only if previous failed (||)
      • REDIRECT

        public static final Pipeline.Operator REDIRECT
        Output redirection: write output to file (>)
      • APPEND

        public static final Pipeline.Operator APPEND
        Append redirection: append output to file (>>)
      • INPUT_REDIRECT

        public static final Pipeline.Operator INPUT_REDIRECT
        Input redirection: read stdin from file (<)
      • HEREDOC

        public static final Pipeline.Operator HEREDOC
        Here-document: provide stdin inline (<<)
      • STDERR_REDIRECT

        public static final Pipeline.Operator STDERR_REDIRECT
        Stderr redirection: redirect stderr to file (2>)
      • COMBINED_REDIRECT

        public static final Pipeline.Operator COMBINED_REDIRECT
        Combined redirection: redirect both stdout and stderr to file (&>)
      • SEQUENCE

        public static final Pipeline.Operator SEQUENCE
        Sequence: execute next command unconditionally (;)
    • Method Detail

      • values

        public static Pipeline.Operator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Pipeline.Operator c : Pipeline.Operator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Pipeline.Operator valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • symbol

        public java.lang.String symbol()
        Returns the string symbol for this operator.
        Returns:
        the operator symbol
      • fromSymbol

        public static Pipeline.Operator fromSymbol​(java.lang.String symbol)
        Returns the operator matching the given symbol, or null if none matches.
        Parameters:
        symbol - the symbol to look up
        Returns:
        the matching operator, or null