from abc import ABCMeta
from abjad.tools.pitchtools._Segment import _Segment


class _IntervalClassSegment(_Segment):
    '''.. versionadded:: 2.0

    Interval-class segment base class.
    '''
    __metaclass__ = ABCMeta

    ### SPECIAL METHODS ###

    def __repr__(self):
        return '%s(%s)' % (type(self).__name__, self._format_string)

    ### PRIVATE PROPERTIES ###

    @property
    def _format_string(self):
        return ', '.join([str(x) for x in self])

    ### PUBLIC PROPERTIES ###

    @property
    def interval_class_numbers(self):
        return tuple([interval_class.number for interval_class in self])

    @property
    def interval_classes(self):
        return tuple(self[:])
