<commit_before>/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.9
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.opensim.modeling;

public class ArrayDouble {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public ArrayDouble(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(ArrayDouble obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        opensimModelJNI.delete_ArrayDouble(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

	public void fromString(String string) {
      // Remove open and close parenth if any
      String workString= new String(string);
      int liveStart = workString.indexOf("(");
      int liveEnd = workString.indexOf(")");
      if (liveStart!=-1 && liveEnd!=-1){
          workString = workString.substring(liveStart+1, liveEnd);
      }
      else if (liveStart!=liveEnd){
          //throw new ParseException("Illegal format: Expect space separated values, optionally between matched parentheses", liveEnd);
          return;
      }
      String[] splits = workString.split(" |\t");
      double[] values = new double[splits.length];
      for(int i=0; i<splits.length; i++){
           values[i]=Double.parseDouble(splits[i]);
       }
       this.setValues(values, splits.length);
	}

  public ArrayDouble(double aDefaultValue, int aSize, int aCapacity) {
    this(opensimModelJNI.new_ArrayDouble__SWIG_0(aDefaultValue, aSize, aCapacity), true);
  }

  public ArrayDouble(double aDefaultValue, int aSize) {
    this(opensimModelJNI.new_ArrayDouble__SWIG_1(aDefaultValue, aSize), true);
  }

  public ArrayDouble(double aDefaultValue) {
    this(opensimModelJNI.new_ArrayDouble__SWIG_2(aDefaultValue), true);
  }<commit_msg>GUI: Make parsing of ArrayDouble more robust by handling tabs as well as spaces for arrays. Came up during parsing Collada exported files during the workshop<commit_after>/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.9
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.opensim.modeling;

public class ArrayDouble {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public ArrayDouble(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(ArrayDouble obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        opensimModelJNI.delete_ArrayDouble(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

	public void fromString(String string) {
      // Remove open and close parenth if any
      String workString= new String(string);
      int liveStart = workString.indexOf("(");
      int liveEnd = workString.indexOf(")");
      if (liveStart!=-1 && liveEnd!=-1){
          workString = workString.substring(liveStart+1, liveEnd);
      }
      else if (liveStart!=liveEnd){
          //throw new ParseException("Illegal format: Expect space separated values, optionally between matched parentheses", liveEnd);
          return;
      }
      String[] splits = workString.split(" ");
      double[] values = new double[splits.length];
      for(int i=0; i<splits.length; i++){
           values[i]=Double.parseDouble(splits[i]);
       }
       this.setValues(values, splits.length);
	}

  public ArrayDouble(double aDefaultValue, int aSize, int aCapacity) {
    this(opensimModelJNI.new_ArrayDouble__SWIG_0(aDefaultValue, aSize, aCapacity), true);
  }

  public ArrayDouble(double aDefaultValue, int aSize) {
    this(opensimModelJNI.new_ArrayDouble__SWIG_1(aDefaultValue, aSize), true);
  }

  public ArrayDouble(double aDefaultValue) {
    this(opensimModelJNI.new_ArrayDouble__SWIG_2(aDefaultValue), true);
  }
{'fraction_non_alphanumeric': 0.1672903367818622, 'fraction_numerical': 0.00572309046885318, 'mean_word_length': 2.4953846153846153, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3018483', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1311, 'n_words': 346}