Class SessionStorage

java.lang.Object
org.loboevolution.html.js.storage.SessionStorage
All Implemented Interfaces:
Storage

public class SessionStorage extends Object implements Storage

SessionStorage class.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for SessionStorage.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Empties the list associated with the object of all key/value pairs, if there are any.
    Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
    int
    getLength.
    key(int index)
    Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
    void
    removeItem(String keyName)
    Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
    void
    setItem(String keyName, String keyValue)
    Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SessionStorage

      public SessionStorage(HtmlRendererConfig config)

      Constructor for SessionStorage.

  • Method Details

    • getLength

      public int getLength()

      getLength.

      Specified by:
      getLength in interface Storage
      Returns:
      a Integer object.
    • key

      public Object key(int index)
      Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
      Specified by:
      key in interface Storage
      Parameters:
      index - a Integer object.
      Returns:
      a Object object.
    • getItem

      public Object getItem(String key)
      Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
      Specified by:
      getItem in interface Storage
      Parameters:
      key - a String object.
      Returns:
      a Object object.
    • setItem

      public void setItem(String keyName, String keyValue)
      Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.

      Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.)

      Specified by:
      setItem in interface Storage
      Parameters:
      keyName - a String object.
      keyValue - a String object.
    • removeItem

      public void removeItem(String keyName)
      Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
      Specified by:
      removeItem in interface Storage
      Parameters:
      keyName - a String object.
    • clear

      public void clear()
      Empties the list associated with the object of all key/value pairs, if there are any.
      Specified by:
      clear in interface Storage
    • toString

      public String toString()
      Overrides:
      toString in class Object