ittp.protocol.request.headers
Class Range

java.lang.Object
  extended byittp.protocol.request.Request.Headers
      extended byittp.protocol.request.headers.Range

public class Range
extends Request.Headers

This class analyse the header Range send by the client.

Author:
Frederic Bidon and Mathieu Texier

Constructor Summary
Range(Request parent)
          Constructor of the class
 
Method Summary
 int getFirst()
          Accessors for the number of the first octet of the body.
 int getLast()
          Accessors for the number of the last octet of the body.
 boolean isUsed()
          Accessors for the boolean used.
 void setRange(int first, int last)
          Mutators for the range (the first and the last octet of the portion).
 java.lang.String toString()
          Convert to a string the headers range send by the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range(Request parent)
Constructor of the class

Method Detail

setRange

public void setRange(int first,
                     int last)
              throws ittpException
Mutators for the range (the first and the last octet of the portion).

Parameters:
first - int that contain the first octet of the portion requested by the client.
last - int that contain the last octet of the portion requested by the client.
Throws:
ittpException - if the headers Range already received.

getFirst

public int getFirst()
Accessors for the number of the first octet of the body.

Returns:
the int first.

getLast

public int getLast()
Accessors for the number of the last octet of the body.

Returns:
the int last.

toString

public java.lang.String toString()
Convert to a string the headers range send by the client.

Specified by:
toString in class Request.Headers
Returns:
a string containing the response to this headers if it is used.

isUsed

public boolean isUsed()
Accessors for the boolean used.

Specified by:
isUsed in class Request.Headers
Returns:
used: boolean that determine if this headers is used.