// Val returns the current value of the counter.
427718
func (c *PCPCounter) Val() int64 {
	c.mutex.RLock()
	defer c.mutex.RUnlock()

	return c.val.(int64)
}
297512
func (c *PCPCounter) Set(val int64) error {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	v := c.val.(int64)

	if val < v {
		return errors.Errorf("cannot set counter to %v, current value is %v and PCP counters cannot go backwards", val, v)
	}

	return c.set(val)
}
312707
func (self inputTextIdImpl) Val() string {
	v := self.htmlIdImpl.t.Val()
	if v == "undefined" {
		return ""
	}
	return v
}
4999
func (sv *SyncVal) Set(val interface{}) {
	sv.lock.Lock()
	sv.val = val
	sv.lock.Unlock()
}
819214
func (iter *Iterator) Value() Entry {
	if iter.n == nil {
		return nil
	}

	return iter.n.entry
}
724988
func (d *decodeState) value(v reflect.Value) error {
	switch d.opcode {
	default:
		return errPhase

	case scanBeginArray:
		if v.IsValid() {
			if err := d.array(v); err != nil {
				return err
			}
		} else {
			d.skip()
		}
		d.scanNext()

	case scanBeginObject:
		if v.IsValid() {
			if err := d.object(v); err != nil {
				return err
			}
		} else {
			d.skip()
		}
		d.scanNext()

	case scanBeginLiteral:
		// All bytes inside literal return scanContinue op code.
		start := d.readIndex()
		d.scanWhile(scanContinue)

		if v.IsValid() {
			if err := d.literalStore(d.data[start:d.readIndex()], v, false); err != nil {
				return err
			}
		}
	}
	return nil
}
559675
func (it *EntryInfoIterator) Value() (EntryInfo, error) {
	it.mutex.Lock()

	if !it.valid {
		it.mutex.Unlock()
		return emptyEntryInfo, ErrInvalidIteratorState
	}

	entry, err := it.cache.shards[it.currentShard].getEntry(int(it.elements[it.currentIndex]))

	if err != nil {
		it.mutex.Unlock()
		return emptyEntryInfo, ErrCannotRetrieveEntry
	}
	it.mutex.Unlock()

	return EntryInfo{
		timestamp: readTimestampFromEntry(entry),
		hash:      readHashFromEntry(entry),
		key:       readKeyFromEntry(entry),
		value:     readEntry(entry),
	}, nil
}
582634
func (l *Lock) Value() (bool, string, error) {
	defer metrics.MeasureSince(metricLockValue, time.Now())

	r, err := l.get(context.Background())
	if err != nil {
		return false, "", err
	}
	if r == nil {
		return false, "", err
	}
	return true, string(r.Value), nil
}
631360
func (l *DynamoDBLock) Value() (bool, string, error) {
	entry, err := l.backend.Get(context.Background(), l.key)
	if err != nil {
		return false, "", err
	}
	if entry == nil {
		return false, "", nil
	}

	return true, string(entry.Value), nil
}
395247
func (i *ArrayIterator) Value() (Slice, error) {
	if i.position >= i.size {
		return nil, WithStack(IndexOutOfBoundsError)
	}
	if current := i.current; current != nil {
		return current, nil
	}
	value, err := i.s.At(i.position)
	return value, WithStack(err)
}
780384
func (i *blockIter) Value() []byte {
	if i.soi {
		return nil
	}
	return i.val[:len(i.val):len(i.val)]
}
1268189
func Duration(val interface{}) time.Duration {
	switch t := val.(type) {
	case int:
		return time.Duration(int64(t))
	case int8:
		return time.Duration(int64(t))
	case int16:
		return time.Duration(int64(t))
	case int32:
		return time.Duration(int64(t))
	case int64:
		return time.Duration(t)
	case uint:
		return time.Duration(int64(t))
	case uint8:
		return time.Duration(int64(t))
	case uint16:
		return time.Duration(int64(t))
	case uint32:
		return time.Duration(int64(t))
	case uint64:
		return time.Duration(int64(t))
	default:
		return strToDuration(String(val))
	}
	panic("Reached")
}
180023
func (m *PCPSingletonMetric) Set(val interface{}) error {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	return m.set(val)
}
332848
func Counter(sampleRate float32, bucket string, n ...int) {
	CurrentStatter.Counter(sampleRate, bucket, n...)
}
1263917
func (kv KeyVal) Value() string {
	if !strings.Contains(string(kv), "=") {
		return ""
	}
	return strings.SplitN(strings.TrimSpace(string(kv)), "=", 2)[1]
}
1183797
func (as ArraySpec) Pow(val Input) Input {
	return as.proc(func(i Input) Input {
		return i.Pow(val)
	})
}
577691
func (m *Multi) Val(i int) []byte {
	off := i * m.stride
	return m.page[off : off+m.stride]
}