View Javadoc
1   /*
2    * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4    *
5    * This code is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License version 2 only, as
7    * published by the Free Software Foundation.  Oracle designates this
8    * particular file as subject to the "Classpath" exception as provided
9    * by Oracle in the LICENSE file that accompanied this code.
10   *
11   * This code is distributed in the hope that it will be useful, but WITHOUT
12   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14   * version 2 for more details (a copy is included in the LICENSE file that
15   * accompanied this code).
16   *
17   * You should have received a copy of the GNU General Public License version
18   * 2 along with this work; if not, write to the Free Software Foundation,
19   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20   *
21   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22   * or visit www.oracle.com if you need additional information or have any
23   * questions.
24   */
25  package javax.print.attribute.standard;
26  
27  import java.util.Locale;
28  
29  import javax.print.attribute.EnumSyntax;
30  import javax.print.attribute.Attribute;
31  
32  /**
33   * Class MediaSizeName is a subclass of Media.
34   * <P>
35   * This attribute can be used instead of specifying MediaName or MediaTray.
36   * <p>
37   * Class MediaSizeName currently declares a few standard media
38   * name values.
39   * <P>
40   * <B>IPP Compatibility:</B> MediaSizeName is a representation class for
41   * values of the IPP "media" attribute which names media sizes.
42   * The names of the media sizes correspond to those in the IPP 1.1 RFC
43   * <a HREF="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a>
44   * <P>
45   *
46   */
47  public class MediaSizeName extends Media {
48  
49      private static final long serialVersionUID = 2778798329756942747L;
50  
51      /**
52       * A0 size.
53       */
54      public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
55      /**
56       * A1 size.
57       */
58      public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
59      /**
60       * A2 size.
61       */
62      public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
63      /**
64       * A3 size.
65       */
66      public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
67      /**
68       * A4 size.
69       */
70      public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
71      /**
72       * A5 size.
73       */
74      public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
75      /**
76       * A6 size.
77       */
78      public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
79      /**
80       * A7 size.
81       */
82      public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
83      /**
84       * A8 size.
85       */
86      public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
87      /**
88       * A9 size.
89       */
90      public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
91      /**
92       * A10 size.
93       */
94      public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
95  
96     /**
97       * ISO B0 size.
98       */
99      public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
100     /**
101      * ISO B1 size.
102      */
103     public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
104     /**
105      * ISO B2 size.
106      */
107     public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
108     /**
109      * ISO B3 size.
110      */
111     public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
112     /**
113      * ISO B4 size.
114      */
115     public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
116     /**
117      * ISO B5 size.
118      */
119     public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
120     /**
121      * ISO B6 size.
122      */
123     public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
124     /**
125      * ISO B7 size.
126      */
127     public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
128     /**
129      * ISO B8 size.
130      */
131     public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
132     /**
133      * ISO B9 size.
134      */
135     public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
136     /**
137      * ISO B10 size.
138      */
139     public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
140 
141    /**
142      * JIS B0 size.
143      */
144     public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
145     /**
146      * JIS B1 size.
147      */
148     public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
149     /**
150      * JIS B2 size.
151      */
152     public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
153     /**
154      * JIS B3 size.
155      */
156     public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
157     /**
158      * JIS B4 size.
159      */
160     public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
161     /**
162      * JIS B5 size.
163      */
164     public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
165     /**
166      * JIS B6 size.
167      */
168     public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
169     /**
170      * JIS B7 size.
171      */
172     public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
173     /**
174      * JIS B8 size.
175      */
176     public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
177     /**
178      * JIS B9 size.
179      */
180     public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
181     /**
182      * JIS B10 size.
183      */
184     public static final MediaSizeName JIS_B10 = new MediaSizeName(32);
185 
186     /**
187      * ISO C0 size.
188      */
189     public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
190     /**
191      * ISO C1 size.
192      */
193     public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
194     /**
195      * ISO C2 size.
196      */
197     public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
198     /**
199      * ISO C3 size.
200      */
201     public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
202     /**
203      * ISO C4 size.
204      */
205     public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
206     /**
207      * ISO C5 size.
208      */
209     public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
210     /**
211      *   letter size.
212      */
213     public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
214     /**
215      *   letter size.
216      */
217     public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
218 
219     /**
220      *  legal size .
221      */
222     public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
223 
224     /**
225      *  executive size .
226      */
227     public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
228 
229     /**
230      *  ledger size .
231      */
232     public static final MediaSizeName LEDGER = new MediaSizeName(43);
233 
234     /**
235      *  tabloid size .
236      */
237     public static final MediaSizeName TABLOID = new MediaSizeName(44);
238 
239     /**
240      *  invoice size .
241      */
242     public static final MediaSizeName INVOICE = new MediaSizeName(45);
243 
244     /**
245      *  folio size .
246      */
247     public static final MediaSizeName FOLIO = new MediaSizeName(46);
248 
249     /**
250      *  quarto size .
251      */
252     public static final MediaSizeName QUARTO = new MediaSizeName(47);
253 
254     /**
255      *  Japanese Postcard size.
256      */
257     public static final MediaSizeName
258         JAPANESE_POSTCARD = new MediaSizeName(48);
259    /**
260      *  Japanese Double Postcard size.
261      */
262     public static final MediaSizeName
263         JAPANESE_DOUBLE_POSTCARD = new MediaSizeName(49);
264 
265     /**
266      *  A size .
267      */
268     public static final MediaSizeName A = new MediaSizeName(50);
269 
270     /**
271      *  B size .
272      */
273     public static final MediaSizeName B = new MediaSizeName(51);
274 
275     /**
276      *  C size .
277      */
278     public static final MediaSizeName C = new MediaSizeName(52);
279 
280     /**
281      *  D size .
282      */
283     public static final MediaSizeName D = new MediaSizeName(53);
284 
285     /**
286      *  E size .
287      */
288     public static final MediaSizeName E = new MediaSizeName(54);
289 
290     /**
291      *  ISO designated long size .
292      */
293     public static final MediaSizeName
294         ISO_DESIGNATED_LONG = new MediaSizeName(55);
295 
296     /**
297      *  Italy envelope size .
298      */
299     public static final MediaSizeName
300         ITALY_ENVELOPE = new MediaSizeName(56);  // DESIGNATED_LONG?
301 
302     /**
303      *  monarch envelope size .
304      */
305     public static final MediaSizeName
306         MONARCH_ENVELOPE = new MediaSizeName(57);
307     /**
308      * personal envelope size .
309      */
310     public static final MediaSizeName
311         PERSONAL_ENVELOPE = new MediaSizeName(58);
312     /**
313      *  number 9 envelope size .
314      */
315     public static final MediaSizeName
316         NA_NUMBER_9_ENVELOPE = new MediaSizeName(59);
317     /**
318      *  number 10 envelope size .
319      */
320     public static final MediaSizeName
321         NA_NUMBER_10_ENVELOPE = new MediaSizeName(60);
322     /**
323      *  number 11 envelope size .
324      */
325     public static final MediaSizeName
326         NA_NUMBER_11_ENVELOPE = new MediaSizeName(61);
327     /**
328      *  number 12 envelope size .
329      */
330     public static final MediaSizeName
331         NA_NUMBER_12_ENVELOPE = new MediaSizeName(62);
332     /**
333      *  number 14 envelope size .
334      */
335     public static final MediaSizeName
336         NA_NUMBER_14_ENVELOPE = new MediaSizeName(63);
337    /**
338      *  6x9 North American envelope size.
339      */
340     public static final MediaSizeName
341         NA_6X9_ENVELOPE = new MediaSizeName(64);
342    /**
343      *  7x9 North American envelope size.
344      */
345     public static final MediaSizeName
346         NA_7X9_ENVELOPE = new MediaSizeName(65);
347    /**
348      *  9x11 North American envelope size.
349      */
350     public static final MediaSizeName
351         NA_9X11_ENVELOPE = new MediaSizeName(66);
352     /**
353      *  9x12 North American envelope size.
354      */
355     public static final MediaSizeName
356         NA_9X12_ENVELOPE = new MediaSizeName(67);
357 
358     /**
359      *  10x13 North American envelope size .
360      */
361     public static final MediaSizeName
362         NA_10X13_ENVELOPE = new MediaSizeName(68);
363     /**
364      *  10x14North American  envelope size .
365      */
366     public static final MediaSizeName
367         NA_10X14_ENVELOPE = new MediaSizeName(69);
368     /**
369      *  10x15 North American envelope size.
370      */
371     public static final MediaSizeName
372         NA_10X15_ENVELOPE = new MediaSizeName(70);
373 
374     /**
375      *  5x7 North American paper.
376      */
377     public static final MediaSizeName
378         NA_5X7 = new MediaSizeName(71);
379 
380     /**
381      *  8x10 North American paper.
382      */
383     public static final MediaSizeName
384         NA_8X10 = new MediaSizeName(72);
385 
386     /**
387      * Construct a new media size enumeration value with the given integer
388      * value.
389      *
390      * @param  value  Integer value.
391      */
392     protected MediaSizeName(int value) {
393         super (value);
394     }
395 
396     private static final String[] myStringTable = {
397                 "iso-a0",
398                 "iso-a1",
399                 "iso-a2",
400                 "iso-a3",
401                 "iso-a4",
402                 "iso-a5",
403                 "iso-a6",
404                 "iso-a7",
405                 "iso-a8",
406                 "iso-a9",
407                 "iso-a10",
408                 "iso-b0",
409                 "iso-b1",
410                 "iso-b2",
411                 "iso-b3",
412                 "iso-b4",
413                 "iso-b5",
414                 "iso-b6",
415                 "iso-b7",
416                 "iso-b8",
417                 "iso-b9",
418                 "iso-b10",
419                 "jis-b0",
420                 "jis-b1",
421                 "jis-b2",
422                 "jis-b3",
423                 "jis-b4",
424                 "jis-b5",
425                 "jis-b6",
426                 "jis-b7",
427                 "jis-b8",
428                 "jis-b9",
429                 "jis-b10",
430                 "iso-c0",
431                 "iso-c1",
432                 "iso-c2",
433                 "iso-c3",
434                 "iso-c4",
435                 "iso-c5",
436                 "iso-c6",
437                 "na-letter",
438                 "na-legal",
439                 "executive",
440                 "ledger",
441                 "tabloid",
442                 "invoice",
443                 "folio",
444                 "quarto",
445                 "japanese-postcard",
446                 "oufuko-postcard",
447                 "a",
448                 "b",
449                 "c",
450                 "d",
451                 "e",
452                 "iso-designated-long",
453                 "italian-envelope",
454                 "monarch-envelope",
455                 "personal-envelope",
456                 "na-number-9-envelope",
457                 "na-number-10-envelope",
458                 "na-number-11-envelope",
459                 "na-number-12-envelope",
460                 "na-number-14-envelope",
461                 "na-6x9-envelope",
462                 "na-7x9-envelope",
463                 "na-9x11-envelope",
464                 "na-9x12-envelope",
465                 "na-10x13-envelope",
466                 "na-10x14-envelope",
467                 "na-10x15-envelope",
468                 "na-5x7",
469                 "na-8x10",
470         };
471 
472     private static final MediaSizeName[] myEnumValueTable = {
473                 ISO_A0,
474                 ISO_A1,
475                 ISO_A2,
476                 ISO_A3,
477                 ISO_A4,
478                 ISO_A5,
479                 ISO_A6,
480                 ISO_A7,
481                 ISO_A8,
482                 ISO_A9,
483                 ISO_A10,
484                 ISO_B0,
485                 ISO_B1,
486                 ISO_B2,
487                 ISO_B3,
488                 ISO_B4,
489                 ISO_B5,
490                 ISO_B6,
491                 ISO_B7,
492                 ISO_B8,
493                 ISO_B9,
494                 ISO_B10,
495                 JIS_B0,
496                 JIS_B1,
497                 JIS_B2,
498                 JIS_B3,
499                 JIS_B4,
500                 JIS_B5,
501                 JIS_B6,
502                 JIS_B7,
503                 JIS_B8,
504                 JIS_B9,
505                 JIS_B10,
506                 ISO_C0,
507                 ISO_C1,
508                 ISO_C2,
509                 ISO_C3,
510                 ISO_C4,
511                 ISO_C5,
512                 ISO_C6,
513                 NA_LETTER,
514                 NA_LEGAL,
515                 EXECUTIVE,
516                 LEDGER,
517                 TABLOID,
518                 INVOICE,
519                 FOLIO,
520                 QUARTO,
521                 JAPANESE_POSTCARD,
522                 JAPANESE_DOUBLE_POSTCARD,
523                 A,
524                 B,
525                 C,
526                 D,
527                 E,
528                 ISO_DESIGNATED_LONG,
529                 ITALY_ENVELOPE,
530                 MONARCH_ENVELOPE,
531                 PERSONAL_ENVELOPE,
532                 NA_NUMBER_9_ENVELOPE,
533                 NA_NUMBER_10_ENVELOPE,
534                 NA_NUMBER_11_ENVELOPE,
535                 NA_NUMBER_12_ENVELOPE,
536                 NA_NUMBER_14_ENVELOPE,
537                 NA_6X9_ENVELOPE,
538                 NA_7X9_ENVELOPE,
539                 NA_9X11_ENVELOPE,
540                 NA_9X12_ENVELOPE,
541                 NA_10X13_ENVELOPE,
542                 NA_10X14_ENVELOPE,
543                 NA_10X15_ENVELOPE,
544                 NA_5X7,
545                 NA_8X10,
546         };
547 
548 
549     /**
550      * Returns the string table for class MediaSizeName.
551      */
552     protected String[] getStringTable()
553     {
554         return (String[])myStringTable.clone();
555     }
556 
557     /**
558      * Returns the enumeration value table for class MediaSizeName.
559      */
560     protected EnumSyntax[] getEnumValueTable() {
561         return (EnumSyntax[])myEnumValueTable.clone();
562     }
563 
564 
565 }