org.w3c.www.http
Class HttpRange

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

public class HttpRange
extends BasicValue


Field Summary
protected  int firstpos
          First position in the range.
protected  int lastpos
          Last position in the range.
protected  HttpRangeList list
          The list we belong to, if any.
protected  java.lang.String unit
          The range's unit.
 
Fields inherited from class org.w3c.www.http.BasicValue
isValid, raw, rlen, roff
 
Constructor Summary
HttpRange()
           
 
Method Summary
 int getFirstPosition()
          Get the first position of the range.
 int getLastPosition()
          Get the last position for this range.
 java.lang.String getUnit()
          Get the unit in which this range is taken.
 java.lang.Object getValue()
          HeaderValue implemenntation - Get this header value.
protected  void invalidateByteValue()
          Invalidate the current byte value for this header, if any.
protected  void parse()
          parse.
 void setFirstPosition(int firstpos)
          Set the first position of the range.
 void setLastPosition(int lastpos)
          Set the last position for this range.
 void setUnit(java.lang.String unit)
          Set the unit in which this range is taken.
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, setBytes, setString, toExternalForm, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

firstpos

protected int firstpos
First position in the range.


lastpos

protected int lastpos
Last position in the range.


unit

protected java.lang.String unit
The range's unit.


list

protected HttpRangeList list
The list we belong to, if any.

Constructor Detail

HttpRange

public HttpRange()
Method Detail

parse

protected void parse()
              throws HttpParserException
parse.

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

invalidateByteValue

protected void invalidateByteValue()
Description copied from class: BasicValue
Invalidate the current byte value for this header, if any.

Overrides:
invalidateByteValue in class BasicValue

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 the first position of the range.

Returns:
An integer giving the first pos for the range, or -1 if undefined.

setFirstPosition

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

Parameters:
firstpos - The first positon for the range.

getLastPosition

public int getLastPosition()
Get the last position for this range. If the first position is negative, then the last position is to be considered as the number of bytes relative to the end of the content.

Returns:
An integer giving the last position.

setLastPosition

public void setLastPosition(int lastpos)
Set the last position for this range. If the given number is negative, it won't be displayed meaning that everything from firstpos to the end

Parameters:
lastpos - The new last position.

setUnit

public void setUnit(java.lang.String unit)
Set the unit in which this range is taken.


getUnit

public java.lang.String getUnit()
Get the unit in which this range is taken.

Returns:
The unit in which this range is measured, or null if undefined.