org.ocltf.utils
Class FacadeUtils

java.lang.Object
  extended byorg.ocltf.utils.FacadeUtils

public class FacadeUtils
extends java.lang.Object

Contains utilities for dealing with model "facade" objects.

Author:
Chad Brandon
See Also:
ModelFacade

Constructor Summary
FacadeUtils()
           
 
Method Summary
static java.util.Collection filterElementsByType(java.util.Collection elements, java.lang.Class type)
          Filters the elements for the elements collection by the specified type.
static java.lang.Object getElementAsType(java.lang.Object element, java.lang.Class type)
          Checks to see if the element is the specified type and if so casts it to the object and returns it, otherwise it returns null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacadeUtils

public FacadeUtils()
Method Detail

getElementAsType

public static java.lang.Object getElementAsType(java.lang.Object element,
                                                java.lang.Class type)
Checks to see if the element is the specified type and if so casts it to the object and returns it, otherwise it returns null.

Parameters:
element - the element to check.
type - the Class type.
Returns:
java.lang.Object

filterElementsByType

public static java.util.Collection filterElementsByType(java.util.Collection elements,
                                                        java.lang.Class type)
Filters the elements for the elements collection by the specified type.

Parameters:
elements - the elements to filter.
type - the model element type which to filter by
Returns:
java.util.Collection


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.