|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.document.MimeMediaType
This class is a utility class with mostly provides the common parsing features needed to deal with MIME media types. FIXME bondolo@jxta.org 20010219 Doesnt yet handle parameters
Document
,
StructuredDocument
,
StructuredTextDocument
Constructor Summary | |
MimeMediaType(java.lang.String someString)
Creates a new MimeMediaType |
|
MimeMediaType(java.lang.String type,
java.lang.String subtype)
Creates a new type/subtype MimeMediaType |
|
MimeMediaType(java.lang.String type,
java.lang.String subtype,
java.lang.String parameters)
Creates a new type/subtype MimeMediaType |
|
MimeMediaType(java.lang.String type,
java.lang.String subtype,
java.lang.String[] parameters)
Creates a new type/subtype MimeMediaType |
Method Summary | |
void |
addParameter(java.lang.String newParam)
Add parameter to a mime-type |
java.lang.Object |
clone()
Creates a new object of the same class as this object. |
boolean |
equals(java.lang.Object obj)
Compares two Objects for equality. |
java.lang.String |
getMimeMediaType()
Get the full mime-type/subtype |
java.util.Enumeration |
getParameters()
Get parameters value of a mime-type |
java.lang.String |
getSubtype()
Get the Subtype of the mime-type |
java.lang.String |
getType()
Get type of the mime-type |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isExperimentalSubtype()
Check if the mime-type is for debugging. |
boolean |
isExperimentalType()
Check if the mime-type is for provisional. |
boolean |
isValid()
Check if mime-type is valid |
void |
setParameters(java.lang.String[] parameters)
Set parameter to a mime-type |
void |
setSubtype(java.lang.String subtype)
Set the subtype of MimeMediaType |
void |
setType(java.lang.String type)
Set the type of MimeMediaType |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public MimeMediaType(java.lang.String someString)
someString
- string representing a mime-typepublic MimeMediaType(java.lang.String type, java.lang.String subtype)
type
- string representing a mime typesubtype
- string representing a mime subtypepublic MimeMediaType(java.lang.String type, java.lang.String subtype, java.lang.String parameters)
type
- string representing a mime typesubtype
- string representing a mime subtypeparameters
- parameters to the mime-type constructorpublic MimeMediaType(java.lang.String type, java.lang.String subtype, java.lang.String[] parameters)
type
- string representing a mime typesubtype
- string representing a mime subtypeparameters[]
- array of parameters to the mime-type constructorMethod Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
The clone
method of class Object
will
only clone an object whose class indicates that it is willing for
its instances to be cloned. A class indicates that its instances
can be cloned by declaring that it implements the
Cloneable
interface.
Cloneable
interface. Subclasses
that override the clone
method can also
throw this exception to indicate that an instance cannot
be cloned.public boolean equals(java.lang.Object obj)
The equals
method implements an equivalence relation:
x
,
x.equals(x)
should return true
.
x
and
y
, x.equals(y)
should return
true
if and only if y.equals(x)
returns
true
.
x
,
y
, and z
, if x.equals(y)
returns true
and y.equals(z)
returns
true
, then x.equals(z)
should return
true
.
x
and y
, multiple invocations of x.equals(y)
consistently return true
or consistently return
false
.
x
, x.equals(null)
should return false
.
The equals method for class Object
implements the most
discriminating possible equivalence relation on objects; that is,
for any reference values x
and y
, this
method returns true
if and only if x
and
y
refer to the same object (x==y
has the
value true
).
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.public int hashCode()
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer. This integer need not
remain consistent from one execution of an application to another
execution of the same application.
equals
method, then calling the hashCode
method on each of the
two objects must produce the same integer result.
public java.lang.String toString()
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommendedthat all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object.
public boolean isValid()
public java.lang.String getMimeMediaType()
public java.lang.String getType()
public boolean isExperimentalType()
public void setType(java.lang.String type)
type
- type valuepublic java.lang.String getSubtype()
public boolean isExperimentalSubtype()
public void setSubtype(java.lang.String subtype)
subtype
- subtype valuepublic java.util.Enumeration getParameters()
public void setParameters(java.lang.String[] parameters)
parameters
- array of parameterspublic void addParameter(java.lang.String newParam)
newParam
- new parameter to add to the type
|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |