edu.cmu.hcii.calo.util.Utility Class Reference

List of all members.

Detailed Description

Utility methods that need to be around for one reason or another.

Author:
Brian Ellis


Static Public Member Functions

static< T > T unchecked_cast (Object x)
 The Java runtime, in its infinite wisdom, decided to introduce a typechecking mechanism into Java 1.5 and higher.


Member Function Documentation

static <T> T edu.cmu.hcii.calo.util.Utility.unchecked_cast ( Object  x  )  [static]

The Java runtime, in its infinite wisdom, decided to introduce a typechecking mechanism into Java 1.5 and higher.

This is usually great, but in many cases it's impossible to satisfy the typechecker while using features introduces in earlier versions of Java, like the clone() method (which returns Object, and makes you cast to the right thing after the fact). You can suppress typechecking warnings, but only on a per-method scope, which is bad if you actually do have a type violation somewhere else in the same method. This method, therefore, restricts the scope of the unchecked code to only an individual cast.

Parameters:
x the thing you want to cast
Returns:
x, cast as a T


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:21 2007 for CALO by  doxygen 1.5.2