Skip to content

Commit

Permalink
use parameterized constructor call
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Nov 20, 2024
1 parent cd5bf97 commit 4ae59be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
16 changes: 5 additions & 11 deletions src/main/java/org/tub/vsp/bvwp/users/kn/Figures1RailKN.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ Figure nkv_orig(){

Layout layout = Layout.builder( "" ).xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();

traces.addAll( getTraces( xName, y2Name, table, "null", "cyan" ) );
List<Trace> traces = new ArrayList<>(getTraces(xName, y2Name, table, "null", "cyan"));

Figure figure2 = new Figure( layout, traces.toArray(new Trace[0]) );
return figure2;
Expand All @@ -280,10 +278,8 @@ Figure invCost_orig(){

Layout layout = Layout.builder( "" ).xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();

final List<Trace> traceWb = getTraces( xName, y2Name, table, "null", "cyan" );
traces.addAll( traceWb );
final List<Trace> traceWb = getTraces( xName, y2Name, table, "null", "cyan" );
List<Trace> traces = new ArrayList<>(traceWb);

Figure figure2 = new Figure( layout, traces.toArray(new Trace[0]) );
return figure2;
Expand Down Expand Up @@ -332,10 +328,8 @@ Figure nkv_carbon700(){

Layout layout = Layout.builder( "" ).xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();

final List<Trace> traceWb = getTraces( xName, y2Name, table, "null", "cyan" );
traces.addAll( traceWb );
final List<Trace> traceWb = getTraces( xName, y2Name, table, "null", "cyan" );
List<Trace> traces = new ArrayList<>(traceWb);

Figure figure2 = new Figure( layout, traces.toArray(new Trace[0]) );
return figure2;
Expand Down
15 changes: 5 additions & 10 deletions src/main/java/org/tub/vsp/bvwp/users/kn/Figures2KN.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,7 @@ public Figure fzkmFromTtime_vs_fzkmOrig(){

Layout layout = Layout.builder().xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();
traces.addAll( getTracesByColor( table, xName, y2Name ) );
List<Trace> traces = new ArrayList<>(getTracesByColor(table, xName, y2Name));
traces.add( diagonalLine2( table, xName, y2Name ) );
return new Figure( layout, traces.toArray(new Trace[]{} ) );
}
Expand All @@ -484,8 +483,7 @@ public Figure fzkmEl03_vs_fzkmOrig(){

Layout layout = Layout.builder().xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();
traces.addAll( getTracesByColor( table, xName, y2Name ) );
List<Trace> traces = new ArrayList<>(getTracesByColor(table, xName, y2Name));
traces.add( diagonalLine2( table, xName, y2Name ) );
return new Figure( layout, traces.toArray(new Trace[]{} ) );
}
Expand All @@ -509,8 +507,7 @@ public Figure fzkmFromTtimeDelta_vs_fzkmOrig(){

Layout layout = Layout.builder().xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();
traces.addAll( getTracesByColor( table2, x2Name, y2Name ) );
List<Trace> traces = new ArrayList<>(getTracesByColor(table2, x2Name, y2Name));
return new Figure( layout, traces.toArray(new Trace[]{} ) );
}
public Figure fzkmFromEl03Delta_vs_fzkmOrig(){
Expand All @@ -533,8 +530,7 @@ public Figure fzkmFromEl03Delta_vs_fzkmOrig(){

Layout layout = Layout.builder().xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();
traces.addAll( getTracesByColor( table2, xName, y2Name ) );
List<Trace> traces = new ArrayList<>(getTracesByColor(table2, xName, y2Name));
return new Figure( layout, traces.toArray(new Trace[]{} ) );
}
public Figure fzkmFromTtimeSum_vs_fzkmOrig(){
Expand All @@ -552,8 +548,7 @@ public Figure fzkmFromTtimeSum_vs_fzkmOrig(){

Layout layout = Layout.builder().xAxis( xAxis ).yAxis( yAxis ).width( plotWidth ).build();

List<Trace> traces = new ArrayList<>();
traces.addAll( getTracesByColor( table, xName, y2Name ) );
List<Trace> traces = new ArrayList<>(getTracesByColor(table, xName, y2Name));
return new Figure( layout, traces.toArray(new Trace[]{} ) );
}
Figure investmentCost( int cap, String xName, String yName ){
Expand Down

0 comments on commit 4ae59be

Please sign in to comment.