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