OSDN Git Service

autopep8
[ftg/ftg.git] / ftg / flow_entry.py
1 # vim: tabstop=4 shiftwidth=4 softtabstop=4
2 # -*- coding: utf-8 -*-
3 #
4
5 from ftg.flowobject import FlowObject
6
7
8 class FlowEntry(FlowObject):
9     DEFAULT_TYPE = 1
10
11     def __init__(self, match_exp, instructions=[], counter="", label="", type=DEFAULT_TYPE, metadata={}):
12         self.match_exp = match_exp
13         self.instructions = instructions
14         self.counter = counter
15         self.label = label
16         self.type = type
17         self.metadata = metadata
18
19     def set_match_exp(self, match_exp):
20         self.match_exp = match_exp
21
22     def get_match_exp(self):
23         return self.match_exp
24
25     def set_instructions(self, instructions):
26         self.instructions = instructions
27
28     def get_instructions(self):
29         return self.instructions
30
31     def set_counter(self, counter):
32         self.counter = counter
33
34     def get_counter(self):
35         return self.counter
36
37     def __str__(self):
38         return "\"" + self.match_exp + "\",\"" + ",".join(self.instructions) + "\""