< prev index next >

src/java.desktop/share/classes/javax/swing/text/StyleContext.java

Print this page

        

@@ -477,11 +477,11 @@
      * Create a compact set of attributes that might be shared.
      * This is a hook for subclasses that want to alter the
      * behavior of SmallAttributeSet.  This can be reimplemented
      * to return an AttributeSet that provides some sort of
      * attribute conversion.
-     *
+     * @return a compact set of attributes that might be shared
      * @param a The set of attributes to be represented in the
      *  the compact form.
      */
     protected SmallAttributeSet createSmallAttributeSet(AttributeSet a) {
         return new SmallAttributeSet(a);

@@ -494,10 +494,12 @@
      * of the larger attribute storage format (which is
      * SimpleAttributeSet by default).   This can be reimplemented
      * to return a MutableAttributeSet that provides some sort of
      * attribute conversion.
      *
+     * @return a large set of attributes that should trade off
+     * space for time
      * @param a The set of attributes to be represented in the
      *  the larger form.
      */
     protected MutableAttributeSet createLargeAttributeSet(AttributeSet a) {
         return new SimpleAttributeSet(a);

@@ -556,18 +558,28 @@
 
     // --- serialization ---------------------------------------------
 
     /**
      * Context-specific handling of writing out attributes
+     * @param out the output stream
+     * @param a the attribute set
+     * @exception IOException on any I/O error
      */
     public void writeAttributes(ObjectOutputStream out,
                                   AttributeSet a) throws IOException {
         writeAttributeSet(out, a);
     }
 
     /**
      * Context-specific handling of reading in attributes
+     * @param in the object stream to read the attribute data from.
+     * @param a  the attribute set to place the attribute
+     *   definitions in.
+     * @exception ClassNotFoundException passed upward if encountered
+     *  when reading the object stream.
+     * @exception IOException passed upward if encountered when
+     *  reading the object stream.
      */
     public void readAttributes(ObjectInputStream in,
                                MutableAttributeSet a) throws ClassNotFoundException, IOException {
         readAttributeSet(in, a);
     }

@@ -683,22 +695,27 @@
     }
 
     /**
      * Returns the object previously registered with
      * <code>registerStaticAttributeKey</code>.
+     * @return Returns the object previously registered with
+     * {@code registerStaticAttributeKey}
+     * @param key the object key
      */
     public static Object getStaticAttribute(Object key) {
         if (thawKeyMap == null || key == null) {
             return null;
         }
         return thawKeyMap.get(key);
     }
 
     /**
-     * Returns the String that <code>key</code> will be registered with
+     * Returns the String that <code>key</code> will be registered with.
+     * @return the String that {@code key} will be registered with
      * @see #getStaticAttribute
      * @see #registerStaticAttributeKey
+     * @param key the object key
      */
     public static Object getStaticAttributeKey(Object key) {
         return key.getClass().getName() + "." + key.toString();
     }
 

@@ -770,15 +787,23 @@
      * default, this is the class that will be used to store attributes
      * when held in the compact sharable form.
      */
     public class SmallAttributeSet implements AttributeSet {
 
+        /**
+         * Constructs a SmallAttributeSet.
+         * @param attributes the attributes
+         */
         public SmallAttributeSet(Object[] attributes) {
             this.attributes = attributes;
             updateResolveParent();
         }
 
+        /**
+         * Constructs a SmallAttributeSet.
+         * @param attrs the attributes
+         */
         public SmallAttributeSet(AttributeSet attrs) {
             int n = attrs.getAttributeCount();
             Object[] tbl = new Object[2 * n];
             Enumeration<?> names = attrs.getAttributeNames();
             int i = 0;

@@ -816,11 +841,12 @@
         }
 
         // --- Object methods -------------------------
 
         /**
-         * Returns a string showing the key/value pairs
+         * Returns a string showing the key/value pairs.
+         * @return a string showing the key/value pairs
          */
         public String toString() {
             String s = "{";
             Object[] tbl = attributes;
             for (int i = 0; i < tbl.length; i += 2) {

@@ -1380,11 +1406,12 @@
         }
 
         /**
          * Return an array of all the listeners of the given type that
          * were added to this model.
-         *
+         * @param <T> the listener type
+         * @param listenerType the type of listeners requested
          * @return all of the objects receiving <em>listenerType</em> notifications
          *          from this model
          *
          * @since 1.3
          */
< prev index next >