60 * stored as 215900 µm. For example, a lookup service can
61 * match resolution attributes based on equality of their serialized
62 * representations regardless of the units in which they were created. Using
63 * integers for internal storage allows precise equality comparisons to be done,
64 * which would not be guaranteed if an internal floating point representation
65 * were used. Note that if you're looking for U.S. letter sized media in metric
66 * units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
67 * to an integral 216 x 279 mm will not match.
68 * <P>
69 * The exported constant {@link #INCH INCH} is actually the
70 * conversion factor by which to multiply a value in inches to get the value in
71 * µm. Likewise, the exported constant {@link #MM MM} is the
72 * conversion factor by which to multiply a value in mm to get the value in
73 * µm. A client can specify a resolution value in units other than inches
74 * or mm by supplying its own conversion factor. However, since the internal
75 * units of µm was chosen with supporting only the external units of inch
76 * and mm in mind, there is no guarantee that the conversion factor for the
77 * client's units will be an exact integer. If the conversion factor isn't an
78 * exact integer, resolution values in the client's units won't be stored
79 * precisely.
80 * <P>
81 *
82 * @author Alan Kaminsky
83 */
84 public abstract class Size2DSyntax implements Serializable, Cloneable {
85
86 private static final long serialVersionUID = 5584439964938660530L;
87
88 /**
89 * X dimension in units of micrometers (µm).
90 * @serial
91 */
92 private int x;
93
94 /**
95 * Y dimension in units of micrometers (µm).
96 * @serial
97 */
98 private int y;
99
100 /**
|
60 * stored as 215900 µm. For example, a lookup service can
61 * match resolution attributes based on equality of their serialized
62 * representations regardless of the units in which they were created. Using
63 * integers for internal storage allows precise equality comparisons to be done,
64 * which would not be guaranteed if an internal floating point representation
65 * were used. Note that if you're looking for U.S. letter sized media in metric
66 * units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
67 * to an integral 216 x 279 mm will not match.
68 * <P>
69 * The exported constant {@link #INCH INCH} is actually the
70 * conversion factor by which to multiply a value in inches to get the value in
71 * µm. Likewise, the exported constant {@link #MM MM} is the
72 * conversion factor by which to multiply a value in mm to get the value in
73 * µm. A client can specify a resolution value in units other than inches
74 * or mm by supplying its own conversion factor. However, since the internal
75 * units of µm was chosen with supporting only the external units of inch
76 * and mm in mind, there is no guarantee that the conversion factor for the
77 * client's units will be an exact integer. If the conversion factor isn't an
78 * exact integer, resolution values in the client's units won't be stored
79 * precisely.
80 *
81 * @author Alan Kaminsky
82 */
83 public abstract class Size2DSyntax implements Serializable, Cloneable {
84
85 private static final long serialVersionUID = 5584439964938660530L;
86
87 /**
88 * X dimension in units of micrometers (µm).
89 * @serial
90 */
91 private int x;
92
93 /**
94 * Y dimension in units of micrometers (µm).
95 * @serial
96 */
97 private int y;
98
99 /**
|