test_class.file: BackEnd/Core/sailfish-core/src/test/java/com/exactpro/sf/aml/iomatrix/CSVMatrixReaderTest.java
test_class.identifier: CSVMatrixReaderTest
test_case.body: @Test
      public void testRead() {
          try (CSVMatrixReader e = new CSVMatrixReader("src/test/resources/aml/iomatrix/testcsv.csv")) {
              StringBuilder sb = new StringBuilder();
              while (e.hasNext()) {
                  for (SimpleCell sc : e.readCells()) {
                      sb.append(sc.getValue());
                  }
              }
              if (sb.length() == 0) {
                  fail("File not readed");
              }
          } catch (Exception ex) {
              fail(ex.getMessage());
          }
      }
test_case.class_method_signature: CSVMatrixReaderTest.testRead()
test_case.full_signature: @Test public void testRead()
test_case.identifier: testRead
test_case.invocations: hasNext readCells append getValue length fail fail getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRead()
focal_class.declarator: reader
focal_class.modifier: private final
focal_class.original_string: private final CsvReader reader;
focal_class.type: CsvReader
focal_class.var_name: reader
focal_class.declarator: hasNext
focal_class.modifier: private
focal_class.original_string: private boolean hasNext;
focal_class.type: boolean
focal_class.var_name: hasNext
focal_class.declarator: lineNumber
focal_class.modifier: private
focal_class.original_string: private int lineNumber;
focal_class.type: int
focal_class.var_name: lineNumber
focal_class.file: BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/aml/iomatrix/CSVMatrixReader.java
focal_class.identifier: CSVMatrixReader
focal_class.interfaces: implements IMatrixReader
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(String fileName)
focal_class.full_signature: public  CSVMatrixReader(String fileName)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (String fileName)
focal_class.signature:  CSVMatrixReader(String fileName)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(String fileName, char delimiter)
focal_class.full_signature: public  CSVMatrixReader(String fileName, char delimiter)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (String fileName, char delimiter)
focal_class.signature:  CSVMatrixReader(String fileName, char delimiter)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(String fileName, String encoding)
focal_class.full_signature: public  CSVMatrixReader(String fileName, String encoding)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (String fileName, String encoding)
focal_class.signature:  CSVMatrixReader(String fileName, String encoding)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(String fileName, char delimiter, String encoding)
focal_class.full_signature: public  CSVMatrixReader(String fileName, char delimiter, String encoding)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (String fileName, char delimiter, String encoding)
focal_class.signature:  CSVMatrixReader(String fileName, char delimiter, String encoding)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(InputStream inputStream)
focal_class.full_signature: public  CSVMatrixReader(InputStream inputStream)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (InputStream inputStream)
focal_class.signature:  CSVMatrixReader(InputStream inputStream)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(InputStream inputStream, String encoding)
focal_class.full_signature: public  CSVMatrixReader(InputStream inputStream, String encoding)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (InputStream inputStream, String encoding)
focal_class.signature:  CSVMatrixReader(InputStream inputStream, String encoding)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(InputStream inputStream, char delimiter)
focal_class.full_signature: public  CSVMatrixReader(InputStream inputStream, char delimiter)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (InputStream inputStream, char delimiter)
focal_class.signature:  CSVMatrixReader(InputStream inputStream, char delimiter)
focal_class.class_method_signature: CSVMatrixReader.CSVMatrixReader(InputStream inputStream, char delimiter, String encoding)
focal_class.full_signature: public  CSVMatrixReader(InputStream inputStream, char delimiter, String encoding)
focal_class.identifier: CSVMatrixReader
focal_class.modifiers: public
focal_class.parameters: (InputStream inputStream, char delimiter, String encoding)
focal_class.signature:  CSVMatrixReader(InputStream inputStream, char delimiter, String encoding)
focal_class.class_method_signature: CSVMatrixReader.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: CSVMatrixReader.readCells()
focal_class.full_signature: @Override public SimpleCell[] readCells()
focal_class.identifier: readCells
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SimpleCell[]
focal_class.signature: SimpleCell[] readCells()
focal_class.class_method_signature: CSVMatrixReader.read()
focal_class.full_signature: @Override public String[] read()
focal_class.identifier: read
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] read()
focal_class.class_method_signature: CSVMatrixReader.readRecord()
focal_class.full_signature: private void readRecord()
focal_class.identifier: readRecord
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void readRecord()
focal_class.class_method_signature: CSVMatrixReader.hasNext()
focal_class.full_signature: @Override public boolean hasNext()
focal_class.identifier: hasNext
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasNext()
focal_class.class_method_signature: CSVMatrixReader.determineCSVDelimiter(InputStream is, boolean needClose)
focal_class.full_signature: public static char determineCSVDelimiter(InputStream is, boolean needClose)
focal_class.identifier: determineCSVDelimiter
focal_class.modifiers: public static
focal_class.parameters: (InputStream is, boolean needClose)
focal_class.return: char
focal_class.signature: char determineCSVDelimiter(InputStream is, boolean needClose)
focal_class.class_method_signature: CSVMatrixReader.determineCSVDelimiter(byte[] bytes, int size)
focal_class.full_signature: public static CSVDelimiter determineCSVDelimiter(byte[] bytes, int size)
focal_class.identifier: determineCSVDelimiter
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int size)
focal_class.return: CSVDelimiter
focal_class.signature: CSVDelimiter determineCSVDelimiter(byte[] bytes, int size)
focal_class.class_method_signature: CSVMatrixReader.wrappedStream(InputStream in)
focal_class.full_signature: private static InputStream wrappedStream(InputStream in)
focal_class.identifier: wrappedStream
focal_class.modifiers: private static
focal_class.parameters: (InputStream in)
focal_class.return: InputStream
focal_class.signature: InputStream wrappedStream(InputStream in)
focal_method.body: @Override
      public String[] read() throws IOException, NoSuchElementException {
  
          if (!hasNext()) {
              throw new NoSuchElementException();
          }
          
          String[] values = reader.getValues();
          readRecord();
  
          lineNumber++;
  
          // drop all values after last non-empty cell
          // otherwise a lot of empty (but styled) cells will be returned
          int lastNonEmptyCellIdx = ArrayUtils.INDEX_NOT_FOUND;
  
          for (int i = values.length - 1; i >= 0; i--) {
              if (StringUtils.isNotBlank(values[i])) {
                  lastNonEmptyCellIdx = i;
                  break;
              }
          }
  
          if(lastNonEmptyCellIdx == ArrayUtils.INDEX_NOT_FOUND) {
              return ArrayUtils.EMPTY_STRING_ARRAY;
          }
  
          if(values.length != lastNonEmptyCellIdx + 1) {
              values = Arrays.copyOf(values, lastNonEmptyCellIdx + 1);
          }
  
          for (int i=0; i<values.length; i++) {
              values[i] = values[i].trim();
          }
  
          return values;
      }
focal_method.class_method_signature: CSVMatrixReader.read()
focal_method.full_signature: @Override public String[] read()
focal_method.identifier: read
focal_method.invocations: hasNext getValues readRecord isNotBlank copyOf trim
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: String[]
focal_method.signature: String[] read()