com.ibm.jdg2e.simplemodel.internal
Class RoadTrip

java.lang.Object
  extended bycom.ibm.jdg2e.simplemodel.internal.RoadTrip
All Implemented Interfaces:
IRoadTrip

public class RoadTrip
extends java.lang.Object
implements IRoadTrip

Represents a domain specific model. Although simple in its implementation, it does contain content at the start, can have Location s added and removed, and will report content changes at a high level.

Access to the model is intended to be done using the associated plug-in.

See Also:
SimpleModel.getRoadTrip()

Field Summary
 
Fields inherited from interface com.ibm.jdg2e.simplemodel.core.IRoadTrip
LISTADD, LISTREMOVE
 
Constructor Summary
RoadTrip()
          Initializes the road trip data when the object is created.
RoadTrip(boolean reset)
          Optionally initializes the road trip data when the object is created.
 
Method Summary
 ILocation addLocation(java.lang.String name, java.lang.String activity, int political)
          Create a Location in the RoadTrip.
 void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
          Add a property change listener.
 java.lang.Object[] getLocations()
          Returns the model content in the form of an array.
 void removeLocation(ILocation location)
          The referenced Location is removed.
 void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
          Removes a property change listener.
 void resetList()
          Creates an initial set of Location object instances in the RoadTrip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoadTrip

public RoadTrip()
Initializes the road trip data when the object is created. Odd constructor pattern is due to redesign for XML-based persistence.

See Also:
SimpleModel.getRoadTrip()

RoadTrip

public RoadTrip(boolean reset)
Optionally initializes the road trip data when the object is created. Odd constructor pattern is due to redesign for XML-based persistence.

See Also:
SimpleModel.getRoadTrip()
Method Detail

addLocation

public ILocation addLocation(java.lang.String name,
                             java.lang.String activity,
                             int political)
Create a Location in the RoadTrip. If nulls are passed default values are used.

Specified by:
addLocation in interface IRoadTrip
Parameters:
name - name for new object instance
activity - description for activity
political - identifier for political unit
Returns:
ILocation the model object that was added.
See Also:
IRoadTrip.addLocation(java.lang.String, java.lang.String, int)

addPropertyChangeListener

public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Add a property change listener. This simple change listener is used to identify changes to RoadTrip content (adds/removes). It does not report attribute changes to ILocation.

Specified by:
addPropertyChangeListener in interface IRoadTrip
Parameters:
listener -

getLocations

public java.lang.Object[] getLocations()
Returns the model content in the form of an array. Intended to support the needs of the content provider getElements() method.

Specified by:
getLocations in interface IRoadTrip
Returns:
Object[] - an array of ILocation

removeLocation

public void removeLocation(ILocation location)
The referenced Location is removed.

Specified by:
removeLocation in interface IRoadTrip
Parameters:
location -

removePropertyChangeListener

public void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Removes a property change listener.

Specified by:
removePropertyChangeListener in interface IRoadTrip
Parameters:
listener -

resetList

public void resetList()
Creates an initial set of Location object instances in the RoadTrip.

Specified by:
resetList in interface IRoadTrip