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)
Esempio n. 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()
Esempio n. 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
Esempio n. 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)
Esempio n. 5
0
 def __init__(self, sourceCollection=None):
     self._items = None
     AbstractBag.__init__(self, sourceCollection)
Esempio n. 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)
Esempio n. 7
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)
     AbstractBag.__init__(self, sourceCollection)
Esempio n. 8
0
 def __init__(self, sourceCollection=None):
     AbstractArray.__init__(self)
     AbstractBag.__init__(self, sourceCollection)
Esempio n. 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)
Esempio n. 10
0
 def __int__(self, sourceCollection = None):
     self._items = Array(Arraybag.DEFAULT_CAPACITY)
     AbstractBag.__init__(self, sourceCollection)
Esempio n. 11
0
 def __init__(self, sourceCollection=None):
     """初始化"""
     self._items = Array(ArrayBag.DEFALUT_SIZE)
     AbstractBag.__init__(self, sourceCollection)