org.melati.util
Class AcceptCharset.CharsetAndQValue

Package class diagram package AcceptCharset.CharsetAndQValue
java.lang.Object
  extended by org.melati.util.HttpHeader.TokenAndQValue
      extended by org.melati.util.AcceptCharset.CharsetAndQValue
Enclosing class:
AcceptCharset

public static class AcceptCharset.CharsetAndQValue
extends HttpHeader.TokenAndQValue

A charset and associated qvalue.


Field Summary
 int position
          An integer that indicates where this charset was explicitly specified in Accept-Charset relative to others.
 int serverPreferability
          An integer that is less for more preferable instances from server point of view.
 
Fields inherited from class org.melati.util.HttpHeader.TokenAndQValue
q, token
 
Constructor Summary
AcceptCharset.CharsetAndQValue(Charset charset, AcceptCharset.CharsetAndQValue wildcard)
          Creates an instance for the given Charset using the q value from a parsed wildcard Accept-Charset field.
AcceptCharset.CharsetAndQValue(Charset charset, float q)
          Creates an instance for the given charset and q value.
AcceptCharset.CharsetAndQValue(HttpHeader.Tokenizer t)
          Create an instance and initialize it by reading a tokenizer.
 
Method Summary
 boolean isWildcard()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverPreferability

public int serverPreferability
An integer that is less for more preferable instances from server point of view.

It might be the index of the array of supported server preferences or Integer.MAX_VALUE.


position

public int position
An integer that indicates where this charset was explicitly specified in Accept-Charset relative to others.

This increases left to right so it could be the actual position but need not be.

It is Integer.MAX_VALUE if the charset was not explicitly specified, regardless of the position of any wildcard.

Constructor Detail

AcceptCharset.CharsetAndQValue

public AcceptCharset.CharsetAndQValue(HttpHeader.Tokenizer t)
Create an instance and initialize it by reading a tokenizer.

Parameters:
t - tokenizer

AcceptCharset.CharsetAndQValue

public AcceptCharset.CharsetAndQValue(Charset charset,
                                      float q)
Creates an instance for the given charset and q value.


AcceptCharset.CharsetAndQValue

public AcceptCharset.CharsetAndQValue(Charset charset,
                                      AcceptCharset.CharsetAndQValue wildcard)
Creates an instance for the given Charset using the q value from a parsed wildcard Accept-Charset field.

Method Detail

isWildcard

public boolean isWildcard()
Returns:
whether the given charset token is an asterix


Copyright © 2000-2010 PanEris. All Rights Reserved.