Class HSSF


  • public class HSSF
    extends Object
    File for HSSF testing/examples THIS IS NOT THE MAIN HSSF FILE!! This is a util for testing functionality. It does contain sample API usage that may be educational to regular API users.
    Author:
    Andrew Oliver (acoliver at apache dot org)
    See Also:
    main(java.lang.String[])
    • Constructor Summary

      Constructors 
      Constructor Description
      HSSF​(String filename)
      Constructor HSSF - creates an HSSFStream from an InputStream.
      HSSF​(String filename, boolean write)
      Constructor HSSF - given a filename this outputs a sample sheet with just a set of rows/cells.
      HSSF​(String infile, String outfile, boolean write)
      Constructor HSSF - takes in file - attempts to read it then reconstruct it
    • Constructor Detail

      • HSSF

        public HSSF​(String filename)
             throws IOException
        Constructor HSSF - creates an HSSFStream from an InputStream. The HSSFStream reads in the records allowing modification.
        Parameters:
        filename -
        Throws:
        IOException
      • HSSF

        public HSSF​(String filename,
                    boolean write)
             throws IOException
        Constructor HSSF - given a filename this outputs a sample sheet with just a set of rows/cells.
        Parameters:
        filename -
        write -
        Throws:
        IOException
      • HSSF

        public HSSF​(String infile,
                    String outfile,
                    boolean write)
             throws IOException
        Constructor HSSF - takes in file - attempts to read it then reconstruct it
        Parameters:
        infile -
        outfile -
        write -
        Throws:
        IOException
    • Method Detail

      • main

        public static void main​(String[] args)
        Method main Given 1 argument takes that as the filename, inputs it and dumps the cell values/types out to sys.out given 2 arguments where the second argument is the word "write" and the first is the filename - writes out a sample (test) spreadsheet (see public HSSF(String filename, boolean write)). given 2 arguments where the first is an input filename and the second an output filename (not write), attempts to fully read in the spreadsheet and fully write it out. given 3 arguments where the first is an input filename and the second an output filename (not write) and the third is "modify1", attempts to read in the spreadsheet, deletes rows 0-24, 74-99. Changes cell at row 39, col 3 to "MODIFIED CELL" then writes it out. Hence this is "modify test 1". If you take the output from the write test, you'll have a valid scenario.
        Parameters:
        args -