DSSAT TFile Data input method for Controller using

@param brMap The holder for BufferReader objects for all files
@return result data holder object
@throws java.io.IOException
960939
@Override
    protected HashMap readFile(HashMap brMap) throws IOException {

        HashMap ret = new HashMap();
        ArrayList<HashMap> expArr = new ArrayList<HashMap>();
        HashMap<String, HashMap> files = readObvData(brMap);
//        compressData(file);
        ArrayList<HashMap> obvData;
        HashMap obv;
        HashMap expData;

        for (String exname : files.keySet()) {
            obvData = (ArrayList) files.get(exname).get(obvDataKey);
            for (HashMap obvSub : obvData) {
                expData = new HashMap();
                obv = new HashMap();
                copyItem(expData, files.get(exname), "exname");
                copyItem(expData, files.get(exname), "crid");
                copyItem(expData, files.get(exname), "local_name");
                expData.put(jsonKey, obv);
                obv.put(obvFileKey, obvSub.get(obvDataKey));
                expArr.add(expData);
            }
        }

        // remove index variables
        ArrayList idNames = new ArrayList();
        idNames.add("trno_t");
        removeIndex(expArr, idNames);
        ret.put("experiments", expArr);

        return ret;
    }
86163
protected void remapData(int[][] mapping) throws IOException {
    if (!closed) {
      // remap and merge keys
      String[] newKeyList = new String[mapping.length];
      // process mapping for functions?
      HashMap<MtasDataCollector<?, ?>, MtasDataCollector<?, ?>> map = new HashMap<>();
      int[] newSourceNumberList = new int[mapping.length];
      int[] newErrorNumber = new int[mapping.length];
      @SuppressWarnings("unchecked")
      HashMap<String, Integer>[] newErrorList = (HashMap<String, Integer>[]) new HashMap<?, ?>[mapping.length];
      for (int i = 0; i < mapping.length; i++) {
        newKeyList[i] = keyList[mapping[i][0]];
        newSourceNumberList[i] = sourceNumberList[mapping[i][0]];
        for (int j = 0; j < mapping[i].length; j++) {
          if (j == 0) {
            newErrorNumber[i] = errorNumber[mapping[i][j]];
            newErrorList[i] = errorList[mapping[i][j]];
          } else {
            newErrorNumber[i] += errorNumber[mapping[i][j]];
            for (Entry<String, Integer> entry : errorList[mapping[i][j]]
                .entrySet()) {
              if (newErrorList[i].containsKey(entry.getKey())) {
                newErrorList[i].put(entry.getKey(),
                    newErrorList[i].get(entry.getKey()) + entry.getValue());
              } else {
                newErrorList[i].put(entry.getKey(), entry.getValue());
              }
            }
          }
        }
      }
      if (hasSub) {
        newSubCollectorListNextLevel = new MtasDataCollector<?, ?>[mapping.length];
        for (int i = 0; i < mapping.length; i++) {
          for (int j = 0; j < mapping[i].length; j++) {
            if (j == 0 || newSubCollectorListNextLevel[i] == null) {
              newSubCollectorListNextLevel[i] = subCollectorListNextLevel[mapping[i][j]];
            } else {
              newSubCollectorListNextLevel[i]
                  .merge(subCollectorListNextLevel[mapping[i][j]], map, false);
            }
          }
        }
        subCollectorListNextLevel = newSubCollectorListNextLevel;
      }
      keyList = newKeyList;
      sourceNumberList = newSourceNumberList;
      errorNumber = newErrorNumber;
      errorList = newErrorList;
      size = keyList.length;
      position = 0;
    } else {
      throw new IOException("already closed");
    }
  }
356576
public Map<Object,Object> readMap() throws IOException {
        if (_parser.isExpectedStartObjectToken()) {
            return AnyReader.std.readFromObject(this, _parser, _mapBuilder);
        }
        if (_parser.hasToken(JsonToken.VALUE_NULL)) {
            return null;
        }
        throw JSONObjectException.from(_parser,
                "Can not read a Map: expect to see START_OBJECT ('{'), instead got: "+ValueReader._tokenDesc(_parser));
    }
144261
@Override
    public MapReadResult readMapData(Tile tile) {
        return readMapData(tile, tile, Selector.ALL);
    }
793030
public static Map formatMap(Map conditionMap) {
        Map formattedMap = new HashMap();
        formattedMap.putAll(conditionMap);
        forSpecialValue(formattedMap);
        return formattedMap;
    }
1164011
HashMap readFormat0() throws IOException {
        HashMap h = new HashMap();
        rf.skipBytes(4);
        for (int k = 0; k < 256; ++k) {
            int r[] = new int[2];
            r[0] = rf.readUnsignedByte();
            r[1] = getGlyphWidth(r[0]);
            h.put(Integer.valueOf(k), r);
        }
        return h;
    }
156549
public static void writeMapFile (BufferedWriter bout, HashMap<String, Integer> map)
        throws IOException
    {
        String[] lines = new String[map.size()];
        Iterator<String> iter = map.keySet().iterator();
        for (int ii = 0; iter.hasNext(); ii++) {
            String key = iter.next();
            Integer value = map.get(key);
            lines[ii] = key + SEP_STR + value;
        }
        QuickSort.sort(lines);
        for (String line : lines) {
            bout.write(line, 0, line.length());
            bout.newLine();
        }
        bout.flush();
    }
836145
protected <T> T parse(JsonReaderI<T> mapper) throws ParseException {
		this.pos = -1;
		T result;
		try {
			read();
			result = readFirst(mapper);
			if (checkTaillingData) {
				if (!checkTaillingSpace)
					skipSpace();
				if (c != EOI)
					throw new ParseException(pos - 1, ERROR_UNEXPECTED_TOKEN, c);
			}
		} catch (IOException e) {
			throw new ParseException(pos, e);
		}
		xs = null;
		xo = null;
		return result;
	}
605221
public void write(LineMap lineMap)
    throws IOException
  {
    _os.println("SMAP");
    _os.println(lineMap.getDestFilename());
    _os.println(_sourceType);
    _os.println("*S " + _sourceType);

    IntMap fileMap = new IntMap();

    _os.println("*F");
    Iterator<LineMap.Line> iter = lineMap.iterator();
    while (iter.hasNext()) {
      LineMap.Line line = iter.next();

      String filename = line.getSourceFilename();
      int index = fileMap.get(filename);
      if (index < 0) {
        index = fileMap.size() + 1;
        fileMap.put(filename, index);

        if (filename.indexOf('/') >= 0) {
          int p = filename.lastIndexOf('/');

          _os.println("+ " + index + " " + filename.substring(p + 1));
          // XXX: _os.println(filename);

          if (filename.startsWith("/"))
            _os.println(filename.substring(1));
          else
            _os.println(filename);
        }
        else
          _os.println(index + " " + filename);
      }
    }
    
    _os.println("*L");
    int size = lineMap.size();
    int lastIndex = 0;
    for (int i = 0; i < size; i++) {
      LineMap.Line line = lineMap.get(i);

      String filename = line.getSourceFilename();
      int index = fileMap.get(filename);

      String fileMarker = "";

      _os.print(line.getSourceLine());
      _os.print("#" + index);

      if (line.getRepeatCount() > 1)
        _os.print("," + line.getRepeatCount());

      _os.print(":");
      _os.print(line.getDestinationLine());
      if (line.getDestinationIncrement() > 1)
        _os.print("," + line.getDestinationIncrement());
      _os.println();
    }
    
    _os.println("*E");
  }
342717
public void indexDocument(HashMap<String,Object>indexMap) throws Exception {
		SolrInputDocument solrDoc=this.buildSolrDocument(indexMap);
		String docXML=this.convertSolrDocInXML(solrDoc);
		String xml = "<add>" + docXML + "</add>";
		DirectXmlRequest xmlreq = new DirectXmlRequest("/update", xml);
		server.request(xmlreq);
	}
