ó .Å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„Z RS( 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.pytsubWidthKs cCstS(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.pyt hasSubValueXscCs 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(Rt displaySpectjoiner((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 tscss|]}|jtƒVqdS(N(RR (RR((s?/usr/lib/python2.7/site-packages/vdo/statistics/LabeledValue.pys 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.pytsP