public class IlvGeneralReservation extends IlvSimpleReservation implements IlvUserPropertyHolder
IlvGeneralReservation
is an extension of
IlvSimpleReservation
that adds support for user-defined properties.
IlvGeneralReservation
fires an
ReservationUserPropertyEvent
both before and after a user-defined
property is modified. Immediately before a property is modified,
IlvGeneralReservation
fires an aboutToChange
ReservationUserPropertyEvent
to all
listeners
registered with the Gantt data model
.
This gives the listeners an opportunity to constrain or veto the proposed
property change. If the property change is not vetoed, then the change
is applied and IlvGeneralReservation
fires a changed
ReservationUserPropertyEvent
to all listeners registered with
the Gantt data model.
IlvGeneralReservation
predefines 3 properties that are
inherited from its IlvSimpleReservation
superclass. These predefined
properties can be accessed through the getProperty(java.lang.String)
and
setProperty(java.lang.String, java.lang.Object)
methods in the same manner as user-defined properties.
However, the predefined properties fire specific event types. They
do not fire ReservationUserPropertyEvent
s as described
above for user-defined properties. The predefined events are shown in the
following table:
Property | Value Type | Equivalent getXXX Method | Equivalent setXXX Method | Event Type |
activity |
IlvActivity |
|
||
resource |
IlvResource |
|
|
ReservedResourceEvent |
Modifier and Type | Class and Description |
---|---|
static class |
IlvGeneralReservation.Factory
IlvGeneralReservation.Factory is a factory that creates
instances of IlvGeneralReservation . |
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVITY_PROPERTY
Identifies the reservation's activity property.
|
static String |
RESOURCE_PROPERTY
Identifies the reservation's resource property.
|
Constructor and Description |
---|
IlvGeneralReservation(IlvResource resource,
IlvActivity activity)
Creates a new
IlvGeneralReservation that assigns the
specified resource to the specified activity . |
Modifier and Type | Method and Description |
---|---|
Object |
getProperty(String property)
Returns the value of a user-defined property or
null if
the property does not exist. |
Collection<String> |
getPropertyNames()
Returns a collection that contains the names of all the properties of
this reservation.
|
boolean |
isUserProperty(String name)
Returns
true if the property is a user-defined property. |
protected String |
paramString()
Returns a parameter string that represents the state of this reservation.
|
Iterator<String> |
propertyNameIterator()
Returns an iterator over all the property names of this reservation.
|
Object |
setProperty(String property,
Object value)
Stores a user-defined property in this reservation's property table.
|
getActivity, getResource, setResource
fireEvent, fireReservedResourceAboutToChange, fireReservedResourceChanged, getGanttModel, setGanttModelImpl, toString
public static final String ACTIVITY_PROPERTY
public static final String RESOURCE_PROPERTY
public IlvGeneralReservation(IlvResource resource, IlvActivity activity)
IlvGeneralReservation
that assigns the
specified resource
to the specified activity
.resource
- The resource that is assigned.activity
- The activity that the resource is assigned to.public Object getProperty(String property)
null
if
the property does not exist.getProperty
in interface IlvUserPropertyHolder
property
- The name of the property.null
if the property
does not exist.setProperty(java.lang.String, java.lang.Object)
,
getPropertyNames()
public Object setProperty(String property, Object value)
setProperty
in interface IlvUserPropertyHolder
property
- The name of the property.value
- The value of the property. If the value is null
the property is removed.getProperty(java.lang.String)
,
getPropertyNames()
public Iterator<String> propertyNameIterator()
propertyNameIterator
in interface IlvUserPropertyHolder
public Collection<String> getPropertyNames()
public boolean isUserProperty(String name)
true
if the property is a user-defined property.isUserProperty
in interface IlvUserPropertyHolder
name
- The name of the property.true
if the property is a user-defined property,
false
otherwise.protected String paramString()
paramString
in class IlvAbstractReservation
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.