Documentation of 'tig.TigProperties' Java class
TigProperties
tig

Class TigProperties

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>


    public class TigProperties
    extends java.util.Properties
    Superclass for Preferences classes.
    The getXxxProperty() method behave like method getProperty(String key), inherited from Properties class : if the property can't be correctly retrieved, an exception is thrown.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      TigProperties() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean getBooleanProperty(java.lang.String key)
      Returns a property of type boolean.
      boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
      Returns a property of type boolean.
      double getDoubleProperty(java.lang.String key)
      Returns a property of type double.
      double getDoubleProperty(java.lang.String key, double defaultValue)
      Returns a property of type double.
      int[] getIntArrayProperty(java.lang.String key)
      Returns a property of type int[].
      int[] getIntArrayProperty(java.lang.String key, int[] defaultValue)
      Returns a property of type int[].
      static int getIntConstant(java.lang.String constantName, java.lang.String className)
      Convenient method to get a static final int field of a class, using reflection.
      int getIntProperty(java.lang.String key)
      Returns a property of type int.
      int getIntProperty(java.lang.String key, int defaultValue)
      Returns a property of type int.
      void setBooleanProperty(java.lang.String key, boolean booleanValue)
      Sets a property of type boolean.
      void setDoubleProperty(java.lang.String key, double doubleValue)
      Sets a property of type double.
      void setIntArrayProperty(java.lang.String key, int[] intArray)
      Sets a property of type int[].
      void setIntProperty(java.lang.String key, int intValue)
      Sets a property of type int.
      • Methods inherited from class java.util.Properties

        getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
      • Methods inherited from class java.util.Hashtable

        clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, toString, values
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TigProperties

        public TigProperties()
    • Method Detail

      • getIntConstant

        public static int getIntConstant(java.lang.String constantName,
                                         java.lang.String className)
        Convenient method to get a static final int field of a class, using reflection.
        For example, if you have this piece of code in a class :
        package mypackage;
          public class MyClass{
            public static final int MY_CONSTANT = 8;
          }
        The call : TigBundle.getIntConstant("My_CONSTANT", "mypackage.MyClass"); will then return 8.
        Throws:
        java.lang.RuntimeException - If the property can't be correctly retrieved.
      • getIntProperty

        public int getIntProperty(java.lang.String key)
        Returns a property of type int.
        Throws:
        java.lang.NumberFormatException - If the property can't be retrieved, or can't be converted to an integer.
      • getIntProperty

        public int getIntProperty(java.lang.String key,
                                  int defaultValue)
        Returns a property of type int.
        If the property can't be retrieved, or can't be converted to an integer, the default value is returned.
      • setIntProperty

        public void setIntProperty(java.lang.String key,
                                   int intValue)
        Sets a property of type int.
      • getDoubleProperty

        public double getDoubleProperty(java.lang.String key)
        Returns a property of type double.
        If the property can't be retrieved, or if it can't be converted to a double, null is returned.
      • getDoubleProperty

        public double getDoubleProperty(java.lang.String key,
                                        double defaultValue)
        Returns a property of type double.
        If the property can't be retrieved, or can't be converted to a double, the default value is returned.
      • setDoubleProperty

        public void setDoubleProperty(java.lang.String key,
                                      double doubleValue)
        Sets a property of type double.
      • getBooleanProperty

        public boolean getBooleanProperty(java.lang.String key)
        Returns a property of type boolean.
      • Returns true if the property exists and equals (ignoring case) to "true".
      • Returns false if the property exists and equals (ignoring case) to "false".
      • A RuntimeException is thrown otherwise.
Skip navigation links

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.