1 /*
2 * JasperReports - Free Java Reporting Library.
3 * Copyright (C) 2001 - 2019 TIBCO Software Inc. All rights reserved.
4 * http://www.jaspersoft.com
5 *
6 * Unless you have purchased a commercial license agreement from Jaspersoft,
7 * the following license terms apply:
8 *
9 * This program is part of JasperReports.
10 *
11 * JasperReports is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * JasperReports is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
23 */
24 package net.sf.jasperreports.engine.type;
25
26
27 /**
28 * @author Sanda Zaharia (shertage@users.sourceforge.net)
29 */
30 public enum RunDirectionEnum implements JREnum
31 {
32 /**
33 * Constant useful to specify that text flows from left to right.
34 */
35 LTR((byte)0, "LTR"),
36
37 /**
38 * Constant useful to specify that text flows from right to left.
39 */
40 RTL((byte)1, "RTL");
41
42 /**
43 *
44 */
45 private final transient byte value;
46 private final transient String name;
47
48 private RunDirectionEnum(byte value, String name)
49 {
50 this.value = value;
51 this.name = name;
52 }
53
54 /**
55 * @deprecated Used only by deprecated serialized fields.
56 */
57 @Override
58 public Byte getValueByte()
59 {
60 return value;
61 }
62
63 /**
64 * @deprecated Used only by deprecated serialized fields.
65 */
66 @Override
67 public final byte getValue()
68 {
69 return value;
70 }
71
72 @Override
73 public String getName()
74 {
75 return name;
76 }
77
78 /**
79 *
80 */
81 public static RunDirectionEnum getByName(String name)
82 {
83 return EnumUtil.getEnumByName(values(), name);
84 }
85
86 /**
87 * @deprecated Used only by deprecated serialized fields.
88 */
89 public static RunDirectionEnum getByValue(Byte value)
90 {
91 return (RunDirectionEnum)EnumUtil.getByValue(values(), value);
92 }
93
94 /**
95 * @deprecated Used only by deprecated serialized fields.
96 */
97 public static RunDirectionEnum getByValue(byte value)
98 {
99 return getByValue((Byte)value);
100 }
101 }
102