Methods Summary |
---|
public void | decrementMaxForwards()Decrements max forwards field one by one.
if (maxForwards >= 0) maxForwards--;
|
public java.lang.String | encodeBody()Encodes into a string.
return new Integer(maxForwards).toString();
|
public int | getMaxForwards()Gets the MaxForwards field.
return maxForwards;
|
public java.lang.Object | getValue()Gets the max forwards header field value.
return new Integer(maxForwards);
|
public boolean | hasReachedZero()Returns true if max forwards is zero.
return maxForwards == 0;
|
public void | setHeaderValue(java.lang.String value)Sets the header value field.
int val;
try {
val = Integer.parseInt(value);
setMaxForwards(val);
} catch (IllegalArgumentException iae) {
throw iae;
}
|
public void | setMaxForwards(int maxForwards)Sets the maxForwards member.
if (maxForwards < 0 || maxForwards > 255)
throw new IllegalArgumentException
("bad max forwards value " + maxForwards);
this.maxForwards = maxForwards;
|