diff options
author | Wolfgang Baer <WBaer@gmx.de> | 2006-01-16 09:09:10 +0000 |
---|---|---|
committer | Wolfgang Baer <WBaer@gmx.de> | 2006-01-16 09:09:10 +0000 |
commit | e96dc2f08d8f29107c3da79af19a819b3bcabfad (patch) | |
tree | 66f13ff2216e47a2009d0f1a00281515071e9654 /javax/print/attribute | |
parent | 6cc56c9479bb0f5eda24084ff09f5535c11ad294 (diff) | |
download | classpath-e96dc2f08d8f29107c3da79af19a819b3bcabfad.tar.gz |
2006-01-16 Wolfgang Baer <WBaer@gmx.de>
* javax/print/attribute/standard/MediaSize.java:
(static_initializer): Added comment.
(MediaSize): Added javadoc to mention cache registration.
(MediaSize): Likewise.
(MediaSize): Likewise.
(MediaSize): Likewise.
Diffstat (limited to 'javax/print/attribute')
-rw-r--r-- | javax/print/attribute/standard/MediaSize.java | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/javax/print/attribute/standard/MediaSize.java b/javax/print/attribute/standard/MediaSize.java index d43cfaa50..2434b6260 100644 --- a/javax/print/attribute/standard/MediaSize.java +++ b/javax/print/attribute/standard/MediaSize.java @@ -72,7 +72,14 @@ public class MediaSize extends Size2DSyntax static { mediaCache = new ArrayList(); - + + // We call one instance of every container class to make sure it gets + // loaded during class initialization and therefore all other static + // fields of this container class also. + + // This is needed to put all MediaSize instance into the mediaCache + // for use by the static methods in this class. + MediaSize tmp = MediaSize.ISO.A0; tmp = MediaSize.JIS.B0; tmp = MediaSize.Engineering.A; @@ -83,13 +90,18 @@ public class MediaSize extends Size2DSyntax private MediaSizeName media; /** - * Creates a <code>MediaSize</code> object. + * Creates a <code>MediaSize</code> object. The created object will be added + * to an internal cache used in the static methods of this class for lookup + * of available <code>MediaSize</code> instances. * * @param x the size in x direction * @param y the size in y direction * @param units the units to use for the sizes * * @exception IllegalArgumentException if x or y < 0 or units < 1 + * + * @see #findMedia(float, float, int) + * @see #getMediaSizeForName(MediaSizeName) */ public MediaSize(float x, float y, int units) { @@ -99,7 +111,9 @@ public class MediaSize extends Size2DSyntax /** * Creates a <code>MediaSize</code> object associated with the given - * media name. + * media name. The created object will be added to an internal cache used + * in the static methods of this class for lookup of available + * <code>MediaSize</code> instances. * * @param x the size in x direction * @param y the size in y direction @@ -107,6 +121,9 @@ public class MediaSize extends Size2DSyntax * @param media the media name to associate * * @exception IllegalArgumentException if x or y < 0 or units < 1 + * + * @see #findMedia(float, float, int) + * @see #getMediaSizeForName(MediaSizeName) */ public MediaSize(float x, float y, int units, MediaSizeName media) { @@ -116,13 +133,18 @@ public class MediaSize extends Size2DSyntax } /** - * Creates a <code>MediaSize</code> object. + * Creates a <code>MediaSize</code> object. The created object will be added + * to an internal cache used in the static methods of this class for lookup + * of available <code>MediaSize</code> instances. * * @param x the size in x direction * @param y the size in y direction * @param units the units to use for the sizes * * @exception IllegalArgumentException if x or y < 0 or units < 1 + * + * @see #findMedia(float, float, int) + * @see #getMediaSizeForName(MediaSizeName) */ public MediaSize(int x, int y, int units) { @@ -132,7 +154,9 @@ public class MediaSize extends Size2DSyntax /** * Creates a <code>MediaSize</code> object associated with the given - * media name. + * media name. The created object will be added to an internal cache used + * in the static methods of this class for lookup of available + * <code>MediaSize</code> instances. * * @param x the size in x direction * @param y the size in y direction @@ -140,6 +164,9 @@ public class MediaSize extends Size2DSyntax * @param media the media name to associate * * @exception IllegalArgumentException if x or y < 0 or units < 1 + * + * @see #findMedia(float, float, int) + * @see #getMediaSizeForName(MediaSizeName) */ public MediaSize(int x, int y, int units, MediaSizeName media) { |