PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|Java|javax|print|MimeType.java =

page 2 of 7



     */
    private class ParameterMapEntry implements Map.Entry {
	private int myIndex;
	public ParameterMapEntry(int theIndex) {
	    myIndex = theIndex;
	}
	public Object getKey(){
	    return myPieces[myIndex];
	}
	public Object getValue(){ 
	    return myPieces[myIndex+1];
	}
	public Object setValue (Object value) {
	    throw new UnsupportedOperationException();
	}
	public boolean equals(Object o) {
	    return (o != null &&
		    o instanceof Map.Entry &&
		    getKey().equals (((Map.Entry) o).getKey()) &&
		    getValue().equals(((Map.Entry) o).getValue()));
	}
	public int hashCode() {
	    return getKey().hashCode() ^ getValue().hashCode();
	}
    }

    /**
     * Parameter map entry set iterator.
     */
    private class ParameterMapEntrySetIterator implements Iterator {
	private int myIndex = 2;
	public boolean hasNext() {
	    return myIndex < myPieces.length;
	}
	public Object next() {
	    if (hasNext()) {
		ParameterMapEntry result = new ParameterMapEntry (myIndex);
		myIndex += 2;
		return result;
	    } else {
		throw new NoSuchElementException();
	    }
	}
	public void remove() {
	    throw new UnsupportedOperationException();
	}
    }

    /**
     * Parameter map entry set.
     */
    private class ParameterMapEntrySet extends AbstractSet {
	public Iterator iterator() {
	    return new ParameterMapEntrySetIterator();
	}
	public int size() {
	    return (myPieces.length - 2) / 2;
	}
    }

    /**
     * Parameter map.
     */
    private class ParameterMap extends AbstractMap {
	public Set entrySet() {
	    if (myEntrySet == null) {
		myEntrySet = new ParameterMapEntrySet();
	    }
	    return myEntrySet;
	}
    }

    /**
     * Construct a new MIME type object from the given string. The given  
     * string is converted into canonical form and stored internally.
     *
     * @param  s  MIME media type string.
     *
     * @exception  NullPointerException
     *     (unchecked exception) Thrown if <CODE>s</CODE> is null. 
     * @exception  IllegalArgumentException
     *     (unchecked exception) Thrown if <CODE>s</CODE> does not obey the 
     *     syntax for a MIME media type string. 
     */
    public MimeType(String s) {
	parse (s);
    }

    /**
     * Returns this MIME type object's MIME type string based on the canonical 
     * form. Each parameter value is enclosed in quotes. 
     */
    public String getMimeType() {
	return getStringValue();
    }
    
    /**
     * Returns this MIME type object's media type.
     */
    public String getMediaType() {
=2=

1| < PREV = PAGE 2 = NEXT > |3|4|5|6|7

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.0873671 wallclock secs ( 0.01 usr + 0.01 sys = 0.02 CPU)