MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / readFirstLine

Method readFirstLine

src/org/opensourcephysics/tools/DataTool.java:1459–1482  ·  view source on GitHub ↗
(Reader in)

Source from the content-addressed store, hash-verified

1457
1458 // ______________________________ protected methods ________________________
1459 protected String readFirstLine(Reader in) {
1460 BufferedReader input = null;
1461 if (in instanceof BufferedReader) {
1462 input = (BufferedReader) in;
1463 } else {
1464 input = new BufferedReader(in);
1465 }
1466 String openingLine;
1467 try {
1468 openingLine = input.readLine();
1469 while ((openingLine == null) || openingLine.equals("")) { //$NON-NLS-1$
1470 openingLine = input.readLine();
1471 }
1472 } catch (IOException e) {
1473 e.printStackTrace();
1474 return null;
1475 }
1476 try {
1477 input.close();
1478 } catch (IOException ex) {
1479 ex.printStackTrace();
1480 }
1481 return openingLine;
1482 }
1483
1484 protected void setupDelimiterMenu(JMenu menu) {
1485 Action setDelimiterAction = new AbstractAction() {

Callers 2

openMethod · 0.95
importFileIntoTabMethod · 0.95

Calls 2

equalsMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected