de.uni_leipzig.bf.util
Class ValuedAlphaList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<java.lang.Comparable>
              extended by de.uni_leipzig.bf.util.AlphaList
                  extended by de.uni_leipzig.bf.util.ValuedAlphaList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Comparable>, java.util.Collection<java.lang.Comparable>, java.util.List<java.lang.Comparable>, java.util.RandomAccess

public class ValuedAlphaList
extends AlphaList

All elements are treated as strings A?B?Value

Author:
Ngonga
See Also:
Serialized Form
 

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ValuedAlphaList()
           
 
Method Summary
 boolean addd(java.lang.Comparable o)
          add elements in alphabetic order
 java.lang.String convert(java.lang.Comparable o)
           
 java.lang.String getKey(int i)
           
 java.lang.String getKeyOne(int i)
           
 java.lang.String getKeyTwo(int i)
           
 double getValue(int i)
           
 int idxOf(java.lang.Comparable o)
          Implements a binary search to find objects in the list.
static void main(java.lang.String[] args)
           
 
Methods inherited from class de.uni_leipzig.bf.util.AlphaList
containss, insert
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ValuedAlphaList

public ValuedAlphaList()
Method Detail

addd

public boolean addd(java.lang.Comparable o)
Description copied from class: AlphaList
add elements in alphabetic order

Overrides:
addd in class AlphaList
Parameters:
o - The object to add
Returns:
true is everything went well

convert

public java.lang.String convert(java.lang.Comparable o)

getKey

public java.lang.String getKey(int i)

getKeyOne

public java.lang.String getKeyOne(int i)

getKeyTwo

public java.lang.String getKeyTwo(int i)

getValue

public double getValue(int i)

idxOf

public int idxOf(java.lang.Comparable o)
Description copied from class: AlphaList
Implements a binary search to find objects in the list. Time complexity is thus logarithmic.

Overrides:
idxOf in class AlphaList
Parameters:
o - Object to look for
Returns:
-1 if the object is not in the list, else the index of the object

main

public static void main(java.lang.String[] args)