com.mapquest
Class Session

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.MQObjectCollection
          extended bycom.mapquest.Session
All Implemented Interfaces:
java.lang.Cloneable

public class Session
extends MQObjectCollection

Maintains the state of the current user's requests. Contains zero or one of the following objects: MapCommand, MapState, DBLayerQueryCollection, FeatureCollection, and CoverageStyle.

See Also:
MapCommand, MapState, DBLayerQueryCollection, FeatureCollection, CoverageStyle, PrimitiveCollection, AutoMapCovSwitch

Field Summary
static int CLASS_ID
           
static java.lang.String CLASS_NAME
           
 
Fields inherited from class com.mapquest.MQObject
DEFAULT_ID, DEFAULT_NAME, DEFAULT_VERSION, FORMAT_NUMERIC_ID, FORMAT_TEXT_NAME, INVALID_ID, INVALID_NAME, INVALID_VERSION
 
Constructor Summary
Session()
          Default constructor.
 
Method Summary
 void add(MQObject obj)
          Adds a MQObject to the collection.
 int addOne(MQObject newElement)
          Adds an element to this Session object, ensuring that it is the only one of its class type.
 int addOne(MQObject newElement, MQObject replacedElement)
          Adds an element to this Session object, ensuring that it is the only one of its class type.
 MQObject getAt(int index)
          Returns the element at the specified position in this collection.
 int getClassId()
          Returns the numeric id of this class.
 java.lang.String getClassName()
          Returns the text name of this class.
 MQObject getObject(java.lang.String name)
          Returns the specified item in the collection by name.
 void init()
          Initializes object.
 
Methods inherited from class com.mapquest.MQObjectCollection
append, equals, get, getSize, hashCode, remove, removeAll, removeAt
 
Methods inherited from class com.mapquest.MQObject
clone, getFormat, getIdWithVersion, getNameWithVersion, getObjectVersion, getTypeId, getTypeName, getVerboseConsoleOutput, setFormat, setObjectVersion, setVerboseConsoleOutput, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ID

public static final int CLASS_ID
See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

Session

public Session()
Default constructor.

Method Detail

init

public void init()
Initializes object.

Overrides:
init in class MQObjectCollection

getClassId

public int getClassId()
Returns the numeric id of this class.

Overrides:
getClassId in class MQObject
Returns:
the numeric id of this class.

getClassName

public java.lang.String getClassName()
Returns the text name of this class.

Overrides:
getClassName in class MQObject
Returns:
the text name of this class.

getAt

public MQObject getAt(int index)
Returns the element at the specified position in this collection. Calls get(int).

Parameters:
index - index of element to return.
Returns:
MQObject at the specified index.
See Also:
MQObjectCollection.get(int)

getObject

public MQObject getObject(java.lang.String name)
Returns the specified item in the collection by name.

Parameters:
name - Name of item in this Session object which is to be returned.
Returns:
The object that matches this criteria. null is returned if the specified name is not found.

addOne

public int addOne(MQObject newElement,
                  MQObject replacedElement)
Adds an element to this Session object, ensuring that it is the only one of its class type. Validates element as being one of object types that is permitted in this Session object. If it is, and there happens to be one of that type of object already present, the new object will replace it.

Parameters:
newElement - The new element that is to be added to this Session object.
replacedElement - The element that was previously in this Session object.
Returns:
index of element that is added.
Throws:
java.lang.IllegalArgumentException - Invalid object for this collection.

addOne

public int addOne(MQObject newElement)
Adds an element to this Session object, ensuring that it is the only one of its class type. Validates element as being one of object types that is permitted in this Session object. If it is, and there happens to be one of that type of object already present, the new object will replace it. Calls addOne(MQObject, null).

Parameters:
newElement - The new element that is to be added to this Session object.
Returns:
index of element that is added.
See Also:
addOne(MQObject, MQObject)

add

public void add(MQObject obj)
Adds a MQObject to the collection. Calls addOne(MQObject, null).

Overrides:
add in class MQObjectCollection
Parameters:
obj - The new MQObject to be added to the collection.
See Also:
addOne(MQObject, MQObject)