< prev index next >

src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java

Print this page

        

*** 170,186 **** * returned as a floating-point number. * * @param x * Value (micrometers) to convert. * @param units ! * Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or ! * {@link #MM <CODE>MM</CODE>}. * ! * @return The value of <CODE>x</CODE> converted to the desired units. * * @exception IllegalArgumentException ! * (unchecked exception) Thrown if <CODE>units</CODE> < 1. */ private static float convertFromMicrometers(int x, int units) { if (units < 1) { throw new IllegalArgumentException("units is < 1"); } --- 170,186 ---- * returned as a floating-point number. * * @param x * Value (micrometers) to convert. * @param units ! * Unit conversion factor, e.g. {@link #INCH INCH} or ! * {@link #MM MM}. * ! * @return The value of {@code x} converted to the desired units. * * @exception IllegalArgumentException ! * (unchecked exception) Thrown if {@code units} < 1. */ private static float convertFromMicrometers(int x, int units) { if (units < 1) { throw new IllegalArgumentException("units is < 1"); }
*** 236,247 **** return convertFromMicrometers(y, units); } /** * Returns a string version of this two-dimensional size attribute in the ! * given units. The string takes the form <CODE>"<I>X</I>x<I>Y</I> ! * <I>U</I>"</CODE>, where <I>X</I> is the X dimension, <I>Y</I> is the Y * dimension, and <I>U</I> is the units name. The values are displayed in * floating point. * * @param units * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}. --- 236,247 ---- return convertFromMicrometers(y, units); } /** * Returns a string version of this two-dimensional size attribute in the ! * given units. The string takes the form <code>"<I>X</I>x<I>Y</I> ! * <I>U</I>"</code>, where <I>X</I> is the X dimension, <I>Y</I> is the Y * dimension, and <I>U</I> is the units name. The values are displayed in * floating point. * * @param units * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
*** 271,294 **** * Returns whether this two-dimensional size attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: * <OL TYPE=1> * <LI> ! * <CODE>object</CODE> is not null. * <LI> ! * <CODE>object</CODE> is an instance of class Size2DSyntax. * <LI> ! * This attribute's X dimension is equal to <CODE>object</CODE>'s X * dimension. * <LI> ! * This attribute's Y dimension is equal to <CODE>object</CODE>'s Y * dimension. * </OL> * * @param object Object to compare to. * ! * @return True if <CODE>object</CODE> is equivalent to this * two-dimensional size attribute, false otherwise. */ public boolean equals(Object object) { return(object != null && object instanceof Size2DSyntax && --- 271,294 ---- * Returns whether this two-dimensional size attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: * <OL TYPE=1> * <LI> ! * {@code object} is not null. * <LI> ! * {@code object} is an instance of class Size2DSyntax. * <LI> ! * This attribute's X dimension is equal to {@code object}'s X * dimension. * <LI> ! * This attribute's Y dimension is equal to {@code object}'s Y * dimension. * </OL> * * @param object Object to compare to. * ! * @return True if {@code object} is equivalent to this * two-dimensional size attribute, false otherwise. */ public boolean equals(Object object) { return(object != null && object instanceof Size2DSyntax &&
*** 304,314 **** ((y & 0x0000FFFF) << 16)); } /** * Returns a string version of this two-dimensional size attribute. The ! * string takes the form <CODE>"<I>X</I>x<I>Y</I> um"</CODE>, where * <I>X</I> is the X dimension and <I>Y</I> is the Y dimension. * The values are reported in the internal units of micrometers. */ public String toString() { StringBuilder result = new StringBuilder(); --- 304,314 ---- ((y & 0x0000FFFF) << 16)); } /** * Returns a string version of this two-dimensional size attribute. The ! * string takes the form <code>"<I>X</I>x<I>Y</I> um"</code>, where * <I>X</I> is the X dimension and <I>Y</I> is the Y dimension. * The values are reported in the internal units of micrometers. */ public String toString() { StringBuilder result = new StringBuilder();
< prev index next >