|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.Format
A Format
abstracts an exact media format.
It carries no encoding-specific parameters
or timing information global to the presentation.
Format
object have to be specified.
This enables selected attributes to be specified, making it possible to
locate a supported Format
that meets certain requirements without needing to
find an exact match.
Two methods are provided for comparing Formats
.
The equals
method returns true
if two Format
objects are exactly the same--they're the same type and all of their attributes are the
same. The matches
method relaxes the comparison, comparing
only the attributes that are explicitly specified in the Format
you are comparing.
Field Summary | |
static java.lang.Class |
byteArray
The data object required by the Format is a byte array. |
protected java.lang.Class |
clz
|
protected java.lang.Class |
dataType
|
protected java.lang.String |
encoding
|
static int |
FALSE
|
static java.lang.Class |
formatArray
The data object required by the Format is an array of Format objects. |
static java.lang.Class |
intArray
The data object required by the Format is an integer array. |
static int |
NOT_SPECIFIED
|
static java.lang.Class |
shortArray
The data object required by the Format is a short array. |
static int |
TRUE
|
Constructor Summary | |
Format(java.lang.String encoding)
Constructs a Format that has the specified encoding type. |
|
Format(java.lang.String encoding,
java.lang.Class dataType)
Constructs a Format that has the specified encoding and data types. |
Method Summary | |
java.lang.Object |
clone()
Creates a clone of this Format . |
protected void |
copy(Format f)
Copies the attributes from the specified Format into this Format . |
boolean |
equals(java.lang.Object format)
Checks whether or not the specified Format is the same as this Format . |
java.lang.Class |
getDataType()
Gets the type of the data that this Format requires. |
java.lang.String |
getEncoding()
Gets the uniquely-qualified encoding name for this Format . |
Format |
intersects(Format other)
Intersects the attributes of this format and the specified format to create a new Format object. |
boolean |
matches(Format format)
Checks whether or not the specified Format matches this Format . |
Format |
relax()
Generate a format that's less restrictive than this format but contains the basic attributes that will make this resulting format useful for format matching. |
java.lang.String |
toString()
Gets a String representation of the Format attributes. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int NOT_SPECIFIED
public static final int TRUE
public static final int FALSE
protected java.lang.String encoding
public static final java.lang.Class intArray
Format
is an integer array.public static final java.lang.Class shortArray
Format
is a short array.public static final java.lang.Class byteArray
Format
is a byte array.public static final java.lang.Class formatArray
Format
is an array of Format
objects.protected java.lang.Class dataType
protected java.lang.Class clz
Constructor Detail |
public Format(java.lang.String encoding)
Format
that has the specified encoding type.encoding
- A String
that contains the encoding
type of the Format
to be constructed.public Format(java.lang.String encoding, java.lang.Class dataType)
Format
that has the specified encoding and data types.encoding
- A String
that contains the encoding
type of the Format
to be constructed.dataType
- The type of data object required by the Format
to be constructed,
such as:
byteArray
, intArray
, or shortArray
.
For example, for a byte array the data type would be "Format.byteArray
".Method Detail |
public java.lang.String getEncoding()
Format
.
In the reference implementation of JMF, these strings follow the QuickTime codec strings.
Format
.public java.lang.Class getDataType()
Format
requires.
For example, for byte array it returns "byte[].class
".Format
.public boolean equals(java.lang.Object format)
Format
is the same as this Format
.
To be equal, the two Formats
must be of the same type and all of their attributes must be the same.format
- The Format
to compare with this one.true
if the specified Format
is the same as this one, false
if it is not.public boolean matches(Format format)
Format
matches this Format
.
Matches only compares the attributes that are defined in the specified Format
,
unspecified attributes are ignored.
The two Format
objects do not have to be of the same class to
match. For example, if "A" are "B" are being compared, a
match is possible if "A" is derived from "B"
or "B" is derived from "A". (The compared attributes must still match, or matches
fails.)
format
- The Format
to compare with this one.true
if the specified Format
matches this one, false
if it does not.public Format intersects(Format other)
Format
object. The two objects being intersected should either be of the
same type or one should be a subclass of the other. The resulting object will be
the same type as the subclass. Common attributes are intersected as follows: If both objects have NOT_SPECIFIED values for an attribute, the result will also have a NOT_SPECIFIED value. If one of them has a NOT_SPECIFIED value then the result will have the value that is specified in the other object. If both objects have specified values then the value in this object will be used.
Attributes that are specific to the subclass will be carried forward to the result.
other
- The Format
object to intersect with this
Format
.Format
object
with its attributes set to those attributes common to both Format
objects.matches(javax.media.Format)
public Format relax()
Format
that's less restrictive than the
this format.public java.lang.Object clone()
Format
.protected void copy(Format f)
Format
into this Format
.f
- The Format
to copy the attributes from.public java.lang.String toString()
String
representation of the Format
attributes.
For example: "PCM, 44.1 KHz, Stereo, Signed".String
that describes the Format
attributes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |