FormattableFlags.java revision 0
0N/A/*
0N/A * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation. Sun designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/A * by Sun in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A * CA 95054 USA or visit www.sun.com if you need additional information or
0N/A * have any questions.
0N/A */
0N/A
0N/Apackage java.util;
0N/A
0N/A/**
0N/A * FomattableFlags are passed to the {@link Formattable#formatTo
0N/A * Formattable.formatTo()} method and modify the output format for {@linkplain
0N/A * Formattable Formattables}. Implementations of {@link Formattable} are
0N/A * responsible for interpreting and validating any flags.
0N/A *
0N/A * @since 1.5
0N/A */
0N/Apublic class FormattableFlags {
0N/A
0N/A // Explicit instantiation of this class is prohibited.
0N/A private FormattableFlags() {}
0N/A
0N/A /**
0N/A * Left-justifies the output. Spaces (<tt>'&#92;u0020'</tt>) will be added
0N/A * at the end of the converted value as required to fill the minimum width
0N/A * of the field. If this flag is not set then the output will be
0N/A * right-justified.
0N/A *
0N/A * <p> This flag corresponds to <tt>'-'</tt> (<tt>'&#92;u002d'</tt>) in
0N/A * the format specifier.
0N/A */
0N/A public static final int LEFT_JUSTIFY = 1<<0; // '-'
0N/A
0N/A /**
0N/A * Converts the output to upper case according to the rules of the
0N/A * {@linkplain java.util.Locale locale} given during creation of the
0N/A * <tt>formatter</tt> argument of the {@link Formattable#formatTo
0N/A * formatTo()} method. The output should be equivalent the following
0N/A * invocation of {@link String#toUpperCase(java.util.Locale)}
0N/A *
0N/A * <pre>
0N/A * out.toUpperCase() </pre>
0N/A *
0N/A * <p> This flag corresponds to <tt>'^'</tt> (<tt>'&#92;u005e'</tt>) in
0N/A * the format specifier.
0N/A */
0N/A public static final int UPPERCASE = 1<<1; // '^'
0N/A
0N/A /**
0N/A * Requires the output to use an alternate form. The definition of the
0N/A * form is specified by the <tt>Formattable</tt>.
0N/A *
0N/A * <p> This flag corresponds to <tt>'#'</tt> (<tt>'&#92;u0023'</tt>) in
0N/A * the format specifier.
0N/A */
0N/A public static final int ALTERNATE = 1<<2; // '#'
0N/A}