MimeType encapsulates a Multipurpose Internet Mail Extensions
(MIME) media type as defined in
RFC 2045 and
RFC 2046. A MIME type
object is part of a DocFlavor object and specifies the
format of the print data.
Class MimeType is similar to the like-named class in package
java.. Class
java. is not used in the Jini Print Service
API for two reasons:
java.awt.datatransfer.MimeType does
not guarantee that equivalent MIME types will have the same serialized
representation. Thus, since the Jini Lookup Service (JLUS) matches service
attributes based on equality of serialized representations, JLUS searches
involving MIME types encapsulated in class
java.awt.datatransfer.MimeType may incorrectly fail to match.
| Modifier and Type | Class and Description |
|---|---|
| private static class | MimeType.
Class for a lexical analyzer. |
| private class | MimeType.
Parameter map. |
| private class | MimeType.
Parameter map entry. |
| private class | MimeType.
Parameter map entry set. |
| private class | MimeType.
Parameter map entry set iterator. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private transient MimeType. | myEntrySet
Parameter map entry set. |
| private transient MimeType. | myParameterMap
Parameter map. |
| private String[] | myPieces
Array of strings that hold pieces of this MIME type's canonical form. |
| private transient String | myStringValue
String value for this MIME type. |
| private static final int | |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability. |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public boolean | Returns: true if this MIME type object equals obj,
false otherwiseobject to testOverrides java. Determine if this MIME type object is equal to the given object. |
| public String | |
| public String | |
| public String | Returns: the mime typeReturns this MIME type object's MIME type string based on the canonical form. |
| public Map | Returns: parameter map for this MIME type objectReturns an unmodifiable map view of the parameters in this MIME type object. |
| private String | Returns: the MIME type's string value in canonical formReturns this MIME type's string value in canonical form. |
| public int | |
| private void | |
| private static String | Returns: the string with backslashes removedthe string s)Returns a version of the given string with backslashes removed. |
| public String | Returns: MIME type string based on the canonical form. Each parameter value is enclosed in quotes.Overrides java. Converts this MIME type object to a string. |
| private static String | Returns: the lowercase version of the stringthe string s)Returns a lowercase version of the given string. |
| EOF_LEXEME | back to summary |
|---|---|
| private static final int EOF_LEXEME | |
| ILLEGAL_LEXEME | back to summary |
|---|---|
| private static final int ILLEGAL_LEXEME | |
| myEntrySet | back to summary |
|---|---|
| private transient MimeType. Parameter map entry set. Computed when needed and cached. | |
| myParameterMap | back to summary |
|---|---|
| private transient MimeType. Parameter map. Computed when needed and cached. | |
| myPieces | back to summary |
|---|---|
| private String[] myPieces Array of strings that hold pieces of this MIME type's canonical form. If
the MIME type has n parameters, n >= 0, then the
strings in the array are:
| |
| myStringValue | back to summary |
|---|---|
| private transient String myStringValue String value for this MIME type. Computed when needed and cached. | |
| QUOTED_STRING_LEXEME | back to summary |
|---|---|
| private static final int QUOTED_STRING_LEXEME | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.4 for interoperability. | |
| TOKEN_LEXEME | back to summary |
|---|---|
| private static final int TOKEN_LEXEME | |
| TSPECIAL_LEXEME | back to summary |
|---|---|
| private static final int TSPECIAL_LEXEME | |
| MimeType | back to summary |
|---|---|
| public MimeType(String s) Construct a new MIME type object from the given string. The given string is converted into canonical form and stored internally.
| |
| addQuotes | back to summary |
|---|---|
| private static String addQuotes(String s) Returns a version of the string surrounded by quotes and with interior quotes preceded by a backslash. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determine if this MIME type object is equal to the given object. The two
are equal if the given object is not
| |
| getMediaSubtype | back to summary |
|---|---|
| public String getMediaSubtype() Returns this MIME type object's media subtype.
| |
| getMediaType | back to summary |
|---|---|
| public String getMediaType() Returns this MIME type object's media type.
| |
| getMimeType | back to summary |
|---|---|
| public String getMimeType() Returns this MIME type object's MIME type string based on the canonical form. Each parameter value is enclosed in quotes.
| |
| getParameterMap | back to summary |
|---|---|
| public Map Returns an unmodifiable map view of the parameters in this MIME type
object. Each entry in the parameter map view consists of a parameter name
| |
| getStringValue | back to summary |
|---|---|
| private String getStringValue() Returns this MIME type's string value in canonical form.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code for this MIME type object. | |
| parse | back to summary |
|---|---|
| private void parse(String s) Parses the given string into canonical pieces and stores the pieces in
Special rules applied:
| |
| removeBackslashes | back to summary |
|---|---|
| private static String removeBackslashes(String s) Returns a version of the given string with backslashes removed. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Converts this MIME type object to a string.
| |
| toUnicodeLowerCase | back to summary |
|---|---|
| private static String toUnicodeLowerCase(String s) Returns a lowercase version of the given string. The lowercase version is
constructed by applying | |
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected int | |
| protected int | |
| protected int | |
| protected String | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public char | |
| public int | |
| public void |
| myCurrentIndex | back to summary |
|---|---|
| protected int myCurrentIndex | |
| myLexemeBeginIndex | back to summary |
|---|---|
| protected int myLexemeBeginIndex | |
| myLexemeEndIndex | back to summary |
|---|---|
| protected int myLexemeEndIndex | |
| myLexemeType | back to summary |
|---|---|
| protected int myLexemeType | |
| mySource | back to summary |
|---|---|
| protected String mySource | |
| mySourceLength | back to summary |
|---|---|
| protected int mySourceLength | |
| LexicalAnalyzer | back to summary |
|---|---|
| public LexicalAnalyzer(String theSource) | |
| getLexeme | back to summary |
|---|---|
| public String getLexeme() | |
| getLexemeFirstCharacter | back to summary |
|---|---|
| public char getLexemeFirstCharacter() | |
| getLexemeType | back to summary |
|---|---|
| public int getLexemeType() | |
| nextLexeme | back to summary |
|---|---|
| public void nextLexeme() | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Set | entrySet()
Implements abstract java. Implements java. Returns a |
| ParameterMap | back to summary |
|---|---|
| private ParameterMap() | |
| entrySet | back to summary |
|---|---|
| public Set Implements abstract java. Implements java. Doc from java. Returns a | |
| Modifier and Type | Field and Description |
|---|---|
| private int | myIndex
The index of the entry. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Implements java. Compares the specified object with this entry for equality. |
| public String | |
| public String | |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map entry. |
| public String | setValue(String value)
Implements java. Replaces the value corresponding to this entry with the specified value (optional operation). |
| myIndex | back to summary |
|---|---|
| private int myIndex The index of the entry. | |
| ParameterMapEntry | back to summary |
|---|---|
| public ParameterMapEntry(int theIndex) Constructs a new parameter map entry.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this entry for equality.
Returns
(e1.getKey()==null ?
e2.getKey()==null : e1.getKey().equals(e2.getKey())) &&
(e1.getValue()==null ?
e2.getValue()==null : e1.getValue().equals(e2.getValue()))
This ensures that the equals method works properly across
different implementations of the Map.Entry interface.
| |
| getKey | back to summary |
|---|---|
| public String getKey() Implements java. Doc from java. Returns the key corresponding to this entry. | |
| getValue | back to summary |
|---|---|
| public String getValue() Implements java. Doc from java. Returns the value corresponding to this entry. If the mapping
has been removed from the backing map (by the iterator's
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map entry. The hash code
of a map entry
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^
(e.getValue()==null ? 0 : e.getValue().hashCode())
This ensures that e1.equals(e2) implies that
e1.hashCode()==e2.hashCode() for any two Entries
e1 and e2, as required by the general
contract of Object.hashCode.
| |
| setValue | back to summary |
|---|---|
| public String setValue(String value) Implements java. Doc from java. Replaces the value corresponding to this entry with the specified
value (optional operation). (Writes through to the map.) The
behavior of this call is undefined if the mapping has already been
removed from the map (by the iterator's | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Iterator | iterator()
Implements abstract java. Implements java. Returns an iterator over the elements in this set. |
| public int | size()
Implements abstract java. Implements java. Returns the number of elements in this set (its cardinality). |
| ParameterMapEntrySet | back to summary |
|---|---|
| private ParameterMapEntrySet() | |
| iterator | back to summary |
|---|---|
| public Iterator Implements abstract java. Implements java. Doc from java. Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee). | |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this set (its cardinality). If this
set contains more than | |
| Modifier and Type | Field and Description |
|---|---|
| private int | myIndex
The current index of the iterator. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Map. | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| myIndex | back to summary |
|---|---|
| private int myIndex The current index of the iterator. | |
| ParameterMapEntrySetIterator | back to summary |
|---|---|
| private ParameterMapEntrySetIterator() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns | |
| next | back to summary |
|---|---|
| public Map. Implements java. Doc from java. Returns the next element in the iteration. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |