Commit d525fa7f authored by Poulet Camille's avatar Poulet Camille
Browse files

Solving error scanner.next

Compatibility between Linux and Windows on Java
parent c0d107ce
......@@ -381,21 +381,24 @@ public class RIOBasinNetworkWithContinent extends RIOBasinNetwork {
for (int i = 0; i < headers.length; i++)
System.out.println(" " + fields[i] + " \t<-> " + headers[i]);
while (scanner.hasNext()) {
basin_id = scanner.nextInt(); // gid
name = scanner.next();
function = scanner.next();
while (scanner.hasNextLine()) {
fields = scanner.nextLine().split(",");
basin_id = Integer.valueOf(fields[0]); // gid
name = fields[1];
function = fields[2];
//System.out.println(basin_id + " " + name);
OffshoreBasin offshorebasin = new OffshoreBasin(basin_id, name, OffshoreBasinFunction.valueOf(function));
if (mapOffshoreBasin != null) {
if (mapOffshoreBasin.containsKey(name.strip())) {
if (mapOffshoreBasin.containsKey(name.trim())) {
// offshorebasin.getShape().append(mapInshoreBasin.get(name), true);
offshorebasin.setShape(mapOffshoreBasin.get(name.strip()));
offshorebasin.setShape(mapOffshoreBasin.get(name.trim()));
} else {
System.out.println(name + "does not exist in " + offshoreBasinShpFile);
for (String nameMap : mapOffshoreBasin.keySet()) {
System.out.println(name.strip() + ":" + nameMap + "=" + name.strip().equals(nameMap));
System.out.println(name.trim() + ":" + nameMap + "=" + name.trim().equals(nameMap));
}
System.exit(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment