Enum Direction1D

    • Enum Constant Detail

      • SEGMENT_DIRECTION

        public static final Direction1D SEGMENT_DIRECTION
        Same direction as a Segment1D.
      • REVERTED_DIRECTION

        public static final Direction1D REVERTED_DIRECTION
        Reverted direction then a Segment1D.
    • Method Detail

      • values

        public static Direction1D[] 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 (Direction1D c : Direction1D.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Direction1D valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isSegmentDirection

        @Pure
        public boolean isSegmentDirection()
        Replies if the segment direction is allowed.
        Returns:
        true if the segment direction is allowed, otherwise false
      • isRevertedSegmentDirection

        @Pure
        public boolean isRevertedSegmentDirection()
        Replies if the reverted segment direction is allowed.
        Returns:
        true if the reverted segment direction is allowed, otherwise false
      • fromInteger

        @Pure
        public static Direction1D fromInteger​(int value)
        Replies the direction according to the given integer value.

        The value is mapped to SEGMENT_DIRECTION if positive. It is mapped to REVERSED_SEGMENT_DIRECTION if negative. And it is mapped to BOTH_DIRECTIONS if nul.

        Parameters:
        value - the value to convert.
        Returns:
        the direction which is corresponding to the given value.
      • toInteger

        @Pure
        public int toInteger()
        Replies integer value that is corresponding to the direction.

        The returned value is positive if SEGMENT_DIRECTION. It is negative if REVERSED_DIRECTION if negative. And it is zero if BOTH_DIRECTIONS.

        Returns:
        the direction which is corresponding to the given value.