WebObjects 5.2.3

com.webobjects.directtoweb
Class D2WFastModel

java.lang.Object
  extended bycom.webobjects.directtoweb.D2WModel
      extended bycom.webobjects.directtoweb.D2WFastModel
All Implemented Interfaces:
EOKeyValueArchiving

public class D2WFastModel
extends D2WModel

The D2WFastModel class is a D2WModel that is specialized with support for significant keys. Precomputing the significant keys of rules expedites the determination of the rules that can fire in a given context.

The current implementation caches the keys in an array of fixed size. Intially, the maximum number of significant keys is 32.

The implementation is subject to change in future releases.


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
 
Fields inherited from class com.webobjects.directtoweb.D2WModel
ActionsKey, AllMarker, AllowCollapsingKey, AlternateRowColorKey, AttributeKey, AttributeTypeKey, BackgroundColorForPageKey, BackgroundColorForTableKey, BoldKey, ColorKey, ComponentAvailableKey, ComponentNameKey, ComponentsToShowAtEndKey, CustomTypeKey, DisplayNameForPropertyKey, DisplayPropertyKeysKey, DummyTrueKey, DynamicPageKey, EntityKey, FormatterKey, FrameKey, FramesActiveKey, IsGeneratingKey, ItalicKey, KeyPathTypeKey, KeyWhenRelationshipKey, LengthKey, LookKey, NoneMarker, One, PageAvailableKey, PageNameKey, PropertyIsKeyPathKey, PropertyKey, PropertyKeyKey, PropertyKeyPortionInModelKey, PropertyTypeKey, ReadOnlyEntityNamesKey, RelationshipKey, RelationshipTypeKey, RequiresEntityKey, SessionKey, ShowBannerKey, StartupEntityNameKey, StartupTaskKey, TargetKey, TaskKey, VisibleEntityNamesKey, WebAssistantPageNameKey, Zero
 
Constructor Summary
protected D2WFastModel(NSArray rules)
          Creates an instance of D2WFastModel with the specified rules.
 
Method Summary
static D2WFastModel defaultFastModel()
          Gets the default fast model.
protected  Vector fireAllRulesForKeyPathInContext(String keyPath, D2WContext context)
          Fires all candidate rules for the specified key path that can fire in the specified context; aggregates the results of all firings.
protected  Object fireRuleForKeyPathInContext(String keyPath, D2WContext context)
          Fires the first candidate rule for the specified key path that can fire in the specified context.
protected  Object fireSystemRuleForKeyPathInContext(String keyPath, D2WContext context)
          Fires the first candidate rule for the specified key path that can fire in the specified context but is not authored by the Web Assistant.
protected  void invalidateCaches()
          Clears the local caches of fast left-hand side keys.
static void newSignificantKey(String newKey)
          Adds the specified key to the significant keys.
static short significantKeyCount()
          Gets the current number of significant keys.
static String[] significantKeys()
          Gets the significant keys.
 
Methods inherited from class com.webobjects.directtoweb.D2WModel
addRule, addRules, addRuleToItsBucket, addRuleTrace, candidates, canSaveUserModel, checkPossibilityToSaveUserModel, checkRules, clientConfiguration, clientConfigurationFilesInBundles, clientConfigurationFilesPathURLsInBundles, componentDefinitions, createWebAssistantRulesWithSettings, dataTypesInvolved, defaultModel, dirty, dynamicPages, editors, encodeWebAssistantRulesWithKeyValueArchiver, encodeWithKeyValueArchiver, inferrableKeys, initializeClientConfiguration, isPageStatic, loadRules, mergeFile, mergePathURL, modelFilesInBundles, modelFilesPathURLsInBundles, nameFromFrameworkBundle, newSettings, pageRuleKeysForPage, pageRuleKeysFromClientConfiguration, propertyRuleKeysForComponents, propertyRuleKeysFromClientConfiguration, removeAllWebAssistantRules, removeDynamicPage, removeRule, removeWebAssistantRulesWithSameContextAsSettings, revertWebAssistantRules, rules, saveWebAssistantRulesIntoUsedModelFile, setDefaultModel, setDirty, setRules, sortRules, tasks, taskVector, toFile, toString, typeForRuleKey, updateUserSettingsForNewPageAvailableRule, userClientConfigurationFile, userClientConfigurationFilePathURL, userModelFile, userModelFilePathURL, webAssistantRulesForSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

D2WFastModel

protected D2WFastModel(NSArray rules)
Creates an instance of D2WFastModel with the specified rules.

Parameters:
rules - instance of NSArray
See Also:
D2WModel.D2WModel(NSArray)
Method Detail

defaultFastModel

public static D2WFastModel defaultFastModel()
Gets the default fast model.

Returns:
instance of D2WFastModel
See Also:
D2WModel.defaultModel()

fireAllRulesForKeyPathInContext

protected Vector fireAllRulesForKeyPathInContext(String keyPath,
                                                 D2WContext context)
Description copied from class: D2WModel
Fires all candidate rules for the specified key path that can fire in the specified context; aggregates the results of all firings.

Overrides:
fireAllRulesForKeyPathInContext in class D2WModel
Parameters:
keyPath - the key path
context - instance of D2WContext
Returns:
instance of java.util.Vector
See Also:
D2WModel.candidates(String, D2WContext), D2WModel.fireRuleForKeyPathInContext(String, D2WContext), Rule.canFireInContext(D2WContext), Rule.fire(D2WContext)

fireRuleForKeyPathInContext

protected Object fireRuleForKeyPathInContext(String keyPath,
                                             D2WContext context)
Description copied from class: D2WModel
Fires the first candidate rule for the specified key path that can fire in the specified context.

Overrides:
fireRuleForKeyPathInContext in class D2WModel
Parameters:
keyPath - the key path
context - instance of D2WContext
Returns:
the result of firing if a rule fires; null otherwise
See Also:
D2WModel.fireSystemRuleForKeyPathInContext(String, D2WContext), D2WModel.fireAllRulesForKeyPathInContext(String, D2WContext)

fireSystemRuleForKeyPathInContext

protected Object fireSystemRuleForKeyPathInContext(String keyPath,
                                                   D2WContext context)
Description copied from class: D2WModel
Fires the first candidate rule for the specified key path that can fire in the specified context but is not authored by the Web Assistant.

Overrides:
fireSystemRuleForKeyPathInContext in class D2WModel
Parameters:
keyPath - the key path
context - instance of D2WContext
Returns:
the result of firing if a rule fires; null otherwise
See Also:
D2WModel.fireRuleForKeyPathInContext(String, D2WContext)

invalidateCaches

protected void invalidateCaches()
Clears the local caches of fast left-hand side keys.

Overrides:
invalidateCaches in class D2WModel
See Also:
D2WModel.invalidateCaches()

newSignificantKey

public static void newSignificantKey(String newKey)
Adds the specified key to the significant keys. Increments the significant key count.

Parameters:
newKey - instance of String
See Also:
significantKeyCount()

significantKeyCount

public static short significantKeyCount()
Gets the current number of significant keys.

Returns:
short that represents the significant key count

significantKeys

public static String[] significantKeys()
Gets the significant keys.

Returns:
array of String

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.