216 /**
217 * Obtains the length of the audio data contained in the file, expressed in
218 * sample frames.
219 *
220 * @return the number of sample frames of audio data in the file
221 * @see AudioSystem#NOT_SPECIFIED
222 */
223 public int getFrameLength() {
224 return frameLength;
225 }
226
227 /**
228 * Obtain an unmodifiable map of properties. The concept of properties is
229 * further explained in the {@link AudioFileFormat class description}.
230 *
231 * @return a {@code Map<String, Object>} object containing all properties.
232 * If no properties are recognized, an empty map is returned.
233 * @see #getProperty(String)
234 * @since 1.5
235 */
236 public Map<String, Object> properties() {
237 Map<String,Object> ret;
238 if (properties == null) {
239 ret = new HashMap<String,Object>(0);
240 } else {
241 ret = (Map<String,Object>) (properties.clone());
242 }
243 return Collections.unmodifiableMap(ret);
244 }
245
246 /**
247 * Obtain the property value specified by the key. The concept of properties
248 * is further explained in the {@link AudioFileFormat class description}.
249 * <p>
250 * If the specified property is not defined for a particular file format,
251 * this method returns {@code null}.
252 *
253 * @param key the key of the desired property
254 * @return the value of the property with the specified key, or {@code null}
255 * if the property does not exist
256 * @see #properties()
257 * @since 1.5
258 */
259 public Object getProperty(String key) {
|
216 /**
217 * Obtains the length of the audio data contained in the file, expressed in
218 * sample frames.
219 *
220 * @return the number of sample frames of audio data in the file
221 * @see AudioSystem#NOT_SPECIFIED
222 */
223 public int getFrameLength() {
224 return frameLength;
225 }
226
227 /**
228 * Obtain an unmodifiable map of properties. The concept of properties is
229 * further explained in the {@link AudioFileFormat class description}.
230 *
231 * @return a {@code Map<String, Object>} object containing all properties.
232 * If no properties are recognized, an empty map is returned.
233 * @see #getProperty(String)
234 * @since 1.5
235 */
236 @SuppressWarnings("unchecked") // Cast of result of clone
237 public Map<String, Object> properties() {
238 Map<String,Object> ret;
239 if (properties == null) {
240 ret = new HashMap<>(0);
241 } else {
242 ret = (Map<String,Object>) (properties.clone());
243 }
244 return Collections.unmodifiableMap(ret);
245 }
246
247 /**
248 * Obtain the property value specified by the key. The concept of properties
249 * is further explained in the {@link AudioFileFormat class description}.
250 * <p>
251 * If the specified property is not defined for a particular file format,
252 * this method returns {@code null}.
253 *
254 * @param key the key of the desired property
255 * @return the value of the property with the specified key, or {@code null}
256 * if the property does not exist
257 * @see #properties()
258 * @since 1.5
259 */
260 public Object getProperty(String key) {
|