001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.commons.math.stat.descriptive.rank;
018
019 import java.io.Serializable;
020
021
022 /**
023 * Returns the median of the available values. This is the same as the 50th percentile.
024 * See {@link Percentile} for a description of the algorithm used.
025 * <p>
026 * <strong>Note that this implementation is not synchronized.</strong> If
027 * multiple threads access an instance of this class concurrently, and at least
028 * one of the threads invokes the <code>increment()</code> or
029 * <code>clear()</code> method, it must be synchronized externally.</p>
030 *
031 * @version $Revision: 811685 $ $Date: 2009-09-05 19:36:48 +0200 (sam. 05 sept. 2009) $
032 */
033 public class Median extends Percentile implements Serializable {
034
035 /** Serializable version identifier */
036 private static final long serialVersionUID = -3961477041290915687L;
037
038 /**
039 * Default constructor.
040 */
041 public Median() {
042 super(50.0);
043 }
044
045 /**
046 * Copy constructor, creates a new {@code Median} identical
047 * to the {@code original}
048 *
049 * @param original the {@code Median} instance to copy
050 */
051 public Median(Median original) {
052 super(original);
053 }
054
055 }