org.w3c.www.http
Class HttpContentRange

java.lang.Object
  extended by org.w3c.www.http.BasicValue
      extended by org.w3c.www.http.HttpContentRange
All Implemented Interfaces:
java.lang.Cloneable, HeaderValue

public class HttpContentRange
extends BasicValue


Field Summary
 
Fields inherited from class org.w3c.www.http.BasicValue
isValid, raw, rlen, roff
 
Constructor Summary
HttpContentRange(boolean isValid, java.lang.String unit, int firstpos, int lastpos, int length)
           
 
Method Summary
 int getFirstPosition()
          Get this range first position.
 int getFullLength()
          Get this range entity full length.
 int getLastPosition()
          Get this range last position.
 java.lang.String getUnit()
          Get this content range's unit.
 java.lang.Object getValue()
          HeaderValue implemenntation - Get this header value.
protected  void parse()
          parse.
 void setFirstPosition(int firstpos)
          Set this range first position.
 void setFullLength(int length)
          Set this range entity full length.
 void setLastPosition(int lastpos)
          Set this range last position.
 void setUnit(java.lang.String unit)
          Set this content range's unit.
protected  void updateByteValue()
          Update the RFC822 compatible header value for this object.
 
Methods inherited from class org.w3c.www.http.BasicValue
addBytes, appendValue, checkByteValue, clone, emit, error, invalidateByteValue, setBytes, setString, toExternalForm, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpContentRange

public HttpContentRange(boolean isValid,
                        java.lang.String unit,
                        int firstpos,
                        int lastpos,
                        int length)
Method Detail

parse

protected void parse()
              throws HttpParserException
parse.

Specified by:
parse in class BasicValue
Throws:
HttpParserException - if parsing failed.

updateByteValue

protected void updateByteValue()
Description copied from class: BasicValue
Update the RFC822 compatible header value for this object.

Specified by:
updateByteValue in class BasicValue

getValue

public java.lang.Object getValue()
Description copied from class: BasicValue
HeaderValue implemenntation - Get this header value.

Specified by:
getValue in interface HeaderValue
Specified by:
getValue in class BasicValue
Returns:
An object representing the parsed value for this header.

getFirstPosition

public int getFirstPosition()
Get this range first position. The meaning of the returne integer is to be understood relative to the unit, as obtained by getUnit method.

Returns:
An integer value for thr first position.

setFirstPosition

public void setFirstPosition(int firstpos)
Set this range first position.

Parameters:
firstpos - The firt position of the range.

getLastPosition

public int getLastPosition()
Get this range last position. The meaning of the returne integer is to be understood relative to the unit, as obtained by getUnit method.

Returns:
An integer value giving the last position.

setLastPosition

public void setLastPosition(int lastpos)
Set this range last position.

Parameters:
The - last position, as an integer.

getFullLength

public int getFullLength()
Get this range entity full length.

Returns:
The full length of the entity.

setFullLength

public void setFullLength(int length)
Set this range entity full length.

Parameters:
length - The new full length for the entity, -1 if unknown.

getUnit

public java.lang.String getUnit()
Get this content range's unit.

Returns:
A String giving the unit for the range, or null if undefined.

setUnit

public void setUnit(java.lang.String unit)
Set this content range's unit.

Parameters:
unit - The unit in which this range was measured.