Current File : //usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyc
�
.�t_c@s6dZdefd��YZdefd��YZdS(s�
  LabeledValue - A sampled statistic with a label. Used for formatting stats
  output.

  $Id: //eng/vdo-releases/magnesium/src/python/vdo/statistics/LabeledValue.py#1 $
tLabeledValuecBsYeZdZed��Zd�Zd�Zd�Zd�Zd�Z	ddd�ZRS(	sl
  An object which represents a labeled statistic value or a labeled collection
  of other LabeledValues.
  cCs)t|t�rt||�St||�S(s
    Create a new labeled value.

    :param label: The label
    :param value: The value

    :return: The new labeled value. If the supplied value is a list, the
             returned object will be a LabeledValueList, otherwise it
             will be a LabeledValue.
    (t
isinstancetlisttLabeledValueListR(tlabeltvalue((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pytmake!s
cCs||_||_dS(s^
    Create a new labeled value.

    :param label: The label
    :param value: The value
    N(RR(tselfRR((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyt__init__1s	cCstS(st
    Check whether this is a collection or a single value.

    :return: True if this is a collection of values
    (tFalse(R((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyt
isMultiValued;scCs
t|j�S(sY
    Get the width of the label for this value.

    :return: The width of the label
    (tlenR(R((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pytwidthCscCs
|j�S(sX
    Get the maximum width of the labels of this value and/or all of
    its sub-values.

    :param hierarchical: Whether the format mode is hierarchical or not

    :return: The width of this value or its immediate sub-values if
              hierarchical, otherwise, the width of this value or its full tree
              of sub-values.
    (R(Rthierarchical((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pytsubWidthKscCstS(s�
    Check whether this value has a subvalue for the given index.

    :param index: The index into the subvalue list to check

    :return: True if the indexed subvalue exists
    (R	(Rtindex((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pythasSubValueXscCs
t|j�S(s�
    Format this value and any of its children.

    :param displaySpec: The display specification
    :param joiner:      The string for joining subvalues
    (tstrR(RtdisplaySpectjoiner((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pytformatbsN(t__name__t
__module__t__doc__tstaticmethodRRR
RRRtNoneR(((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyRs	
			
	
RcBs2eZdZd�Zd�Zd�Zd�ZRS(sD
  An object representing a labeled collection of labeled values.
  cCs4|rtd�|jD��Std�|jD��S(s
    :inherit:
    css|]}|j�VqdS(N(R(t.0tv((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pys	<genexpr>tscss|]}|jt�VqdS(N(RR	(RR((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pys	<genexpr>us(tmaxR(RR
((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyRoscCstS(s
    :inherit:
    (tTrue(R((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyR
wscCs4y|j|j�dkSWntk
r/tSXdS(s
    :inherit:
    tN(RRt
IndexErrorR	(RR((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyR}s
cCs5|jtdg|jD]}|j|�^q��S(s
    :inherit:
    N(tjointfilterRRR(RRRtlv((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyR�s(RRRRR
RR(((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyRks
				N(RtobjectRR(((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pyt<module>sP