Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media
Class Format

    java.lang.Object
      org.monte.media.Format

    public class Format

extends java.lang.Object

Specifies the format of a media, for example of audio and video.

Version:
  $Id: Format.java 186 2012-03-28 11:18:42Z werner $
Author:
  Werner Randelshofer

Constructor Summary
`Format(java.util.Map<FormatKey,java.lang.Object> properties)` Creates a new format onlyWith the specified properties.
`Format(java.lang.Object... p)` Creates a new format onlyWith the specified properties.

Method Summary
`Format` | `append(Format that)` Creates a new format which contains all properties from this format and additional properties from that format.
`boolean` | `containsKey(FormatKey key)`
`Format` | `containsKeys(FormatKey... keys)` Returns true if the format has the specified keys.
`
`<T> T`
` | `get(FormatKey<T> key)`
`
`<T> T`
` | `get(FormatKey<T> key, T defaultValue)`
`java.util.Set<FormatKey>` | `getKeys()` Gets the keys of the format as an unmodifiable set.
`java.util.Map<FormatKey,java.lang.Object>` | `getProperties()` Gets the properties of the format as an unmodifiable map.
`Format` | `intersectKeys(FormatKey... keys)` Creates a new format which only has the specified keys (or less).
`boolean` | `matches(Format that)` Returns true if that format matches this format.
`Format` | `removeKeys(FormatKey... keys)` Creates a new format without the specified keys.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Format

    public Format(java.util.Map<FormatKey,java.lang.Object> properties)

  Creates a new format onlyWith the specified properties.

### Format

    public Format(java.lang.Object... p)

  Creates a new format onlyWith the specified properties. The properties must be given as key value pairs.

Method Detail

### get

    public <T> T get(FormatKey<T> key)

### get

    public <T> T get(FormatKey<T> key,
                     T defaultValue)

### containsKey

    public boolean containsKey(FormatKey key)

### getProperties

    public java.util.Map<FormatKey,java.lang.Object> getProperties()

  Gets the properties of the format as an unmodifiable map.

### getKeys

    public java.util.Set<FormatKey> getKeys()

  Gets the keys of the format as an unmodifiable set.

### matches

    public boolean matches(Format that)

  Returns true if that format matches this format. That is iff all properties defined in both format objects are identical. Properties which are only defined in one of the format objects are not considered.

  Parameters:
    `that` - Another format.
  Returns:
    True if the other format matches this format.

### append

    public Format append(Format that)

  Creates a new format which contains all properties from this format and additional properties from that format.

  If a property is specified in both formats, then the property value from this format is used. It overwrites that format.

  If one of the format has more properties than the other, then the new format is more specific than this format.

  Parameters:
    `that` -
  Returns:
    That format with properties overwritten by this format.

### intersectKeys

    public Format intersectKeys(FormatKey... keys)

  Creates a new format which only has the specified keys (or less).

  If the keys are reduced, then the new format is less specific than this format.

### removeKeys

    public Format removeKeys(FormatKey... keys)

  Creates a new format without the specified keys.

  If the keys are reduced, then the new format is less specific than this format.

### containsKeys

    public Format containsKeys(FormatKey... keys)

  Returns true if the format has the specified keys.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD