<commit_before>/*
 * TimeSeries.java   Jul 14, 2004
 *
 * Copyright (c) 2004 <NAME>
 * <EMAIL>
 */

package com.fastdtw.timeseries;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.Vector;

import com.fastdtw.util.Arrays;


public class TimeSeries
{
   private static final int[] ZERO_ARRAY = new int[0];
   private static final boolean DEFAULT_IS_TIME_1ST_COL = true;
   private static final char DEFAULT_DELIMITER = ',';
   private static final boolean DEFAULT_IS_LABELED = true;


   public ArrayList<String> labels;   // labels for each column
   public ArrayList<Double> timeReadings;        // ArrayList of Double
   public ArrayList<TimeSeriesPoint> tsArray;    // ArrayList of TimeSeriesPoint.. no time

                                                                                     // TODO don't use defaults delimiter/1stColTime... determine if not specified

   // CONSTRUCTORS                                                                   // TODO method to peek at determined delimiter, 1st col time
   TimeSeries()
   {
      labels = new ArrayList<String>();                                                      // TODO isLabeled constuctor options?
      timeReadings = new ArrayList<Double>();
      tsArray = new ArrayList<TimeSeriesPoint>();
   }


   public TimeSeries(int numOfDimensions)                                               
   {
      this();
      labels.add("Time");
      for (int x=0; x<numOfDimensions; x++)                
         labels.add(""+x);
   }

   // Copy Constructor
   public TimeSeries(TimeSeries origTS)
   {
      labels = new ArrayList(origTS.labels);
      timeReadings = new ArrayList(origTS.timeReadings);
      tsArray = new ArrayList(origTS.tsArray);
   }


   public TimeSeries(String inputFile, boolean isFirstColTime)
   {
      this(inputFile, ZERO_ARRAY, isFirstColTime);
   }


   public TimeSeries(String inputFile, char delimiter)
   {
      this(inputFile, ZERO_ARRAY, DEFAULT_IS_TIME_1ST_COL, DEFAULT_IS_LABELED, delimiter);
   }


   public TimeSeries(String inputFile, boolean isFirstColTime, char delimiter)
   {
      this(inputFile, ZERO_ARRAY, isFirstColTime, DEFAULT_IS_LABELED, delimiter);
   }


   public TimeSeries(String inputFile, boolean isFirstColTime, boolean isLabeled, char delimiter)
   {
      this(inputFile, ZERO_ARRAY, isFirstColTime, isLabeled, delimiter);
   }
<commit_msg>add generic types to TimeSeries<commit_after>/*
 * TimeSeries.java   Jul 14, 2004
 *
 * Copyright (c) 2004 <NAME>
 * <EMAIL>
 */

package com.fastdtw.timeseries;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

import com.fastdtw.util.Arrays;


public class TimeSeries
{
   private static final int[] ZERO_ARRAY = new int[0];
   private static final boolean DEFAULT_IS_TIME_1ST_COL = true;
   private static final char DEFAULT_DELIMITER = ',';
   private static final boolean DEFAULT_IS_LABELED = true;


   public ArrayList<String> labels;   // labels for each column
   public ArrayList<Double> timeReadings;        // ArrayList of Double
   public ArrayList<TimeSeriesPoint> tsArray;    // ArrayList of TimeSeriesPoint.. no time

                                                                                     // TODO don't use defaults delimiter/1stColTime... determine if not specified

   // CONSTRUCTORS                                                                   // TODO method to peek at determined delimiter, 1st col time
   TimeSeries()
   {
      labels = new ArrayList<String>();                                                      // TODO isLabeled constuctor options?
      timeReadings = new ArrayList<Double>();
      tsArray = new ArrayList<TimeSeriesPoint>();
   }


   public TimeSeries(int numOfDimensions)                                               
   {
      this();
      labels.add("Time");
      for (int x=0; x<numOfDimensions; x++)                
         labels.add(""+x);
   }

   // Copy Constructor
   public TimeSeries(TimeSeries origTS)
   {
      labels = new ArrayList<String>(origTS.labels);
      timeReadings = new ArrayList<Double>(origTS.timeReadings);
      tsArray = new ArrayList<TimeSeriesPoint>(origTS.tsArray);
   }


   public TimeSeries(String inputFile, boolean isFirstColTime)
   {
      this(inputFile, ZERO_ARRAY, isFirstColTime);
   }


   public TimeSeries(String inputFile, char delimiter)
   {
      this(inputFile, ZERO_ARRAY, DEFAULT_IS_TIME_1ST_COL, DEFAULT_IS_LABELED, delimiter);
   }


   public TimeSeries(String inputFile, boolean isFirstColTime, char delimiter)
   {
      this(inputFile, ZERO_ARRAY, isFirstColTime, DEFAULT_IS_LABELED, delimiter);
   }


   public TimeSeries(String inputFile, boolean isFirstColTime, boolean isLabeled, char delimiter)
   {
      this(inputFile, ZERO_ARRAY, isFirstColTime, isLabeled, delimiter);
   }

{'fraction_non_alphanumeric': 0.08580669710806697, 'fraction_numerical': 0.0060882800608828, 'mean_word_length': 2.4472131147540983, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3309705', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1411, 'n_words': 372}