List of usage examples for java.util LinkedList get
public E get(int index)
From source file:ch.zhaw.icclab.tnova.expressionsolver.OTFlyEval.java
String evalLT(LinkedList<Double> paramList, double threshold) { String result = "false"; if (paramList.get(0).doubleValue() < threshold) result = "true"; return result; }
From source file:net.sourceforge.jabm.view.JFrameReportVariables.java
@Override public Object getValueAt(int rowIndex, int columnIndex) { LinkedList<Object> variables = new LinkedList<Object>(); variables.addAll(variableBindings.keySet()); Object variable = variables.get(rowIndex); if (columnIndex == 0) { return variable.toString(); } else {//from w w w .java2 s . c o m return format.format(variableBindings.get(variable).doubleValue()); } }
From source file:universal.MMatrix.java
public void Scale(Coordinate x, Fraction d) { LinkedList<Fraction> row = matrix.get(x.row); for (int i = 0; i < numCols; i++) { row.set(i, row.get(i).multiply(d)); }//from w w w . ja v a 2 s .com }
From source file:org.kalypso.core.io.TokenWriter.java
/** * This function writes the csv file./* w w w .j a va 2 s. co m*/ */ public void write() throws IOException { /* The buffered writer. */ BufferedWriter bwr = null; try { /* Create the buffered reader. */ bwr = new BufferedWriter(new FileWriter(m_file)); for (int i = 0; i < m_allTokens.size(); i++) { final LinkedList<String> row = m_allTokens.get(i); for (int j = 0; j < row.size(); j++) { final String col = row.get(j); if (j < row.size() - 1) bwr.write(col + m_delim); else if (j == row.size() - 1) bwr.write(col); } /* End the line. */ bwr.write("\n"); //$NON-NLS-1$ } /* Close the writer. */ bwr.close(); } finally { /* Close the writer. */ IOUtils.closeQuietly(bwr); } }
From source file:core.Helpers.java
public String[] getApplicants() { String[] dataformats = { "asdp", "jpeg" }; LinkedList<File> j = (LinkedList<File>) FileUtils.listFiles(new File("applicants"), dataformats, false); String[] al = new String[j.size()]; for (int i = 0; i < j.size(); i++) { al[i] = (j.get(i).getName().toString().replace(".asdp", "")); }/*from w w w . j ava 2 s . c o m*/ return al; }
From source file:ch.zhaw.icclab.tnova.expressionsolver.OTFlyEval.java
String findSum(LinkedList<Double> paramList) { Double sum = new Double("0.0"); for (int i = 0; i < paramList.size(); i++) { sum += paramList.get(i); }/*w w w .j a v a 2s .c om*/ return sum.toString(); }
From source file:ch.zhaw.icclab.tnova.expressionsolver.OTFlyEval.java
String findAvg(LinkedList<Double> paramList) { Double sum = new Double("0.0"); for (int i = 0; i < paramList.size(); i++) { sum += paramList.get(i); }/*from ww w . ja v a2 s. co m*/ Double avg = sum / (new Double(paramList.size())); return avg.toString(); }
From source file:ch.zhaw.icclab.tnova.expressionsolver.OTFlyEval.java
String findMin(LinkedList<Double> paramList) { Double min = paramList.peekFirst(); for (int i = 0; i < paramList.size(); i++) { if (min > paramList.get(i)) min = paramList.get(i);//from w w w. j ava2 s . co m } return min.toString(); }
From source file:ch.zhaw.icclab.tnova.expressionsolver.OTFlyEval.java
String findMax(LinkedList<Double> paramList) { Double max = paramList.peekFirst(); for (int i = 0; i < paramList.size(); i++) { if (max < paramList.get(i)) max = paramList.get(i);/*from w ww . ja va 2 s .c om*/ } return max.toString(); }
From source file:org.chirpradio.mobile.Playing.java
public void updateCurrentlyPlaying(LinkedList<Track> tracks) { Track currentTrack = tracks.get(0); final String nowPlayingContent = "<font color=#FCFC77>NOW PLAYING</font> ·" + " <b>ON-AIR:</b> " + currentTrack.getDj() + "<br><br><hr>" + "<b>" + currentTrack.getArtist() + "</b>" + " - " + currentTrack.getTrack() + " <i>from " + currentTrack.getRelease() + " (" + currentTrack.getLabel() + ")" + "</i>"; nowPlayingTextView.setText(Html.fromHtml(nowPlayingContent)); String recentlyPlayedContent = "<font color=#FCFC77>RECENTLY PLAYED</font>" + "<br>"; for (int i = 1; i < tracks.size(); i++) { Track recentTrack = tracks.get(i); recentlyPlayedContent += "<b>" + recentTrack.getArtist() + "</b>" + " - " + recentTrack.getTrack() + " <i>from " + recentTrack.getRelease() + " (" + recentTrack.getLabel() + ")" + "</i>"; if (i < tracks.size() - 1) { recentlyPlayedContent += "<br><br><hr>"; }//from w w w .j av a 2 s.c o m } recentlyPlayedTextView.setText(Html.fromHtml(recentlyPlayedContent)); }