MCPcopy Create free account
hub / github.com/ActiveState/code / insertValue

Method insertValue

recipes/Python/577898_23_Tree/recipe-577898.py:135–143  ·  view source on GitHub ↗

Insert a value into node

(self, a)

Source from the content-addressed store, hash-verified

133 # interface methods & properties
134
135 def insertValue(self, a):
136 """ Insert a value into node """
137 if a is not None and self.valcnt < 3:
138 if self.valcnt is 0: self.values = [None] * 3
139 self.__rearrangeLinks(a)
140 self.values[self.valcnt] = a
141 self.valcnt += 1
142 self.__sort3(self.values, self.valcnt)
143 return self
144
145 def removeValue(self, val):
146 """ Remove value from node """

Callers 4

__init__Method · 0.95
__fixNodeRemoveMethod · 0.45
__fixNodeInsertMethod · 0.45
insertValueMethod · 0.45

Calls 2

__rearrangeLinksMethod · 0.95
__sort3Method · 0.95

Tested by

no test coverage detected