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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.experiment
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfLocation
;
17 public class TmfLocationArray
implements Comparable
<TmfLocationArray
>, Cloneable
{
18 public ITmfLocation
<?
extends Comparable
<?
>>[] locations
;
20 public TmfLocationArray(ITmfLocation
<?
extends Comparable
<?
>>[] locations
) {
21 this.locations
= locations
;
24 @SuppressWarnings({ "unchecked", "rawtypes" })
26 public int compareTo(TmfLocationArray o
) {
27 for (int i
= 0; i
< locations
.length
; i
++) {
28 ITmfLocation
<?
extends Comparable
> l1
= (ITmfLocation
<?
extends Comparable
>) locations
[i
].getLocation();
29 ITmfLocation
<?
extends Comparable
> l2
= (ITmfLocation
<?
extends Comparable
>) o
.locations
[i
].getLocation();
30 int result
= l1
.getLocation().compareTo(l2
.getLocation());
39 * @see java.lang.Object#clone()
42 protected TmfLocationArray
clone() {
43 ITmfLocation
<?
extends Comparable
<?
>>[] clones
= (ITmfLocation
<?
extends Comparable
<?
>>[]) new ITmfLocation
<?
>[locations
.length
];
44 for (int i
= 0; i
< locations
.length
; i
++) {
45 clones
[i
] = locations
[i
].clone();
47 return new TmfLocationArray(clones
);
This page took 0.032611 seconds and 5 git commands to generate.