662 // standard decimal separator for all locales that we support.
663 // If that changes, add a new entry to NumberElements.
664 monetarySeparator = decimalSeparator;
665 }
666
667 /**
668 * Reads the default serializable fields, provides default values for objects
669 * in older serial versions, and initializes non-serializable fields.
670 * If <code>serialVersionOnStream</code>
671 * is less than 1, initializes <code>monetarySeparator</code> to be
672 * the same as <code>decimalSeparator</code> and <code>exponential</code>
673 * to be 'E'.
674 * If <code>serialVersionOnStream</code> is less than 2,
675 * initializes <code>locale</code>to the root locale, and initializes
676 * If <code>serialVersionOnStream</code> is less than 3, it initializes
677 * <code>exponentialSeparator</code> using <code>exponential</code>.
678 * Sets <code>serialVersionOnStream</code> back to the maximum allowed value so that
679 * default serialization will work properly if this object is streamed out again.
680 * Initializes the currency from the intlCurrencySymbol field.
681 *
682 * @since JDK 1.1.6
683 */
684 private void readObject(ObjectInputStream stream)
685 throws IOException, ClassNotFoundException {
686 stream.defaultReadObject();
687 if (serialVersionOnStream < 1) {
688 // Didn't have monetarySeparator or exponential field;
689 // use defaults.
690 monetarySeparator = decimalSeparator;
691 exponential = 'E';
692 }
693 if (serialVersionOnStream < 2) {
694 // didn't have locale; use root locale
695 locale = Locale.ROOT;
696 }
697 if (serialVersionOnStream < 3) {
698 // didn't have exponentialSeparator. Create one using exponential
699 exponentialSeparator = Character.toString(exponential);
700 }
701 serialVersionOnStream = currentSerialVersion;
702
785 */
786 private char minusSign;
787
788 /**
789 * String denoting the local currency, e.g. "$".
790 * @serial
791 * @see #getCurrencySymbol
792 */
793 private String currencySymbol;
794
795 /**
796 * ISO 4217 currency code denoting the local currency, e.g. "USD".
797 * @serial
798 * @see #getInternationalCurrencySymbol
799 */
800 private String intlCurrencySymbol;
801
802 /**
803 * The decimal separator used when formatting currency values.
804 * @serial
805 * @since JDK 1.1.6
806 * @see #getMonetaryDecimalSeparator
807 */
808 private char monetarySeparator; // Field new in JDK 1.1.6
809
810 /**
811 * The character used to distinguish the exponent in a number formatted
812 * in exponential notation, e.g. 'E' for a number such as "1.23E45".
813 * <p>
814 * Note that the public API provides no way to set this field,
815 * even though it is supported by the implementation and the stream format.
816 * The intent is that this will be added to the API in the future.
817 *
818 * @serial
819 * @since JDK 1.1.6
820 */
821 private char exponential; // Field new in JDK 1.1.6
822
823 /**
824 * The string used to separate the mantissa from the exponent.
825 * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
826 * <p>
827 * If both <code>exponential</code> and <code>exponentialSeparator</code>
828 * exist, this <code>exponentialSeparator</code> has the precedence.
829 *
830 * @serial
831 * @since 1.6
832 */
833 private String exponentialSeparator; // Field new in JDK 1.6
834
835 /**
836 * The locale of these currency format symbols.
837 *
838 * @serial
839 * @since 1.4
855 private static final int currentSerialVersion = 3;
856
857 /**
858 * Describes the version of <code>DecimalFormatSymbols</code> present on the stream.
859 * Possible values are:
860 * <ul>
861 * <li><b>0</b> (or uninitialized): versions prior to JDK 1.1.6.
862 *
863 * <li><b>1</b>: Versions written by JDK 1.1.6 or later, which include
864 * two new fields: <code>monetarySeparator</code> and <code>exponential</code>.
865 * <li><b>2</b>: Versions written by J2SE 1.4 or later, which include a
866 * new <code>locale</code> field.
867 * <li><b>3</b>: Versions written by J2SE 1.6 or later, which include a
868 * new <code>exponentialSeparator</code> field.
869 * </ul>
870 * When streaming out a <code>DecimalFormatSymbols</code>, the most recent format
871 * (corresponding to the highest allowable <code>serialVersionOnStream</code>)
872 * is always written.
873 *
874 * @serial
875 * @since JDK 1.1.6
876 */
877 private int serialVersionOnStream = currentSerialVersion;
878 }
|
662 // standard decimal separator for all locales that we support.
663 // If that changes, add a new entry to NumberElements.
664 monetarySeparator = decimalSeparator;
665 }
666
667 /**
668 * Reads the default serializable fields, provides default values for objects
669 * in older serial versions, and initializes non-serializable fields.
670 * If <code>serialVersionOnStream</code>
671 * is less than 1, initializes <code>monetarySeparator</code> to be
672 * the same as <code>decimalSeparator</code> and <code>exponential</code>
673 * to be 'E'.
674 * If <code>serialVersionOnStream</code> is less than 2,
675 * initializes <code>locale</code>to the root locale, and initializes
676 * If <code>serialVersionOnStream</code> is less than 3, it initializes
677 * <code>exponentialSeparator</code> using <code>exponential</code>.
678 * Sets <code>serialVersionOnStream</code> back to the maximum allowed value so that
679 * default serialization will work properly if this object is streamed out again.
680 * Initializes the currency from the intlCurrencySymbol field.
681 *
682 * @since 1.1.6
683 */
684 private void readObject(ObjectInputStream stream)
685 throws IOException, ClassNotFoundException {
686 stream.defaultReadObject();
687 if (serialVersionOnStream < 1) {
688 // Didn't have monetarySeparator or exponential field;
689 // use defaults.
690 monetarySeparator = decimalSeparator;
691 exponential = 'E';
692 }
693 if (serialVersionOnStream < 2) {
694 // didn't have locale; use root locale
695 locale = Locale.ROOT;
696 }
697 if (serialVersionOnStream < 3) {
698 // didn't have exponentialSeparator. Create one using exponential
699 exponentialSeparator = Character.toString(exponential);
700 }
701 serialVersionOnStream = currentSerialVersion;
702
785 */
786 private char minusSign;
787
788 /**
789 * String denoting the local currency, e.g. "$".
790 * @serial
791 * @see #getCurrencySymbol
792 */
793 private String currencySymbol;
794
795 /**
796 * ISO 4217 currency code denoting the local currency, e.g. "USD".
797 * @serial
798 * @see #getInternationalCurrencySymbol
799 */
800 private String intlCurrencySymbol;
801
802 /**
803 * The decimal separator used when formatting currency values.
804 * @serial
805 * @since 1.1.6
806 * @see #getMonetaryDecimalSeparator
807 */
808 private char monetarySeparator; // Field new in JDK 1.1.6
809
810 /**
811 * The character used to distinguish the exponent in a number formatted
812 * in exponential notation, e.g. 'E' for a number such as "1.23E45".
813 * <p>
814 * Note that the public API provides no way to set this field,
815 * even though it is supported by the implementation and the stream format.
816 * The intent is that this will be added to the API in the future.
817 *
818 * @serial
819 * @since 1.1.6
820 */
821 private char exponential; // Field new in JDK 1.1.6
822
823 /**
824 * The string used to separate the mantissa from the exponent.
825 * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
826 * <p>
827 * If both <code>exponential</code> and <code>exponentialSeparator</code>
828 * exist, this <code>exponentialSeparator</code> has the precedence.
829 *
830 * @serial
831 * @since 1.6
832 */
833 private String exponentialSeparator; // Field new in JDK 1.6
834
835 /**
836 * The locale of these currency format symbols.
837 *
838 * @serial
839 * @since 1.4
855 private static final int currentSerialVersion = 3;
856
857 /**
858 * Describes the version of <code>DecimalFormatSymbols</code> present on the stream.
859 * Possible values are:
860 * <ul>
861 * <li><b>0</b> (or uninitialized): versions prior to JDK 1.1.6.
862 *
863 * <li><b>1</b>: Versions written by JDK 1.1.6 or later, which include
864 * two new fields: <code>monetarySeparator</code> and <code>exponential</code>.
865 * <li><b>2</b>: Versions written by J2SE 1.4 or later, which include a
866 * new <code>locale</code> field.
867 * <li><b>3</b>: Versions written by J2SE 1.6 or later, which include a
868 * new <code>exponentialSeparator</code> field.
869 * </ul>
870 * When streaming out a <code>DecimalFormatSymbols</code>, the most recent format
871 * (corresponding to the highest allowable <code>serialVersionOnStream</code>)
872 * is always written.
873 *
874 * @serial
875 * @since 1.1.6
876 */
877 private int serialVersionOnStream = currentSerialVersion;
878 }
|