jdk/src/share/classes/javax/sound/midi/MidiFileFormat.java
changeset 26003 d630c97424bd
parent 25131 49006bd0e69d
--- a/jdk/src/share/classes/javax/sound/midi/MidiFileFormat.java	Wed Jul 23 15:44:44 2014 +0400
+++ b/jdk/src/share/classes/javax/sound/midi/MidiFileFormat.java	Wed Jul 23 16:19:26 2014 +0400
@@ -25,29 +25,23 @@
 
 package javax.sound.midi;
 
-import java.io.InputStream;
-import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-
 /**
- * A <code>MidiFileFormat</code> object encapsulates a MIDI file's
- * type, as well as its length and timing information.
- *
- * <p>A <code>MidiFileFormat</code> object can
- * include a set of properties. A property is a pair of key and value:
- * the key is of type <code>String</code>, the associated property
- * value is an arbitrary object.
- * Properties specify additional informational
- * meta data (like a author, or copyright).
- * Properties are optional information, and file reader and file
- * writer implementations are not required to provide or
- * recognize properties.
- *
- * <p>The following table lists some common properties that should
- * be used in implementations:
+ * A {@code MidiFileFormat} object encapsulates a MIDI file's type, as well as
+ * its length and timing information.
+ * <p>
+ * A {@code MidiFileFormat} object can include a set of properties. A property
+ * is a pair of key and value: the key is of type {@code String}, the associated
+ * property value is an arbitrary object. Properties specify additional
+ * informational meta data (like a author, or copyright). Properties are
+ * optional information, and file reader and file writer implementations are not
+ * required to provide or recognize properties.
+ * <p>
+ * The following table lists some common properties that should be used in
+ * implementations:
  *
  * <table border=1>
     <caption>MIDI File Format Properties</caption>
@@ -83,24 +77,21 @@
  *  </tr>
  * </table>
  *
- * @see MidiSystem#getMidiFileFormat(java.io.File)
- * @see Sequencer#setSequence(java.io.InputStream stream)
- *
  * @author Kara Kytle
  * @author Florian Bomers
+ * @see MidiSystem#getMidiFileFormat(java.io.File)
+ * @see Sequencer#setSequence(java.io.InputStream stream)
  */
