databionics.util
Class IntegerList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList
                  extended by databionics.util.IntegerList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.Queue

public class IntegerList
extends java.util.LinkedList

LinkedList of Integers.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
IntegerList()
          Standard constructor without arguments.
IntegerList(java.util.Collection collection)
          Constructor with a collection of objects.
IntegerList(IntegerList list)
           
 
Method Summary
 IntegerList getDistinct()
          Get IntegerList without duplicates.
 int getDistinctCount()
          Get count of distinct numbers.
 int getFirstInt()
          Get first number without casting.
 java.lang.Integer getFirstInteger()
          Get first number without casting.
 int getInt(int index)
          Get a number by index without casting.
 java.lang.Integer getInteger(int index)
          Get a number by index without casting.
 int getLastInt()
          Get last number without casting.
 java.lang.Integer getLastInteger()
          Get last number without casting.
 java.lang.Integer getLeastFrequent()
          Find least frequent number in list.
 int getMax()
          Get maximum number in list.
 int getMin()
          Get minimum number in list.
 java.lang.Integer getMostFrequent()
          Find most frequent number in list.
 java.lang.String toString()
          Get string representation, numbers seperated with space.
 StringList toStringList()
          Get list of numbers as strings.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

IntegerList

public IntegerList()
Standard constructor without arguments.


IntegerList

public IntegerList(IntegerList list)

IntegerList

public IntegerList(java.util.Collection collection)
Constructor with a collection of objects. Each object is casted to an Integer.

Parameters:
v - Collection of objects.
Method Detail

getInteger

public java.lang.Integer getInteger(int index)
Get a number by index without casting.

Parameters:
index - Index of number in list
Returns:
Number at this index

getInt

public int getInt(int index)
Get a number by index without casting.

Parameters:
index - Index of number in list
Returns:
Number at this index

getFirstInteger

public java.lang.Integer getFirstInteger()
Get first number without casting.

Returns:
First number.

getFirstInt

public int getFirstInt()
Get first number without casting.

Returns:
First number.

getLastInteger

public java.lang.Integer getLastInteger()
Get last number without casting.

Returns:
Last number.

getLastInt

public int getLastInt()
Get last number without casting.

Returns:
Last number.

toString

public java.lang.String toString()
Get string representation, numbers seperated with space.

Overrides:
toString in class java.util.AbstractCollection
Returns:
Concatenated string of numbers separated with space.

toStringList

public StringList toStringList()
Get list of numbers as strings.

Returns:
StringList of numbers.

getMostFrequent

public java.lang.Integer getMostFrequent()
Find most frequent number in list.

Returns:
Returns most frequent number.

getLeastFrequent

public java.lang.Integer getLeastFrequent()
Find least frequent number in list.

Returns:
Returns least frequent number.

getDistinct

public IntegerList getDistinct()
Get IntegerList without duplicates.

Returns:
Returns list without any duplicates.

getDistinctCount

public int getDistinctCount()
Get count of distinct numbers.

Returns:
Returns size of getDistinct()

getMin

public int getMin()
Get minimum number in list.

Returns:
Returns value of smallest number in list.

getMax

public int getMax()
Get maximum number in list.

Returns:
Returns value of largest number in list.


Copyright © 2005-2006 Databionics Research Group. All Rights Reserved.