Raymond | dee0849 | 2015-04-02 10:43:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | * contributor license agreements. See the NOTICE file distributed with |
| 4 | * this work for additional information regarding copyright ownership. |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | * (the "License"); you may not use this file except in compliance with |
| 7 | * the License. You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | package org.apache.commons.math.stat.descriptive.rank; |
| 18 | |
| 19 | import java.io.Serializable; |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * Returns the median of the available values. This is the same as the 50th percentile. |
| 24 | * See {@link Percentile} for a description of the algorithm used. |
| 25 | * <p> |
| 26 | * <strong>Note that this implementation is not synchronized.</strong> If |
| 27 | * multiple threads access an instance of this class concurrently, and at least |
| 28 | * one of the threads invokes the <code>increment()</code> or |
| 29 | * <code>clear()</code> method, it must be synchronized externally.</p> |
| 30 | * |
| 31 | * @version $Revision: 811685 $ $Date: 2009-09-05 19:36:48 +0200 (sam. 05 sept. 2009) $ |
| 32 | */ |
| 33 | public class Median extends Percentile implements Serializable { |
| 34 | |
| 35 | /** Serializable version identifier */ |
| 36 | private static final long serialVersionUID = -3961477041290915687L; |
| 37 | |
| 38 | /** |
| 39 | * Default constructor. |
| 40 | */ |
| 41 | public Median() { |
| 42 | super(50.0); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Copy constructor, creates a new {@code Median} identical |
| 47 | * to the {@code original} |
| 48 | * |
| 49 | * @param original the {@code Median} instance to copy |
| 50 | */ |
| 51 | public Median(Median original) { |
| 52 | super(original); |
| 53 | } |
| 54 | |
| 55 | } |