1 /*******************************************************************************
2 * Copyright (c) 2011 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.util
;
15 import java
.util
.ArrayList
;
18 * <b><u>TmfSortedArrayList</u></b>
22 public class TmfSortedArrayList
<T
> extends ArrayList
<T
> {
23 private static final long serialVersionUID
= 1L;
25 @SuppressWarnings("unchecked")
26 public void insertSorted(T value
) {
28 Comparable
<T
> cmp
= (Comparable
<T
>) value
;
29 for (int pos
= size() - 1; pos
> 0 && cmp
.compareTo(get(pos
- 1)) < 0; pos
--) {
31 set(pos
, get(pos
- 1));
This page took 0.036617 seconds and 5 git commands to generate.