org.fopps.model
Class Product

java.lang.Object
  |
  +--org.fopps.model.AbstractItem
        |
        +--org.fopps.model.ProjectItem
              |
              +--org.fopps.model.Product
All Implemented Interfaces:
java.lang.Cloneable, ModelListener

public class Product
extends ProjectItem
implements ModelListener

A Product is an aggregation of one or more assets. They may derive from an exiting product. In this case it will get all features of the derived product.


Field Summary
 
Fields inherited from class org.fopps.model.ProjectItem
DEFAULT_CAPACITY, DEFAULT_DURATION
 
Fields inherited from class org.fopps.model.AbstractItem
ADDED_EVENT, CHANGE_EVENT, name, REMOVED_EVENT
 
Constructor Summary
Product(java.lang.String name)
           
 
Method Summary
 boolean applyConfiguration(ConfigurationSet pSet)
          Applies a configuration set
 ConfigurationItem getConfiguration()
           
 ConfigurationSet getConfigurationSet()
          Returns the set with all configuration settings
 java.lang.String getFeatureTreeForConfiguration()
          Returns the configuration tree as string
 ConfigurationItem getItemByName(java.lang.String pSymbolicVar)
          Returns the item of a given variable
 java.util.Set getSymbolicVars()
          Returns the set of all variable names
 java.io.File getTargetDirectory()
           
 java.lang.String getValueByName(java.lang.String pSymbolicVar)
          Returns the value of a given variable
static boolean isAutoUpdate()
          Returns true, if changes in configuration are updated on demand
 void modelChanged(ModelEvent ev)
          Called, if configuration changed
 void rebuildConfiguration()
          Rereads the feature tree and sets up a new configuration set.
 boolean restoreConfiguration()
          Restores a previous saved configuration.
 void saveConfiguration()
          Saves the current configuration.
static void setAutoUpdate(boolean autoUpdate)
          Enables or disables automatic update of configuration changes.
 void setConfiguration(ConfigurationItem pItem)
           
 void setTargetDirectory(java.io.File pTargetDirectory)
           
 boolean setValueByName(java.lang.String pSymbolicVar, java.lang.String pValue)
          Sets the value of a given variable.
 java.lang.String toString()
           
 
Methods inherited from class org.fopps.model.ProjectItem
clone, copyAttributes, delete, extendEnd, extendStart, fixTimimg, fixTimimg, getContainer, getDependendProjects, getDuration, getEnd, getRootFeature, getStart, getStatus, getSuppliedProjects, getTotalDuration, move, setContainer, setDescription, setEnd, setName, setRootFeature, setStart, setStatus
 
Methods inherited from class org.fopps.model.AbstractItem
addIncoming, addListener, addOutgoing, commitGhostRelations, containsType, filterElements, fireItemAdded, fireItemChanged, fireItemRemoved, getConstraints, getDescription, getIncoming, getIncomingConstraints, getListeners, getName, getOutgoing, getOutgoingConstraints, getRelationTo, hasConstraints, isBlockEvents, isConnectedWith, notifyListeners, removeAllConstraints, removeAllIncoming, removeAllListener, removeAllOutgoing, removeAllRelations, removeGhostRelations, removeIncoming, removeListener, removeOutgoing, removeRelationTo, setBlockEvents, setIncoming, setOutgoing
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Product

public Product(java.lang.String name)
Method Detail

getConfiguration

public ConfigurationItem getConfiguration()

getTargetDirectory

public java.io.File getTargetDirectory()

setTargetDirectory

public void setTargetDirectory(java.io.File pTargetDirectory)

isAutoUpdate

public static boolean isAutoUpdate()
Returns true, if changes in configuration are updated on demand


setAutoUpdate

public static void setAutoUpdate(boolean autoUpdate)
Enables or disables automatic update of configuration changes. Default is true.


rebuildConfiguration

public void rebuildConfiguration()
Rereads the feature tree and sets up a new configuration set. Existing settings are preserved, if possible.


setConfiguration

public void setConfiguration(ConfigurationItem pItem)

saveConfiguration

public void saveConfiguration()
Saves the current configuration. If autoUpdate is enabled, you need not call this method


restoreConfiguration

public boolean restoreConfiguration()
Restores a previous saved configuration.

Returns:
false, if no configuration is available, otherwise true

applyConfiguration

public boolean applyConfiguration(ConfigurationSet pSet)
Applies a configuration set

See Also:
Feature.setSymbolicVar(String)

getFeatureTreeForConfiguration

public java.lang.String getFeatureTreeForConfiguration()
Returns the configuration tree as string


getConfigurationSet

public ConfigurationSet getConfigurationSet()
Returns the set with all configuration settings


getValueByName

public java.lang.String getValueByName(java.lang.String pSymbolicVar)
Returns the value of a given variable

Returns:
Value of configuration item or null, if item no exists

setValueByName

public boolean setValueByName(java.lang.String pSymbolicVar,
                              java.lang.String pValue)
Sets the value of a given variable. Please note, that value have to comply to the rules of the underlying configuration item. If no item was found, the method does nothing.

Parameters:
pSymbolicVar - Name of variable
pValue - New value
See Also:
Option, Alternative

getItemByName

public ConfigurationItem getItemByName(java.lang.String pSymbolicVar)
Returns the item of a given variable

Returns:
Configuration item with symbolic variable name or null, if item no exists

getSymbolicVars

public java.util.Set getSymbolicVars()
Returns the set of all variable names


modelChanged

public void modelChanged(ModelEvent ev)
Called, if configuration changed

Specified by:
modelChanged in interface ModelListener
Overrides:
modelChanged in class ProjectItem
Parameters:
ev - Model event
See Also:
ModelEvent

toString

public java.lang.String toString()
Overrides:
toString in class ProjectItem


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.