jasp.buildin
Class ASPCookie

java.lang.Object
  |
  +--jasp.buildin.ASPCookie
All Implemented Interfaces:
Collection, IReadCookie, IWriteCookie

public class ASPCookie
extends java.lang.Object
implements IWriteCookie, IReadCookie, Collection

Retrieves the string value of a cookie, which is a small piece of information stored by the browser. This class is implemented the ASP Cookie object.


Constructor Summary
ASPCookie()
          Creates an ASPCookie object.
ASPCookie(java.lang.String value)
          Creates an ASPCookie object.
 
Method Summary
 java.util.Enumeration elements()
          Returns an enumeration of the sub-cookies in this Cookie.
 int getCount()
          Retrieves the number of sub-cookies.
 variant getItem(int v)
          Gets the sub-cookie of the current Cookie.
 variant getItem(java.lang.String v)
          Gets the sub-cookie of the current Cookie.
 variant getItem(variant v)
          Gets the sub-cookie of the current Cookie.
 variant getValue()
          Gets the Cookie value
 boolean HasKeys()
          Specifies whether the cookie contains keys.
 void setDomain(java.lang.String s)
          Specified the domain that the cookie is sent only to requests.
 void setExpires(double d)
          The date on which the cookie expires.
 void setItem(java.lang.String s, java.lang.String v)
          Adds a sub-cookie to current Cookie.
 void setItem(variant v, java.lang.String s)
          Adds a cookie to current Cookie as the sub-cookie.
 void setPath(java.lang.String s)
          If specified, the cookie is sent only to requests to this path.
 void setSecure(boolean b)
          Specifies whether the cookie is secure.
 double toDouble()
          Returns the double value if the cookie value is a numeric.
 java.lang.String toString()
          Gets the Cookie value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASPCookie

public ASPCookie()
Creates an ASPCookie object.

ASPCookie

public ASPCookie(java.lang.String value)
Creates an ASPCookie object.
Parameters:
the - cookie value.
Method Detail

setExpires

public void setExpires(double d)
The date on which the cookie expires. This date must be set in order for the cookie to be stored on the client's disk after the session ends. If this attribute is not set to a date beyond the current date, the cookie will expire when the session ends.
Specified by:
setExpires in interface IWriteCookie
Parameters:
d - the double value of the date.

setSecure

public void setSecure(boolean b)
Specifies whether the cookie is secure.
Specified by:
setSecure in interface IWriteCookie
Parameters:
b - the new secure value.

setPath

public void setPath(java.lang.String s)
If specified, the cookie is sent only to requests to this path. If this attribute is not set, the application path is used.
Specified by:
setPath in interface IWriteCookie
Parameters:
s - the specified path.

elements

public java.util.Enumeration elements()
                               throws java.lang.Exception
Returns an enumeration of the sub-cookies in this Cookie.
Specified by:
elements in interface IWriteCookie

HasKeys

public boolean HasKeys()
Specifies whether the cookie contains keys.
Specified by:
HasKeys in interface IWriteCookie
Returns:
true , the cookie contans the keys, otherwise , return false.

setDomain

public void setDomain(java.lang.String s)
               throws java.lang.Exception
Specified the domain that the cookie is sent only to requests.
Specified by:
setDomain in interface IWriteCookie
Parameters:
s - the new domain name.

setItem

public void setItem(variant v,
                    java.lang.String s)
             throws java.lang.Exception
Adds a cookie to current Cookie as the sub-cookie.
Specified by:
setItem in interface IWriteCookie
Parameters:
v - the cookie name.
s - the cookie value.

setItem

public void setItem(java.lang.String s,
                    java.lang.String v)
             throws java.lang.Exception
Adds a sub-cookie to current Cookie.
Specified by:
setItem in interface IWriteCookie
Parameters:
s - the cookie name.
v - the cookie value.

getItem

public variant getItem(variant v)
                throws java.lang.Exception
Gets the sub-cookie of the current Cookie.
Specified by:
getItem in interface IReadCookie
Parameters:
v - the sub-cookie name.
Returns:
the sub-cookie value.

getItem

public variant getItem(int v)
                throws java.lang.Exception
Gets the sub-cookie of the current Cookie.
Specified by:
getItem in interface IReadCookie
Parameters:
v - the sub-cookie index.
Returns:
the sub-cookie value.

getItem

public variant getItem(java.lang.String v)
                throws java.lang.Exception
Gets the sub-cookie of the current Cookie.
Specified by:
getItem in interface IReadCookie
Parameters:
v - the sub-cookie name.
Returns:
the sub-cookie value.

getValue

public variant getValue()
                 throws java.lang.Exception
Gets the Cookie value
Specified by:
getValue in interface IReadCookie
Returns:
the Cookie value.

toString

public java.lang.String toString()
Gets the Cookie value
Overrides:
toString in class java.lang.Object
Returns:
the String value of Cookie.

getCount

public int getCount()
Retrieves the number of sub-cookies.
Specified by:
getCount in interface IReadCookie
Returns:
the number of sub-cookies.

toDouble

public double toDouble()
                throws java.lang.Exception
Returns the double value if the cookie value is a numeric.
Specified by:
toDouble in interface Collection
Returns:
the double value of the cookie.
Throws:
if - the cookie value is not a numeric, an exception will occurs.