< prev index next >
src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java
Print this page
*** 148,164 ****
* the nearest integer.
*
* @param dphi
* Value (dphi) to convert.
* @param units
! * Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or
! * {@link #DPCM <CODE>DPCM</CODE>}.
*
! * @return The value of <CODE>dphi</CODE> converted to the desired units.
*
* @exception IllegalArgumentException
! * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
*/
private static int convertFromDphi(int dphi, int units) {
if (units < 1) {
throw new IllegalArgumentException(": units is < 1");
}
--- 148,164 ----
* the nearest integer.
*
* @param dphi
* Value (dphi) to convert.
* @param units
! * Unit conversion factor, e.g. {@link #DPI DPI} or
! * {@link #DPCM DPCM}.
*
! * @return The value of {@code dphi} converted to the desired units.
*
* @exception IllegalArgumentException
! * (unchecked exception) Thrown if {@code units} < 1.
*/
private static int convertFromDphi(int dphi, int units) {
if (units < 1) {
throw new IllegalArgumentException(": units is < 1");
}
*** 220,239 ****
return convertFromDphi (feedResolution, units);
}
/**
* Returns a string version of this resolution attribute in the given units.
! * The string takes the form <CODE>"<I>C</I>x<I>F</I> <I>U</I>"</CODE>,
* where <I>C</I> is the cross feed direction resolution, <I>F</I> is the
* feed direction resolution, and <I>U</I> is the units name. The values are
* rounded to the nearest integer.
*
* @param units
* Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
* #DPCM DPCM}.
* @param unitsName
! * Units name string, e.g. <CODE>"dpi"</CODE> or <CODE>"dpcm"</CODE>. If
* null, no units name is appended to the result.
*
* @return String version of this resolution attribute.
*
* @exception IllegalArgumentException
--- 220,239 ----
return convertFromDphi (feedResolution, units);
}
/**
* Returns a string version of this resolution attribute in the given units.
! * The string takes the form <code>"<I>C</I>x<I>F</I> <I>U</I>"</code>,
* where <I>C</I> is the cross feed direction resolution, <I>F</I> is the
* feed direction resolution, and <I>U</I> is the units name. The values are
* rounded to the nearest integer.
*
* @param units
* Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
* #DPCM DPCM}.
* @param unitsName
! * Units name string, e.g. {@code "dpi"} or {@code "dpcm"}. If
* null, no units name is appended to the result.
*
* @return String version of this resolution attribute.
*
* @exception IllegalArgumentException
*** 257,279 ****
* equal to the given resolution attribute's value. This is true if all
* of the following conditions are true:
* <UL>
* <LI>
* This attribute's cross feed direction resolution is less than or equal to
! * the <CODE>other</CODE> attribute's cross feed direction resolution.
* <LI>
* This attribute's feed direction resolution is less than or equal to the
! * <CODE>other</CODE> attribute's feed direction resolution.
* </UL>
*
* @param other Resolution attribute to compare with.
*
* @return True if this resolution attribute is less than or equal to the
! * <CODE>other</CODE> resolution attribute, false otherwise.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if <CODE>other</CODE> is null.
*/
public boolean lessThanOrEquals(ResolutionSyntax other) {
return (this.crossFeedResolution <= other.crossFeedResolution &&
this.feedResolution <= other.feedResolution);
}
--- 257,279 ----
* equal to the given resolution attribute's value. This is true if all
* of the following conditions are true:
* <UL>
* <LI>
* This attribute's cross feed direction resolution is less than or equal to
! * the {@code other} attribute's cross feed direction resolution.
* <LI>
* This attribute's feed direction resolution is less than or equal to the
! * {@code other} attribute's feed direction resolution.
* </UL>
*
* @param other Resolution attribute to compare with.
*
* @return True if this resolution attribute is less than or equal to the
! * {@code other} resolution attribute, false otherwise.
*
* @exception NullPointerException
! * (unchecked exception) Thrown if {@code other} is null.
*/
public boolean lessThanOrEquals(ResolutionSyntax other) {
return (this.crossFeedResolution <= other.crossFeedResolution &&
this.feedResolution <= other.feedResolution);
}
*** 282,305 ****
/**
* Returns whether this resolution 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 ResolutionSyntax.
* <LI>
* This attribute's cross feed direction resolution is equal to
! * <CODE>object</CODE>'s cross feed direction resolution.
* <LI>
* This attribute's feed direction resolution is equal to
! * <CODE>object</CODE>'s feed direction resolution.
* </OL>
*
* @param object Object to compare to.
*
! * @return True if <CODE>object</CODE> is equivalent to this resolution
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return(object != null &&
--- 282,305 ----
/**
* Returns whether this resolution 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 ResolutionSyntax.
* <LI>
* This attribute's cross feed direction resolution is equal to
! * {@code object}'s cross feed direction resolution.
* <LI>
* This attribute's feed direction resolution is equal to
! * {@code object}'s feed direction resolution.
* </OL>
*
* @param object Object to compare to.
*
! * @return True if {@code object} is equivalent to this resolution
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return(object != null &&
*** 318,328 ****
((feedResolution & 0x0000FFFF) << 16));
}
/**
* Returns a string version of this resolution attribute. The string takes
! * the form <CODE>"<I>C</I>x<I>F</I> dphi"</CODE>, where <I>C</I> is the
* cross feed direction resolution and <I>F</I> is the feed direction
* resolution. The values are reported in the internal units of dphi.
*/
public String toString() {
StringBuilder result = new StringBuilder();
--- 318,328 ----
((feedResolution & 0x0000FFFF) << 16));
}
/**
* Returns a string version of this resolution attribute. The string takes
! * the form <code>"<I>C</I>x<I>F</I> dphi"</code>, where <I>C</I> is the
* cross feed direction resolution and <I>F</I> is the feed direction
* resolution. The values are reported in the internal units of dphi.
*/
public String toString() {
StringBuilder result = new StringBuilder();
< prev index next >