Documentation of 'jhplot.io.CFBook' Java class.
CFBook
jhplot.io

Class CFBook



  • public class CFBook
    extends java.lang.Object
    This class is used to book histograms for writing and reading using XML. It can read any input with histograms defined by an external XML file. In particular, it can read histogram files in the form of XML generated by Fortran or C++ external programs. To create a file with histograms from C++ or Fortran, use CFBook library. You will need gcc or gfortran to compile it. See CFBook web page
    See Also:
    CFBook library web page.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CFBook()
      Initialize CFBook class.
      CFBook(java.lang.String description)
      Initialize CFBook.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(int id, H1D h1d)
      add H1D histogram to CFBook
      void add(int id, H2D h2d)
      add H2D histogram to CFBook
      void add(int id, P1D p1d)
      add P1D histogram to CFBook
      void clear()
      Remove all objects from the CFBook
      H1D[] getAllH1D()
      Get array with all H1D histograms.
      H2D[] getAllH2D()
      Get array with all H2D histograms.
      P1D[] getAllP1D()
      Get array with all P1D containers.
      H1D getH1D(int id)
      Get H1D histogram from the index (key)
      H2D getH2D(int id)
      Get H2D histogram from the index (key) ID
      int[] getKeysH1D()
      Get keys of all known H1D histograms.
      int[] getKeysH2D()
      Get keys of all known H2D histograms.
      int[] getKeysP1D()
      Get keys of all known P1D containers.
      P1D getP1D(int id)
      Get P1D object from the index (key)
      java.lang.String listAll()
      List all objects inside CFBook
      java.lang.String listH1D()
      List all known H1D histograms.
      java.lang.String listH2D()
      List all known H1D histograms.
      java.lang.String listP1D()
      List all known P1D objects.
      void read(java.lang.String file)
      Read external XML file with all objects (H1D, H2D, P1D)
      void write(java.lang.String file)
      write an external XML file with all CFBook objects (H1D, H2D, P1D)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CFBook

        public CFBook(java.lang.String description)
        Initialize CFBook. The description will be written in XML file during the output.
        Parameters:
        description - description.
      • CFBook

        public CFBook()
        Initialize CFBook class.
    • Method Detail

      • write

        public void write(java.lang.String file)
        write an external XML file with all CFBook objects (H1D, H2D, P1D)
        Parameters:
        file - output file name
      • read

        public void read(java.lang.String file)
        Read external XML file with all objects (H1D, H2D, P1D)
        Parameters:
        file - input file name
      • getH1D

        public H1D getH1D(int id)
        Get H1D histogram from the index (key)
        Parameters:
        id - index or key of histogram
        Returns:
        H1D histogram
      • getP1D

        public P1D getP1D(int id)
        Get P1D object from the index (key)
        Parameters:
        id - index or key of P1D
        Returns:
        P1D histogram
      • listH1D

        public java.lang.String listH1D()
        List all known H1D histograms. It prints indexes (keys) together with titles.
        Returns:
        String representing all known keys.
      • listP1D

        public java.lang.String listP1D()
        List all known P1D objects. It prints indexes (keys) together with titles.
        Returns:
        String representing all known keys.
      • getKeysH1D

        public int[] getKeysH1D()
        Get keys of all known H1D histograms.
        Returns:
        array with all key numbers (integers)
      • getKeysP1D

        public int[] getKeysP1D()
        Get keys of all known P1D containers.
        Returns:
        array with all key numbers (integers)
      • getAllH1D

        public H1D[] getAllH1D()
        Get array with all H1D histograms.
        Returns:
        array with H1D histograms
      • getAllP1D

        public P1D[] getAllP1D()
        Get array with all P1D containers.
        Returns:
        array with P1D containers
      • getAllH2D

        public H2D[] getAllH2D()
        Get array with all H2D histograms.
        Returns:
        array with H2D histograms
      • getKeysH2D

        public int[] getKeysH2D()
        Get keys of all known H2D histograms.
        Returns:
        array with all key numbers (integers)
      • listH2D

        public java.lang.String listH2D()
        List all known H1D histograms.
        Returns:
        String representing all keys and titles of histograms
      • listAll

        public java.lang.String listAll()
        List all objects inside CFBook
        Returns:
        string with description of all objects inside CFBook.
      • getH2D

        public H2D getH2D(int id)
        Get H2D histogram from the index (key) ID
        Parameters:
        id - index
        Returns:
        H2D histogram
      • add

        public void add(int id,
                        H1D h1d)
        add H1D histogram to CFBook
        Parameters:
        id - key to be assigned
        h1d - H1D histogram to be added
      • add

        public void add(int id,
                        H2D h2d)
        add H2D histogram to CFBook
        Parameters:
        id - key to be assigned
        h2d - H2D histogram to be added
      • add

        public void add(int id,
                        P1D p1d)
        add P1D histogram to CFBook
        Parameters:
        id - key to be assigned
        p1d - P1D histogram to be added
      • clear

        public void clear()
        Remove all objects from the CFBook

DMelt 3.0 © DataMelt by jWork.ORG