Class PropertyFileReader

java.lang.Object
de.grogra.pf.io.PropertyFileReader

public class PropertyFileReader extends Object
PropertyFileReader.java Provides functions to read properties from external files.
Author:
mh
  • Constructor Details

    • PropertyFileReader

      public PropertyFileReader()
    • PropertyFileReader

      public PropertyFileReader(File file)
    • PropertyFileReader

      public PropertyFileReader(String file_name)
    • PropertyFileReader

      public PropertyFileReader(FileSource fs)
  • Method Details

    • load

      public boolean load()
      Loading of a property file. The file has to be set by using the constructor.
      Returns:
      false, iff there was no error during loading property file.
    • load

      public boolean load(File file)
    • load

      public boolean load(InputStream inFileStream)
    • save

      public boolean save(String path)
    • save

      public boolean save(File file)
    • save

      public boolean save(OutputStream outFileStream)
    • getNumberOfReadProperties

      public int getNumberOfReadProperties()
      Returns the number of read properties.
      Returns:
      number of read properties
    • getBoolean

      public boolean getBoolean(String propertyString)
      Returns the specified property as boolean value.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getString

      public String getString(String propertyString)
      Returns the specified property as string value.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getDouble

      public double getDouble(String propertyString)
      Returns the specified property as double value.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getFloat

      public float getFloat(String propertyString)
      Returns the specified property as float value.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getInteger

      public int getInteger(String propertyString)
      Returns the specified property as integer value.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getFloatArray

      public float[] getFloatArray(String propertyString)
      Returns the specified property as array of float values.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getDoubleArray

      public double[] getDoubleArray(String propertyString)
      Returns the specified property as array of double values.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getIntArray

      public int[] getIntArray(String propertyString)
      Returns the specified property as a array of integer values.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property
    • getStringArray

      public String[] getStringArray(String propertyString)
      Returns the specified property as a array of strings.
      Parameters:
      propertyString - name of the specified property
      Returns:
      value of this property