Delete 'huffman_py/Sommets.py'
This commit is contained in:
parent
f76fa67d93
commit
e068e9e5b5
@ -1,77 +0,0 @@
|
|||||||
#
|
|
||||||
# Sam Hadow - Huffman-py
|
|
||||||
# Copyright (C) 2023
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
|
|
||||||
class Sommets(object):
|
|
||||||
def __init__(self, occurrence, lettres, left = None, right = None):
|
|
||||||
# nombre d'occurence de la lettre
|
|
||||||
self.occurrence = occurrence
|
|
||||||
|
|
||||||
# la lettre
|
|
||||||
self.lettres = lettres
|
|
||||||
|
|
||||||
# fils gauche
|
|
||||||
self.left = left
|
|
||||||
|
|
||||||
# fils droit
|
|
||||||
self.right = right
|
|
||||||
|
|
||||||
# direction par rapport au père (0 pour gauche, 1 pour droite)
|
|
||||||
self.code = ''
|
|
||||||
|
|
||||||
# ID du sommet (unique dans un arbre)
|
|
||||||
self.identifiant = None
|
|
||||||
|
|
||||||
|
|
||||||
# getters et setters des attributs avec _attribut pour stocker l'attribut dans un espace non public
|
|
||||||
# on utilisera obligatoirement ces méthodes pour manipuler les attributs
|
|
||||||
|
|
||||||
def get_occurence(self):
|
|
||||||
return self.__occurence
|
|
||||||
def set_occurence(self, valeur):
|
|
||||||
self.__occurence = valeur
|
|
||||||
occurence = property(fget=get_occurence, fset=set_occurence, doc="Nombre d'occurence de la lettre")
|
|
||||||
|
|
||||||
def get_lettres(self):
|
|
||||||
return self.__lettres
|
|
||||||
def set_lettres(self, valeur):
|
|
||||||
self.__lettres = valeur
|
|
||||||
lettres = property(fget=get_lettres, fset=set_lettres, doc="Lettre correspondante")
|
|
||||||
|
|
||||||
def get_left(self):
|
|
||||||
return self.__left
|
|
||||||
def set_left(self, valeur):
|
|
||||||
self.__left = valeur
|
|
||||||
left = property(fget=get_left, fset=set_left, doc="fils gauche")
|
|
||||||
|
|
||||||
def get_right(self):
|
|
||||||
return self.__right
|
|
||||||
def set_right(self, valeur):
|
|
||||||
self.__right = valeur
|
|
||||||
right = property(fget=get_right, fset=set_right, doc="fils droit")
|
|
||||||
|
|
||||||
def get_code(self):
|
|
||||||
return self.__code
|
|
||||||
def set_code(self, valeur):
|
|
||||||
self.__code = valeur
|
|
||||||
code = property(fget=get_code, fset=set_code, doc="orientation dans l'arbre binaire par rapport au père, 0 pour gauche, 1 pour droite")
|
|
||||||
|
|
||||||
def get_id(self):
|
|
||||||
return self.__identifiant
|
|
||||||
def set_id(self, valeur):
|
|
||||||
self.__identifiant = valeur
|
|
||||||
identifiant = property(fget=get_id, fset=set_id, doc="identifiant d'un sommet de l'arbre, ces id sont tous différents dans un même arbre")
|
|
Loading…
x
Reference in New Issue
Block a user