-
 public class MidiFileFormat {
 
-
     /**
      * Represents unknown length.
+     *
      * @see #getByteLength
      * @see #getMicrosecondLength
      */
     public static final int UNKNOWN_LENGTH = -1;
 
-
     /**
      * The type of MIDI file.
      */
@@ -132,19 +123,22 @@
      */
     protected long microsecondLength;
 
-
-    /** The set of properties */
+    /**
+     * The set of properties.
+     */
     private HashMap<String, Object> properties;
 
-
     /**
-     * Constructs a <code>MidiFileFormat</code>.
+     * Constructs a {@code MidiFileFormat}.
      *
-     * @param type the MIDI file type (0, 1, or 2)
-     * @param divisionType the timing division type (PPQ or one of the SMPTE types)
-     * @param resolution the timing resolution
-     * @param bytes the length of the MIDI file in bytes, or UNKNOWN_LENGTH if not known
-     * @param microseconds the duration of the file in microseconds, or UNKNOWN_LENGTH if not known
+     * @param  type the MIDI file type (0, 1, or 2)
+     * @param  divisionType the timing division type (PPQ or one of the SMPTE
+     *         types)
+     * @param  resolution the timing resolution
+     * @param  bytes the length of the MIDI file in bytes, or UNKNOWN_LENGTH if
+     *         not known
+     * @param  microseconds the duration of the file in microseconds, or
+     *         UNKNOWN_LENGTH if not known
      * @see #UNKNOWN_LENGTH
      * @see Sequence#PPQ
      * @see Sequence#SMPTE_24
@@ -162,21 +156,18 @@
         this.properties = null;
     }
 
-
     /**
-     * Construct a <code>MidiFileFormat</code> with a set of properties.
+     * Construct a {@code MidiFileFormat} with a set of properties.
      *
-     * @param type         the MIDI file type (0, 1, or 2)
-     * @param divisionType the timing division type
-     *      (PPQ or one of the SMPTE types)
-     * @param resolution   the timing resolution
-     * @param bytes the length of the MIDI file in bytes,
-     *      or UNKNOWN_LENGTH if not known
-     * @param microseconds the duration of the file in microseconds,
-     *      or UNKNOWN_LENGTH if not known
-     * @param properties  a <code>Map&lt;String,Object&gt;</code> object
-     *        with properties
-     *
+     * @param  type the MIDI file type (0, 1, or 2)
+     * @param  divisionType the timing division type (PPQ or one of the SMPTE
+     *         types)
+     * @param  resolution the timing resolution
+     * @param  bytes the length of the MIDI file in bytes, or UNKNOWN_LENGTH if
+     *         not known
+     * @param  microseconds the duration of the file in microseconds, or
+     *         UNKNOWN_LENGTH if not known
+     * @param  properties a {@code Map<String,Object>} object with properties
      * @see #UNKNOWN_LENGTH
      * @see Sequence#PPQ
      * @see Sequence#SMPTE_24
@@ -192,10 +183,9 @@
         this.properties = new HashMap<String, Object>(properties);
     }
 
-
-
     /**
      * Obtains the MIDI file type.
+     *
      * @return the file's type (0, 1, or 2)
      */
     public int getType() {
@@ -206,7 +196,6 @@
      * Obtains the timing division type for the MIDI file.
      *
      * @return the division type (PPQ or one of the SMPTE types)
-     *
      * @see Sequence#Sequence(float, int)
      * @see Sequence#PPQ
      * @see Sequence#SMPTE_24
@@ -219,11 +208,10 @@
         return divisionType;
     }
 
-
     /**
-     * Obtains the timing resolution for the MIDI file.
-     * If the division type is PPQ, the resolution is specified in ticks per beat.
-     * For SMTPE timing, the resolution is specified in ticks per frame.
+     * Obtains the timing resolution for the MIDI file. If the division type is
+     * PPQ, the resolution is specified in ticks per beat. For SMTPE timing, the
+     * resolution is specified in ticks per frame.
      *
      * @return the number of ticks per beat (PPQ) or per frame (SMPTE)
      * @see #getDivisionType
@@ -233,9 +221,9 @@
         return resolution;
     }
 
-
     /**
      * Obtains the length of the MIDI file, expressed in 8-bit bytes.
+     *
      * @return the number of bytes in the file, or UNKNOWN_LENGTH if not known
      * @see #UNKNOWN_LENGTH
      */
@@ -245,7 +233,9 @@
 
     /**
      * Obtains the length of the MIDI file, expressed in microseconds.
-     * @return the file's duration in microseconds, or UNKNOWN_LENGTH if not known
+     *
+     * @return the file's duration in microseconds, or UNKNOWN_LENGTH if not
+     *         known
      * @see Sequence#getMicrosecondLength()
      * @see #getByteLength
      * @see #UNKNOWN_LENGTH
@@ -255,14 +245,11 @@
     }
 
     /**
-     * Obtain an unmodifiable map of properties.
-     * The concept of properties is further explained in
-     * the {@link MidiFileFormat class description}.
+     * Obtain an unmodifiable map of properties. The concept of properties is
+     * further explained in the {@link MidiFileFormat class description}.
      *
-     * @return a <code>Map&lt;String,Object&gt;</code> object containing
-     *         all properties. If no properties are recognized, an empty map is
-     *         returned.
-     *
+     * @return a {@code Map<String,Object>} object containing all properties. If
+     *         no properties are recognized, an empty map is returned.
      * @see #getProperty(String)
      * @since 1.5
      */
@@ -277,20 +264,16 @@
         return Collections.unmodifiableMap(ret);
     }
 
-
     /**
-     * Obtain the property value specified by the key.
-     * The concept of properties is further explained in
-     * the {@link MidiFileFormat class description}.
+     * Obtain the property value specified by the key. The concept of properties
+     * is further explained in the {@link MidiFileFormat class description}.
+     * <p>
+     * If the specified property is not defined for a particular file format,
+     * this method returns {@code null}.
      *
-     * <p>If the specified property is not defined for a
-     * particular file format, this method returns
-     * <code>null</code>.
-     *
-     * @param key the key of the desired property
-     * @return the value of the property with the specified key,
-     *         or <code>null</code> if the property does not exist.
-     *
+     * @param  key the key of the desired property
+     * @return the value of the property with the specified key, or {@code null}
+     *         if the property does not exist
      * @see #properties()
      * @since 1.5
      */
@@ -300,6 +283,4 @@
         }
         return properties.get(key);
     }
-
-
 }