/** Returns the list of enumerations of the same kind than this enum. */ public PrecisionType[] family() { return values(); }
/** * Returns the precision type that matches the given string, or returns a new one if none match * it. * * @param code The name of the code to fetch or to create. * @return A code matching the given name. */ public static PrecisionType valueOf(String code) { return valueOf(PrecisionType.class, code); } }
/** * Returns the PrecisionType that matches the given string, or returns a * new one if none match it. */ public static PrecisionType valueOf(String code) { if (code == null) { return null; } synchronized (VALUES) { Iterator iter = VALUES.iterator(); while (iter.hasNext()) { PrecisionType type = (PrecisionType) iter.next(); if (code.equalsIgnoreCase(type.name())) { return type; } } return new PrecisionType(code, true); } } }
public void round( DirectPosition position ) { if (modelType.isFloating()){ // somekind of optimization return; } double coords[] = position.getCoordinates(); position.setOrdinate( 0, makePrecise( coords[0] )); position.setOrdinate( 1, makePrecise( coords[1] )); if( coords.length == 2 ) return; position.setOrdinate( 2, makePrecise( coords[2] )); if( coords.length == 3 ) return; for( int axis = 3; axis < position.getDimension(); axis++ ){ double ordinate = position.getOrdinate( axis ); ordinate = makePrecise( ordinate ); position.setOrdinate( axis, ordinate ); } } }
/** * Returns the list of enumerations of the same kind than this enum. */ public /*{PrecisionModelType}*/ CodeList[] family() { return values(); }
/** * Returns the precision type that matches the given string, or returns a * new one if none match it. More specifically, this methods returns the first instance for * which <code>{@linkplain #name() name()}.{@linkplain String#equals equals}(code)</code> * returns {@code true}. If no existing instance is found, then a new one is created for * the given name. * * @param code the name of the code to fetch or to create. * @return a code matching the given name. */ public static PrecisionType valueOf(String code) { return valueOf(PrecisionType.class, code); } }
/** * Returns the list of codes of the same kind than this code list element. * Invoking this method is equivalent to invoking {@link #values()}, except that * this method can be invoked on an instance of the parent {@code CodeList} class. * * @return all code {@linkplain #values() values} for this code list. */ @Override public PrecisionType[] family() { return values(); }