com.github.ignition.support
Class IgnitedArrays

java.lang.Object
  extended by com.github.ignition.support.IgnitedArrays

public class IgnitedArrays
extends Object


Constructor Summary
IgnitedArrays()
           
 
Method Summary
static
<T> T[]
delete(T[] array, int index)
           
static
<T> int
find(T[] array, T object)
          Attempts to find an object in a potentially unsorted array.
static
<T> T[]
join(T[] head, T[] tail)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnitedArrays

public IgnitedArrays()
Method Detail

join

public static <T> T[] join(T[] head,
                           T[] tail)

delete

public static <T> T[] delete(T[] array,
                             int index)

find

public static <T> int find(T[] array,
                           T object)
Attempts to find an object in a potentially unsorted array. Complexity is O(N).

Type Parameters:
T -
Parameters:
array - the input array
object - the object to find
Returns:
the index of the object if found, -1 otherwise.


Copyright © 2012. All Rights Reserved.