Class ZetAnalyzer

java.lang.Object
  extended byZetAnalyzer

public class ZetAnalyzer
extends java.lang.Object

Provides static methods for finding sets.


Constructor Summary
ZetAnalyzer()
           
 
Method Summary
static int[] findZet(ZetCard[] cards)
          Finds the indices of three cards from a given array that form a "set".
static boolean isZet(ZetCard card1, ZetCard card2, ZetCard card3)
          Returns true if card1, card2, and card3 form a "set," false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZetAnalyzer

public ZetAnalyzer()
Method Detail

isZet

public static boolean isZet(ZetCard card1,
                            ZetCard card2,
                            ZetCard card3)
Returns true if card1, card2, and card3 form a "set," false otherwise.

Parameters:
card1 - the first card.
card2 - the second card.
card3 - the third card.
Returns:
true if card1, card2, and card3 form a "set"; false otherwise.

findZet

public static int[] findZet(ZetCard[] cards)
Finds the indices of three cards from a given array that form a "set". cards may contain nulls.

Parameters:
cards - an array of "set" cards.
Returns:
An array that contains the indices of the three cards that form a "set," or null if no sets are found.