sk.uniba.euromath.document.schema.impl.export
Class RulePool

java.lang.Object
  extended by sk.uniba.euromath.document.schema.impl.export.RulePool

public final class RulePool
extends Object

Pool of NewElementRuleImpl and AttributeRuleImpl. Forbids creation of more than one object for each expression set.

Author:
Martin Vysny

Constructor Summary
RulePool(RulePool parent)
          Creates pool with parent.
RulePool(SchemaImpl schema)
          Creates pool without parent.
 
Method Summary
 AttributeRuleImpl getAttributeRuleInstance(Set<com.sun.msv.grammar.AttributeExp> exps)
          Returns instance of AttributeRuleImpl for given expression set.
 NewElementRuleImpl getElementRuleInstance(Set<com.sun.msv.grammar.ElementExp> exps)
          Returns instance of NewElementRuleImpl for given expression set.
 ElementSequenceRuleImpl getElementSeqRuleInstance(com.sun.msv.grammar.Expression exp)
          Returns instance of ElementSequenceRuleImpl for given expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RulePool

public RulePool(SchemaImpl schema)
Creates pool without parent.

Parameters:
schema - an SchemaImpl instance.

RulePool

public RulePool(RulePool parent)
Creates pool with parent. Each query to getInstance looks to parent, and if required instance cannot be found there, then this instance handles it itself.

Parameters:
parent - parent RulePool.
Method Detail

getElementRuleInstance

public NewElementRuleImpl getElementRuleInstance(Set<com.sun.msv.grammar.ElementExp> exps)
Returns instance of NewElementRuleImpl for given expression set.

Parameters:
exps - set, containing the ElementExp objects.
Returns:
one and only instance of NewElementRuleImpl for given expression set.

getAttributeRuleInstance

public AttributeRuleImpl getAttributeRuleInstance(Set<com.sun.msv.grammar.AttributeExp> exps)
Returns instance of AttributeRuleImpl for given expression set.

Parameters:
exps - set, containing the AttributeExp objects.
Returns:
one and only instance of AttributeRuleImpl for given expression set.

getElementSeqRuleInstance

public ElementSequenceRuleImpl getElementSeqRuleInstance(com.sun.msv.grammar.Expression exp)
Returns instance of ElementSequenceRuleImpl for given expression.

Parameters:
exp - expression.
Returns:
one and only instance of NewElementRuleImpl for given expression. if exp is epsilon-reducible, result is null


Copyright © 2003-2006 null. All Rights Reserved.