ks.common.model
Class Model

java.lang.Object
  extended byks.common.model.Model

public class Model
extends java.lang.Object

Every Solitaire class must construct a model containing various elements.

This class provides a means to manage and locate model elements. As such, it can be viewed as a "container" for model elements.

Creation date: (10/21/01 4:40:34 PM)


Constructor Summary
Model()
          Model Constructor
 
Method Summary
 boolean addElement(Element e)
          Adds a new Model Element to set of Elements.
 java.util.Enumeration elements()
          Return an Enumeration of Model Elements.
 Element getElement(java.lang.String name)
          Return Model Element with the given name from set.
 void removeAllElements()
          Removes all Model Elements from set.
 void removeElement(Element e)
          Removes a new Model Element from set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model()
Model Constructor

Method Detail

addElement

public boolean addElement(Element e)
Adds a new Model Element to set of Elements.

Throws IllegalArgumentException if null object passed in.

Parameters:
e - The Element to be added to the model.
Returns:
boolean false if an Element with same name already exists in the set

elements

public java.util.Enumeration elements()
Return an Enumeration of Model Elements.

Returns:
Enumeration of Element objects.

getElement

public Element getElement(java.lang.String name)
Return Model Element with the given name from set.

If name is null, then null is returned.

Parameters:
name - the String desired name.
Returns:
Element in model with the desired name.

removeAllElements

public void removeAllElements()
Removes all Model Elements from set.


removeElement

public void removeElement(Element e)
Removes a new Model Element from set.

Parameters:
e - the Element to be removed from the set.