Class TokenSequences


  • public class TokenSequences
    extends Object
    Utilities for working with arrays of tokens.
    • Method Detail

      • binaryList

        public static MutableBinaryTokenSequence binaryList​(int capacity,
                                                            DataRepresentation representation)
        Creates a MutableBinaryTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • charList

        public static MutableCharTokenSequence charList​(int capacity,
                                                        DataRepresentation representation)
        Creates a MutableCharTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • dateList

        public static MutableDateTokenSequence dateList​(int capacity,
                                                        DataRepresentation representation)
        Creates a MutableDateTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • doubleList

        public static MutableDoubleTokenSequence doubleList​(int capacity,
                                                            DataRepresentation representation)
        Creates a MutableDoubleTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • floatList

        public static MutableFloatTokenSequence floatList​(int capacity,
                                                          DataRepresentation representation)
        Creates a MutableFloatTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • intList

        public static MutableIntTokenSequence intList​(int capacity,
                                                      DataRepresentation representation)
        Creates a MutableIntTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • longList

        public static MutableLongTokenSequence longList​(int capacity,
                                                        DataRepresentation representation)
        Creates a MutableLongTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • moneyList

        public static MutableMoneyTokenSequence moneyList​(int capacity,
                                                          DataRepresentation representation)
        Creates a MutableMoneyTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • objectList

        public static <O> MutableObjectTokenSequence<O> objectList​(ObjectTokenType<O> type,
                                                                   int capacity,
                                                                   DataRepresentation representation)
        Creates a MutableObjectTokenSequence with the specified capacity, optionally optimized for sparse data.
        Type Parameters:
        O - the type of the elements of the sequence
        Parameters:
        type - the object type
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • periodList

        public static MutablePeriodTokenSequence periodList​(int capacity,
                                                            DataRepresentation representation)
        Creates a MutablePeriodTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • stringList

        public static MutableStringTokenSequence stringList​(int capacity,
                                                            DataRepresentation representation)
        Creates a MutableStringTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • timeList

        public static MutableTimeTokenSequence timeList​(int capacity,
                                                        DataRepresentation representation)
        Creates a MutableTimeTokenSequence with the specified capacity, optionally optimized for sparse data.
        Parameters:
        capacity - the initial capacity
        representation - the data representation
        Returns:
        the newly created token sequence.
      • allocateList

        public static MutableTokenSequence allocateList​(TokenType type,
                                                        int initialCapacity)
        Creates a MutableTokenSequence for tokens of the specified type.
        Parameters:
        type - the data type of tokens in the array
        initialCapacity - the initial capacity of the array
        Returns:
        a TokenArray of the appropriate type
      • allocateList

        public static MutableScalarTokenSequence allocateList​(ScalarTokenType type,
                                                              int initialCapacity)
        Creates a MutableTokenSequence for tokens of the specified scalar type.
        Parameters:
        type - the data type of tokens in the array
        initialCapacity - the initial capacity of the array
        Returns:
        a TokenArray of the appropriate type
      • allocateList

        public static MutableTokenSequence allocateList​(TokenType type,
                                                        int initialCapacity,
                                                        DataRepresentation representation)
        Creates a MutableTokenSequence for tokens of the specified type.
        Parameters:
        type - the data type of tokens in the array
        initialCapacity - the initial capacity of the array
        representation - the data representation
        Returns:
        a TokenArray of the appropriate type
      • allocateList

        public static MutableScalarTokenSequence allocateList​(ScalarTokenType type,
                                                              int initialCapacity,
                                                              DataRepresentation representation)
        Creates a MutableTokenSequence for tokens of the specified scalar type.
        Parameters:
        type - the data type of tokens in the array
        initialCapacity - the initial capacity of the array
        representation - the data representation
        Returns:
        a TokenArray of the appropriate type