def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the contents of sourceCollection, if it's present."""
     self._items = Array(ArrayBag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
     if sourceCollection:
         for item in sourceCollection:
             self.add(item)
Exemple #2
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = LinkedBST()
     AbstractBag.__init__(self, sourceCollection)
     if not self._items.isBalanced():
         self._items.rebalance()
Exemple #3
0
 def __init__(self, sourceCollection = None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present.
     **Items will be in reverse order of sourceCollection!
     """
     if AbstractBag.TRACE:
         print("linkedbag's __init__")
     self._items = None
     AbstractBag.__init__(self, sourceCollection) #calls init of parent class
Exemple #4
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
Exemple #5
0
 def __init__(self, sourceCollection=None):
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
Exemple #6
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = Array(ArrayBag.DEFAULT_CAPACITY)
     self._targetIndex = -1
     AbstractBag.__init__(self, sourceCollection)
 def __init__(self, sourceCollection = None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = Array(ArrayBag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
Exemple #8
0
 def __init__(self, sourceCollection=None):
     AbstractArray.__init__(self)
     AbstractBag.__init__(self, sourceCollection)
Exemple #9
0
 def __init__(self, sourceCollection=None):
     """Sets the initial state of self, which includes the
     contents of sourceCollection, if it's present."""
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
Exemple #10
0
 def __int__(self, sourceCollection = None):
     self._items = Array(Arraybag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
Exemple #11
0
 def __init__(self, sourceCollection=None):
     """初始化"""
     self._items = Array(ArrayBag.DEFALUT_SIZE)
     AbstractBag.__init__(self, sourceCollection)