Class LineClassFileIterator<T>

java.lang.Object
org.snpeff.fileIterator.FileIterator<T>
org.snpeff.fileIterator.LineClassFileIterator<T>
All Implemented Interfaces:
Iterable<T>, Iterator<T>
Direct Known Subclasses:
BlastResultFileIterator, MatrixEntryFileIterator, MicroCosmFileIterator

public class LineClassFileIterator<T> extends FileIterator<T>
Iterate on each line. Create and populate objects based on 'fieldNames' definition: a colon separated list of fields. Note: You can use empty names to skip columns
Author:
pcingola
  • Field Details

    • debug

      public static boolean debug
    • FIELD_NAME_SEPARATOR

      public static final char FIELD_NAME_SEPARATOR
      See Also:
    • separator

      protected String separator
    • fieldStr

      protected String fieldStr
    • fieldNames

      protected String[] fieldNames
    • fieldByName

      protected HashMap<String,Field> fieldByName
    • clazz

      protected Class clazz
  • Constructor Details

    • LineClassFileIterator

      public LineClassFileIterator(String fileName, Class clazz)
    • LineClassFileIterator

      public LineClassFileIterator(String fileName, Class clazz, String fieldNames)
  • Method Details

    • createObject

      protected T createObject(String line)
      Create an object using
      Parameters:
      line -
      Returns:
    • fieldMap

      protected void fieldMap()
      Map field names to Field objects
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
      Overrides:
      iterator in class FileIterator<T>
    • readNext

      protected T readNext()
      Read a sequence from the file
      Specified by:
      readNext in class FileIterator<T>
      Returns:
    • setSeparator

      public void setSeparator(String separator)