net.sf.jagg.msd
Class Discriminators

java.lang.Object
  extended by net.sf.jagg.msd.Discriminators

public class Discriminators
extends java.lang.Object

The Discriminators utility class supplies utility functionality for Discriminators.

Since:
0.5.0
Author:
Randy Gettman

Method Summary
static
<T> Discriminator<T>
getDiscriminator(java.lang.Class<T> c)
          Gets the proper Discriminator for a particular object's class.
static
<T> Discriminator<T>
getDiscriminator(T object)
          Gets the proper Discriminator for a particular object.
static
<T> java.util.List<T>
getFlattenedList(java.util.List<java.util.List<T>> listOfLists)
          "Flattens" a List of Lists into a new List of T objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDiscriminator

public static <T> Discriminator<T> getDiscriminator(T object)
Gets the proper Discriminator for a particular object.

Type Parameters:
T - The type of the object to be discriminated.
Parameters:
object - The object representing the type to be discriminated.
Returns:
A Discriminator capable of discriminating objects of type T, or null if one couldn't be found.

getDiscriminator

public static <T> Discriminator<T> getDiscriminator(java.lang.Class<T> c)
Gets the proper Discriminator for a particular object's class.

Type Parameters:
T - The type of the object to be discriminated.
Parameters:
c - The Class object representing the type to be discriminated.
Returns:
A Discriminator capable of discriminating objects of type T, or null if one couldn't be found.

getFlattenedList

public static <T> java.util.List<T> getFlattenedList(java.util.List<java.util.List<T>> listOfLists)
"Flattens" a List of Lists into a new List of T objects.

Type Parameters:
T - The type of object.
Parameters:
listOfLists - A List of Lists.
Returns:
A flattened List that contains only the elements of each of the internal lists, in the order found.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.