Package pyxb :: Package utils :: Module fac :: Class NumericalConstraint
[hide private]
[frames] | no frames]

Class NumericalConstraint

source code

object --+    
         |    
      Node --+
             |
            NumericalConstraint

A term with a numeric range constraint.

This corresponds to a "particle" in the XML Schema content model.

Instance Methods [hide private]
 
__get_min(self) source code
 
__get_max(self) source code
 
__get_term(self) source code
 
__init__(self, term, min=0, max=1, **kw)
Term with a numerical constraint.
source code
 
clone(self)
Create a deep copy of the node.
source code
 
_first(self)
Abstract method that defines first for the subclass.
source code
 
_last(self)
Abstract method that defines last for the subclass.
source code
 
_nullable(self)
Abstract method that defines nullable for the subclass.
source code
 
_follow(self)
Abstract method that defines follow for the subclass.
source code
 
_walkTermTree(self, position, pre, post, arg)
Abstract method implementing walkTermTree for the subclass.
source code
 
__str__(self)
str(x)
source code

Inherited from Node: buildAutomaton, counterSubPositions, reset, walkTermTree

Inherited from Node (private): _facToString

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
Class Variables [hide private]
  _Precedence = -1
An integral value used for parenthesizing expressions.
  __min = None
hash(x)
  __max = None
hash(x)
  __term = None
hash(x)

Inherited from Node: INCREMENT, RESET

Properties [hide private]
  min
  max
  term

Inherited from Node: counterPositions, first, follow, last, metadata, nodePosMap, nullable, posNodeMap

Inherited from object: __class__

Method Details [hide private]

__init__(self, term, min=0, max=1, **kw)
(Constructor)

source code 

Term with a numerical constraint.

Parameters:
  • term (Node) - A term, the number of appearances of which is constrained in this term.
  • min - The minimum number of occurrences of term. The value must be non-negative.
  • max - The maximum number of occurrences of term. The value must be positive (in which case it must also be no smaller than min), or None to indicate an unbounded number of occurrences.
Overrides: object.__init__

clone(self)

source code 

Create a deep copy of the node.

All term-tree--related attributes and properties are replaced with deep clones. Other attributes are preserved.

Parameters:
  • args - A tuple of arguments to be passed to the instance constructor.
  • kw - A dict of keywords to be passed to the instance constructor.
Overrides: Node.clone
(inherited documentation)

_first(self)

source code 

Abstract method that defines first for the subclass.

The return value should be an iterable of tuples of integers denoting paths from this node through the term tree to a symbol.

Overrides: Node._first
(inherited documentation)

_last(self)

source code 

Abstract method that defines last for the subclass.

The return value should be an iterable of tuples of integers denoting paths from this node through the term tree to a symbol.

Overrides: Node._last
(inherited documentation)

_nullable(self)

source code 

Abstract method that defines nullable for the subclass.

The return value should be True or False.

Overrides: Node._nullable
(inherited documentation)

_follow(self)

source code 

Abstract method that defines follow for the subclass.

The return value should be a map from tuples of integers (positions) to a list of transitions, where a transition is a position and an update instruction.

Overrides: Node._follow
(inherited documentation)

_walkTermTree(self, position, pre, post, arg)

source code 

Abstract method implementing walkTermTree for the subclass.

Overrides: Node._walkTermTree
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

min

Get Method:
__get_min(self)

max

Get Method:
__get_max(self)

term

Get Method:
__get_term(self)