/** * set the default sampling; this is an unavoidable violation of MathType immutability - a * RealTupleType must be an argument (directly or through a SetType) to the constructor of its * default Set; this method throws an Exception if getDefaultSet has previously been invoked */ public synchronized void setDefaultSet(Set sampling) throws VisADException { if (sampling.getDimension() != getDimension()) { throw new SetException("RealTupleType.setDefaultSet: dimensions don't match"); } if (DefaultSetEverAccessed) { throw new TypeException("RealTupleType: DefaultSet already accessed" + " so cannot change"); } DefaultSet = sampling; /* WLH 4 Feb 98 copied from constructor */ if (DefaultSet != null && !Unit.canConvertArray(DefaultSet.getSetUnits(), DefaultUnits)) { throw new UnitException( "RealTupleType: default Set Units must be " + "convertable with default Units"); } if (DefaultCoordinateSystem != null && DefaultSet != null) { CoordinateSystem cs = DefaultSet.getCoordinateSystem(); if (cs != null && !cs.getReference().equals(DefaultCoordinateSystem.getReference())) { throw new CoordinateSystemException( "RealTupleType: Default coordinate system " + DefaultCoordinateSystem.getReference() + " must match" + " default set CoordinateSystem " + (cs == null ? null : cs.getReference())); } if (!Unit.canConvertArray( DefaultCoordinateSystem.getCoordinateSystemUnits(), DefaultSet.getSetUnits())) { throw new UnitException( "RealTupleType: CoordinateSystem Units must be " + "convertable with default Set Units"); } } }