/** * Returns the BSplineSurfaceForm that matches the given string, or returns a * new one if none match it. */ public static BSplineSurfaceForm valueOf(String code) { if (code == null) { return null; } synchronized (VALUES) { Iterator iter = VALUES.iterator(); while (iter.hasNext()) { BSplineSurfaceForm type = (BSplineSurfaceForm) iter.next(); if (code.equalsIgnoreCase(type.name())) { return type; } } return new BSplineSurfaceForm(code); } } }