/**
  * Creates a new data row reader for sparse format. The attributes indices must not be set. If
  * they are, they are reassigned new values when this constructor is called!
  *
  * @param factory Factory used to create {@link DataRow} instances.
  * @param format One Out of FORMAT_XY, FORMAT_YX, FORMAT_PREFIX, and FORMAT_SEPARATE_FILE.
  * @param prefixMap Maps prefixes to special attribute names (e.g. "l" to
  *     "label").
  * @param attributeSet Set of regular and special attributes.
  * @param attributeReader Reader for the data
  * @param labelReader Reader for the labels. Only necessary if format is FORMAT_SEPARATE_FILE.
  * @param sampleSize sample size, may be -1 for no limit.
  * @param useQuotesForNominalValues Determines whether nominal values are surrounded by quotes or
  *     not. If <code>useQuotesForNominalValues == true</code> the first and last character of the
  *     nominal values are ignored.
  * @param quoteChar The char that is used to surround nominal values.
  */
 public SparseFormatDataRowReader(
     DataRowFactory factory,
     int format,
     Map<String, String> prefixMap,
     AttributeSet attributeSet,
     Reader attributeReader,
     Reader labelReader,
     int sampleSize,
     boolean useQuotesForNominalValues,
     char quoteChar) {
   super(factory);
   this.format = format;
   this.prefixMap = prefixMap;
   this.attributeSet = attributeSet;
   if (attributeSet == null) {
     throw new IllegalArgumentException("AttributeSet must not be null.");
   }
   this.dimension = attributeSet.getAllAttributes().size();
   this.maxNumber = sampleSize;
   this.inAttributes = new BufferedReader(attributeReader);
   if (format == FORMAT_SEPARATE_FILE) {
     if (labelReader == null)
       throw new IllegalArgumentException(
           "labelReader must not be null if format is 'separate_file'!");
     this.inLabels = new BufferedReader(labelReader);
   }
   if (format != FORMAT_NO_LABEL) {
     if (attributeSet.getSpecialAttribute("label") == null) {
       throw new IllegalArgumentException(
           "If format is not no_label, label attribute must be defined.");
     }
   }
   this.useQuotesForNominalValues = useQuotesForNominalValues;
   this.quoteChar = quoteChar;
 }