Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*-
  * See the file LICENSE for redistribution information.
  *
  * Copyright (c) 2002, 2013 Oracle and/or its affiliates.  All rights reserved.
  *
  */
 
 package com.sleepycat.je.utilint;

A long stat which maintains a minimum value. It is intialized to Long.MAX_VALUE. The setMin() method assigns the counter to MIN(counter, new value).
public class LongMinStat extends LongStat {
    private static final long serialVersionUID = 1L;
    public LongMinStat(StatGroup groupStatDefinition definition) {
        super(groupdefinition);
        clear();
    }
    public LongMinStat(StatGroup group,
                       StatDefinition definition,
                       long counter) {
        super(groupdefinition);
        this. = counter;
    }
    @Override
    public void clear() {
        set(.);
    }

    
Set stat to MIN(current stat value, newValue).
    public void setMin(long newValue) {
         = ( > newValue) ? newValue : ;
    }
    @Override
    protected String getFormattedValue() {
        if ( == .) {
            return "NONE";
        }
        return ..format();
    }
New to GrepCode? Check out our FAQ X