se.liu.ida.critiquer.mics
Class Utils
java.lang.Object
se.liu.ida.critiquer.mics.Utils
public class Utils
- extends Object
Constructor Summary |
Utils()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
getPointInRectangle
public Point getPointInRectangle(int x,
int y,
Rectangle2D area)
- Returns a point based on (x, y) but constrained to be within the bounds
of the given rectangle. Borrowed from ChartPanel in JFreeChart.
- Parameters:
x
- the x-coordinate.y
- the y-coordinate.area
- the rectangle (null
not permitted).
- Returns:
- A point within the rectangle.
getCenter
public static Point getCenter(Shape shape)
getAllInterfaces
public static List<Class> getAllInterfaces(Class constraintClass)
toVector
public static <T> Vector<T> toVector(Collection<T> c)
toVector
public static <T> Vector<T> toVector(T[] c)
find
public static <T> T find(Collection<T> c,
Predicate<T> comp)
findAll
public static <T> ArrayList<T> findAll(Collection<T> c,
Predicate<T> comp)
map
public static <In,Out> List<Out> map(UnaryFunction<In,Out> fn,
Collection<In> l)