Enum TwoDimensional.Bias

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

    public static enum TwoDimensional.Bias
    extends java.lang.Enum<TwoDimensional.Bias>
    Determines whether to add 1 when the end of an inner list is reached

    For example, given the following two dimensional object (a list of lists of objects) where the inner lists values show the absolute index of that specific item within the outer list...

    
     [                 // outer list
          [0, 1, 2, 3],   // inner list 1
          [4, 5, 6]       // inner list 2
     ]                 // outer list
     
    ...navigating to listOfListsObject.offsetTo(3, BACKWARD) will return 3 whereas listOfListsObject.offsetTo(3, FORWARD) will return 4, the "next item" in the two dimensional object. The Bias does not apply if the index is any non-last-index in the inner list. Thus, listOfListsObject.offsetTo(1, BACKWARD) and listOfListsObject.offsetTo(1, FORWARD) will return the same value, 1, since the position is not at the end of the list.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Backward
      When the returned value would be equal to the last index in an "inner list" or the length of some object with length, returns the value unmodified.
      Forward
      When the returned value would be equal to the last index in an "inner list" or the length of some object with length, returns the value + 1.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static TwoDimensional.Bias valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TwoDimensional.Bias[] 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

      • Forward

        public static final TwoDimensional.Bias Forward
        When the returned value would be equal to the last index in an "inner list" or the length of some object with length, returns the value + 1. See TwoDimensional.Bias for more clarification.
      • Backward

        public static final TwoDimensional.Bias Backward
        When the returned value would be equal to the last index in an "inner list" or the length of some object with length, returns the value unmodified. See TwoDimensional.Bias for more clarification.
    • Method Detail

      • values

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

        public static TwoDimensional.Bias 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