psdi.app.kpi

Class KPIUtil

  • java.lang.Object
    • psdi.app.kpi.KPIUtil


  • public class KPIUtil
    extends java.lang.Object
    Provides utility methods used for displaying KPIs
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  KPIUtil.Status
      Used to track the status of a KPI.
      static class  KPIUtil.Trend
      Used to track the trend for a KPI.
    • Constructor Summary

      Constructors 
      Constructor and Description
      KPIUtil() 
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      static java.util.Date calendarEndDate(java.lang.String range, java.util.Date startDate, java.util.Date endDate)
      Adds a number of days, months, years etc based on range of the KPIHistory Sets
      static java.lang.String formatDouble(double dNumber, java.util.Locale userLocale)
      Returns a number to diaply formatted for grouping, and decimal seperator If Number trails with .00, returns the mantissa part only
      static KPIUtil.Status getKPIStatus(double kpivalue, double cautionmin, double cautionmax) 
      static long getKPIUniqueId(java.lang.String kpiName, UserInfo ui)
      Returns long unqiue id for a KPI based on its KPI name
      static java.util.Date makeDateFromDBDate(java.util.Date d)
      Returns a gregorian calendar date Sets
      static java.lang.String replaceSingleQuotes(java.lang.String oldString)
      Replaces single quotes with two single quotes.
      static java.lang.String replaceString(java.lang.String str, java.lang.String pattern, java.lang.String replacement)
      Deprecated. 
      use String#replace(String, String)
      static void validateCustomRange(java.util.Date startDate, java.util.Date endDate, java.lang.String customRange)
      Validates that their is suffient period of time in between a given start date and end date
      • Methods inherited from class java.lang.Object

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

      • KPIUtil

        public KPIUtil()
    • Method Detail

      • formatDouble

        public static java.lang.String formatDouble(double dNumber,
                                                    java.util.Locale userLocale)
        Returns a number to diaply formatted for grouping, and decimal seperator If Number trails with .00, returns the mantissa part only
        Parameters:
        dNumber - Number to format as a double
        Returns:
        formatted number as a string
      • calendarEndDate

        public static java.util.Date calendarEndDate(java.lang.String range,
                                                     java.util.Date startDate,
                                                     java.util.Date endDate)
        Adds a number of days, months, years etc based on range of the KPIHistory Sets
        Parameters:
        range -
        Returns:
      • makeDateFromDBDate

        public static java.util.Date makeDateFromDBDate(java.util.Date d)
        Returns a gregorian calendar date Sets
        Parameters:
        d -
        Returns:
      • validateCustomRange

        public static void validateCustomRange(java.util.Date startDate,
                                               java.util.Date endDate,
                                               java.lang.String customRange)
                                        throws MXException,
                                               java.rmi.RemoteException
        Validates that their is suffient period of time in between a given start date and end date
        Parameters:
        startDate -
        endDate -
        customRange -
        Throws:
        MXException
        java.rmi.RemoteException
      • getKPIUniqueId

        public static long getKPIUniqueId(java.lang.String kpiName,
                                          UserInfo ui)
                                   throws MXException,
                                          java.rmi.RemoteException
        Returns long unqiue id for a KPI based on its KPI name
        Parameters:
        kpiName - Name if the KPI
        Returns:
        unique id as long
        Throws:
        MXException
        java.rmi.RemoteException
      • replaceSingleQuotes

        public static java.lang.String replaceSingleQuotes(java.lang.String oldString)
        Replaces single quotes with two single quotes.
      • replaceString

        public static java.lang.String replaceString(java.lang.String str,
                                                     java.lang.String pattern,
                                                     java.lang.String replacement)
        Deprecated. use String#replace(String, String)
        Replace all occurrences of a pattern string with a replacement string.
        Parameters:
        str - String to search
        pattern - string to replace
        replacement - string to replace patter with
      • getKPIStatus

        public static KPIUtil.Status getKPIStatus(double kpivalue,
                                                  double cautionmin,
                                                  double cautionmax)