All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.TKnudsen.ComplexDataObject.data.ranking.RankingLinkedList Maven / Gradle / Ivy

Go to download

A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.

The newest version!
package com.github.TKnudsen.ComplexDataObject.data.ranking;

import java.util.LinkedList;

/**
 * 

* Title: RankingLinkedList *

* *

* Description: structures objects in sorted manner. Based on a * {@link LinkedList}. *

* *

* Copyright: Copyright (c) 2011-2015 *

* * @author Juergen Bernard * @version 1.03 */ public class RankingLinkedList> extends LinkedList { /** * */ private static final long serialVersionUID = -3625638957983883603L; public boolean add(T t) { for (int i = 0; i < this.size(); i++) { if (t.compareTo(get(i)) < 0) { this.add(i, t); return true; } } super.add(t); return true; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy