Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sqayner committed Aug 23, 2023
1 parent 74183ef commit 4554399
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected ArrayList<Earthquake> call() throws Exception {
case USGS:
case EMSC:
charset = Charset.defaultCharset();
parser = new TextParser();
parser = new TextParser(source);
break;
case AFAD:
charset = StandardCharsets.UTF_8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
import tr.com.erenkaynar.library.earthquake.models.LatLong;

public class TextParser extends Parser {

private Source source;

public TextParser(Source source) {
this.source = source;
}

@Override
public ArrayList<Earthquake> parse(String data) {
ArrayList<Earthquake> earthquakes = new ArrayList<>();
Expand All @@ -27,7 +34,7 @@ public ArrayList<Earthquake> parse(String data) {
}

private Earthquake parseLine(String line) {
final Earthquake earthquake = new Earthquake(Source.USGS);
final Earthquake earthquake = new Earthquake(source);

String[] values = line.split("\\|");

Expand Down

0 comments on commit 4554399

Please sign in to comment.