Class RangeFactory


  • public class RangeFactory
    extends Object
    Helper factory class for creating Range objects in velocity
    • Field Detail

      • ALL

        public static final Range ALL
        The interval that matches the entire list it is applied to.
      • FIRST

        public static final Range FIRST
        The interval that matches just the first element of the list it is applied to.
      • LAST

        public static final Range LAST
        The interval that matches just the last element of the list it is applied to.
    • Constructor Detail

      • RangeFactory

        public RangeFactory()
    • Method Detail

      • createAllRange

        public static Range createAllRange()
        Creates a new Range which matches all the elements of the list it is applied to.
        Returns:
        A new Range instance
      • createHeadRange

        public static Range createHeadRange​(int size)
        Creates a new Range starting from 0 and having the specified size. It matches the first size elements of the list it is applied to.
        Parameters:
        size - The size of the interval
        Returns:
        A new Range instance
      • createTailRange

        public static Range createTailRange​(int size)
        Creates a new Range starting from the end of the list it is applied to and having the specified size. It matches the last size elements of the list.
        Parameters:
        size - The size of the interval
        Returns:
        A new Range instance
      • getALL

        public static Range getALL()
        Helper method for accessing ALL static field in velocity
      • getFIRST

        public static Range getFIRST()
        Helper method for accessing FIRST static field in velocity
      • getLAST

        public static Range getLAST()
        Helper method for accessing LAST static field in velocity