<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_segment(self, address, data, overwrite=False):
 """Add a contiguous segment of data to this memory map If the segment overlaps with a segment already added , an ArgumentError is raised unless the overwrite flag is True. Params: address (int):
 The starting address for this segment data (bytearray):
 The data to add overwrite (bool):
 Overwrite data if this segment overlaps with one previously added. """


        seg_type = self._classify_segment(address, len(data))
        if not isinstance(seg_type, DisjointSegment):
            raise ArgumentError("Unsupported segment type")

        segment = MemorySegment(address, address+len(data)-1, len(data), bytearray(data))
        self._segments.append(segment)