Class StiNumberFormatService

All Implemented Interfaces:
IStiDefault, IStiJsonReportObject, IStiSerializable, IStiSerializableRef, IStiSerializableToDocument, Cloneable
Direct Known Subclasses:
StiCurrencyFormatService

public class StiNumberFormatService extends StiFormatService
  • Constructor Details

    • StiNumberFormatService

      public StiNumberFormatService()
    • StiNumberFormatService

      public StiNumberFormatService(int negativePattern, String decimalSeparator, int decimalDigits, String groupSeparator, int groupSize, boolean useGroupSeparator, boolean useLocalSetting, String nullDisplay)
      Creates a new format of the type StiNumberFormatService with specified arguments.
      Parameters:
      negativePattern - The format pattern for negative numeric values.
      decimalSeparator - The string to use as the decimal separator in currency values.
      decimalDigits - The number of decimal places to use in currency values.
      groupSeparator - The string that separates groups of digits to the left of the decimal in currency values.
      groupSize - The number of digits in group to the left of the decimal in currency values.
      useGroupSeparator - Value indicates that it is necessary to use a group separator.
      useLocalSetting - Value indicates that it is necessary to use local settings.
      nullDisplay - String value to show the value null.
      decimalPlaces - Do not use this argument.
    • StiNumberFormatService

      public StiNumberFormatService(int negativePattern, int decimalPlaces, String decimalSeparator, int decimalDigits, String groupSeparator, int groupSize, boolean useGroupSeparator, boolean useLocalSetting, String nullDisplay)
  • Method Details

    • FillLocalSetting

      protected static void FillLocalSetting(DecimalFormat format)
    • getServiceName

      public String getServiceName()
      Gets a service name.
      Overrides:
      getServiceName in class StiService
    • getPosition

      public int getPosition()
      Specified by:
      getPosition in class StiFormatService
    • getNullDisplay

      public final String getNullDisplay()
      Gets or sets string value to show the value null.
    • setNullDisplay

      public final void setNullDisplay(String value)
    • getNegativePattern

      public int getNegativePattern()
      Gets or sets the format pattern for negative numeric values.
    • setNegativePattern

      public final void setNegativePattern(int value)
    • getDecimalSeparator

      public String getDecimalSeparator()
      Gets or sets the string to use as the decimal separator in currency values.
    • setDecimalSeparator

      public final void setDecimalSeparator(String value)
    • getDecimalDigits

      public int getDecimalDigits()
      Gets or sets indicates the number of decimal places to use in currency values.
    • setDecimalDigits

      public final void setDecimalDigits(int value)
    • getGroupSeparator

      public String getGroupSeparator()
      Gets or sets the string that separates groups of digits to the left of the decimal in currency values.
    • setGroupSeparator

      public final void setGroupSeparator(String value)
    • getGroupSize

      public int getGroupSize()
      Gets or sets the number of digits in group to the left of the decimal in currency values.
    • setGroupSize

      public final void setGroupSize(int value)
    • getUseGroupSeparator

      public final boolean getUseGroupSeparator()
      Gets or sets value indicates it is necessary to use a group separator.
    • setUseGroupSeparator

      public final void setUseGroupSeparator(boolean value)
    • getUseLocalSetting

      public final boolean getUseLocalSetting()
      Gets or sets value indicates it is necessary to use local settings.
    • setUseLocalSetting

      public final void setUseLocalSetting(boolean value)
    • getStringFormat

      public String getStringFormat()
      Gets or sets string of formatting.
      Overrides:
      getStringFormat in class StiFormatService
    • setStringFormat

      public void setStringFormat(String value)
      Overrides:
      setStringFormat in class StiFormatService
    • getSample

      public Object getSample()
      Gets value to show a sample of formatting.
      Specified by:
      getSample in class StiFormatService
    • getNativeFormatString

      public String getNativeFormatString()
      Returns native format string.
      Overrides:
      getNativeFormatString in class StiFormatService
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class StiFormatService
    • format

      public String format(String stringFormat, Object value, Locale locale)
      Formats the specified object in order of regulations and returns a string.
      Overrides:
      format in class StiFormatService
      Parameters:
      stringFormat - String of formatting.
      value - Object for formatting.
      format - String of formatting.
      arg - Object for formatting.
      Returns:
      Formatted string.
    • getDecimalFormatSymbols

      protected DecimalFormatSymbols getDecimalFormatSymbols(DecimalFormat form)
    • SaveToJsonObject

      public JSONObject SaveToJsonObject(StiJsonSaveMode mode) throws JSONException
      Specified by:
      SaveToJsonObject in interface IStiJsonReportObject
      Overrides:
      SaveToJsonObject in class StiFormatService
      Throws:
      JSONException
    • LoadFromJsonObject

      public void LoadFromJsonObject(JSONObject jObject) throws JSONException
      Specified by:
      LoadFromJsonObject in interface IStiJsonReportObject
      Overrides:
      LoadFromJsonObject in class StiFormatService
      Throws:
      JSONException