You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gh...@apache.org on 2006/04/11 17:30:51 UTC
svn commit: r393246 - in
/incubator/harmony/enhanced/classlib/trunk/modules/luni/src:
main/java/java/util/FormattableFlags.java
test/java/tests/api/java/util/AllTests.java
test/java/tests/api/java/util/FormattableFlagsTest.java
Author: gharley
Date: Tue Apr 11 08:30:36 2006
New Revision: 393246
URL: http://svn.apache.org/viewcvs?rev=393246&view=rev
Log:
HARMONY 306 : Adding 5.0 class java.util.FormattableFlags
Added:
incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/FormattableFlags.java (with props)
incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java (with props)
Modified:
incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AllTests.java
Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/FormattableFlags.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/FormattableFlags.java?rev=393246&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/FormattableFlags.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/FormattableFlags.java Tue Apr 11 08:30:36 2006
@@ -0,0 +1,50 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package java.util;
+
+/**
+ * FormattableFlags are used as a parameter to method Formattable.formatTo() and
+ * instruct the output format in Formattables. The validation and interpretation
+ * are fulfilled by the implementation of Formattable.
+ */
+
+public class FormattableFlags {
+ /**
+ * Denotes the output to be left-justified. In order to fill the minimum
+ * width requirement, spaces('\u0020') will be appended at the end of the
+ * specified output element. If no such flag is set, the output is
+ * right-justified.
+ *
+ * The flag corresponds to '-' ('\u002d') in the format specifier.
+ */
+ public static final int LEFT_JUSTIFY = 1;
+
+ /**
+ * Denotes the output to be converted to upper case in the way the locale
+ * parameter of Formatter.formatTo() requires. The output has the same
+ * effect as String.toUpperCase(java.util.Locale).
+ *
+ * This flag corresponds to '^' ('\u005e') in the format specifier.
+ */
+ public static final int UPPERCASE = 2;
+
+ /**
+ * Denotes the output to be formatted in an alternate form. The definition
+ * of the alternate form is given out by Formattable.
+ *
+ * This flag corresponds to '#' ('\u0023') in the format specifier.
+ */
+ public static final int ALTERNATE = 4;
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/FormattableFlags.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AllTests.java?rev=393246&r1=393245&r2=393246&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AllTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AllTests.java Tue Apr 11 08:30:36 2006
@@ -45,6 +45,7 @@
suite.addTestSuite(DateTest.class);
suite.addTestSuite(EmptyStackExceptionTest.class);
suite.addTestSuite(EventObjectTest.class);
+ suite.addTestSuite(FormattableFlagsTest.class);
suite.addTestSuite(GregorianCalendarTest.class);
suite.addTestSuite(HashMapTest.class);
suite.addTestSuite(HashSetTest.class);
Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java?rev=393246&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java Tue Apr 11 08:30:36 2006
@@ -0,0 +1,30 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package tests.api.java.util;
+
+import java.util.FormattableFlags;
+import junit.framework.TestCase;
+
+public class FormattableFlagsTest extends TestCase {
+
+ /**
+ * @test java.util.FormattableFlags ConstantFieldValues
+ */
+ public void test_ConstantFieldValues() {
+ assertEquals(1, FormattableFlags.LEFT_JUSTIFY);
+ assertEquals(2, FormattableFlags.UPPERCASE);
+ assertEquals(4, FormattableFlags.ALTERNATE);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java
------------------------------------------------------------------------------
svn:eol-style = native