1266123
public <B> Reader<B> map(final Function<? super T, ? extends B> mapper) {
		requireNonNull(mapper);

		return new Reader<B>(_name, _type) {
			@Override
			public B read(final XMLStreamReader xml)
				throws XMLStreamException
			{
				try {
					return mapper.apply(Reader.this.read(xml));
				} catch (RuntimeException e) {
					throw new XMLStreamException(e);
				}
			}
		};
	}
546233
public static void readAbbrList(String dataFile, Map map) throws IOException {
		BufferedReader fin = new BufferedReader(new FileReader(dataFile));
		
		String line;
		while ((line = fin.readLine()) != null) {
		    StringTokenizer strTok = new StringTokenizer(line, " \t\r\n");
		    
		    if (strTok.countTokens() <= 0) {
			continue;
		    } 
		    
		    String token = strTok.nextToken();
		    
		    map.put(token.toLowerCase(), token.toLowerCase());
		}
    }
1273368
private void chooseSampleSqlAndConf(BufferedReader br) throws IOException {
        while (true) {
            printInstruction("Which sample SQL schema would you like to use?");
            for (int i = 0; i < getSqlConfInfos().size(); i++) {
                System.out.println(" " + (i + 1) + ") " + getSqlConfInfos().get(i).getName());
                System.out.println("    " + getSqlConfInfos().get(i).getDescription());
                if (getSqlConfInfos().get(i).getDescription2() != null) {
                    System.out.println("    " + getSqlConfInfos().get(i).getDescription2());
                }
                System.out.println("");
            }

            String choice = br.readLine();
            if (isBlank(choice)) {
                continue;
            } else {
                try {
                    sqlConfName = getSqlConfInfos().get(Integer.parseInt(choice) - 1).getName();
                    System.out.println("OK, using: " + sqlConfName);
                } catch (Exception e) {
                    System.out.println("");
                    continue;
                }
            }
            break;
        }
    }
1035550
public static void readMapFile (BufferedReader bin, HashMap<String, Integer> map)
        throws IOException
    {
        String line;
        while ((line = bin.readLine()) != null) {
            int eidx = line.indexOf(SEP_STR);
            if (eidx == -1) {
                throw new IOException("Malformed line, no '" + SEP_STR +
                                      "': '" + line + "'");
            }
            try {
                String code = line.substring(eidx+SEP_STR.length());
                map.put(line.substring(0, eidx), Integer.valueOf(code));
            } catch (NumberFormatException nfe) {
                String errmsg = "Malformed line, invalid code: '" + line + "'";
                throw new IOException(errmsg);
            }
        }
    }
440702
@Override
  protected void remapData(int[][] mapping) throws IOException {
    super.remapData(mapping);
    T1[][] originalFullValueList = fullValueList.clone();
    fullValueList = operations.createMatrix1(mapping.length);
    for (int i = 0; i < mapping.length; i++) {
      for (int j = 0; j < mapping[i].length; j++) {
        if (j == 0) {
          setValue(i, originalFullValueList[mapping[i][j]],
              originalFullValueList[mapping[i][j]].length, false);
        } else {
          setValue(i, originalFullValueList[mapping[i][j]],
              originalFullValueList[mapping[i][j]].length, true);
        }
      }
    }
    fullValueList = newFullValueList;
  }
788356
@Override public ProjectFile read(String accessDatabaseFileName) throws MPXJException
   {
      try
      {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         String url = "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=" + accessDatabaseFileName;
         m_connection = DriverManager.getConnection(url);
         m_projectID = Integer.valueOf(1);
         return (read());
      }

      catch (ClassNotFoundException ex)
      {
         throw new MPXJException("Failed to load JDBC driver", ex);
      }

      catch (SQLException ex)
      {
         throw new MPXJException("Failed to create connection", ex);
      }

      finally
      {
         if (m_connection != null)
         {
            try
            {
               m_connection.close();
            }

            catch (SQLException ex)
            {
               // silently ignore exceptions when closing connection
            }
         }
      }
   }
127729
static String readMapping(String root, String index) throws IOException {
		if (root == null) {
			return readMapping(index);
		}
		String mappingFile = root + "/" + index + "/_doc" + Defaults.JsonFileExtension;
		return readFileFromClasspath(mappingFile);
	}