private static void checkValidPropertyName(final String propertyName) { Guardian.assertNotNullOrEmpty("propertyName", propertyName); }
/** * @param fileName * * @return if it is a ceos header */ private static boolean isFastCEOSHeader(final String fileName) { Guardian.assertNotNullOrEmpty("fileName", fileName); return fileName.equalsIgnoreCase("VDF_DAT"); }
/** * @param fileName * * @return if it is a ceos header */ private static boolean isFastCEOSHeader(final String fileName) { Guardian.assertNotNullOrEmpty("fileName", fileName); return fileName.equalsIgnoreCase("VDF_DAT"); }
public static int[] parseEastingNorthing(final String text) throws ParseException { Guardian.assertNotNullOrEmpty("text", text); if (text.length() == 0) { return null; } return PARSER.parse(text); }
/** * Sets the geolocation dataset names. * * @param lat the name of the dataset providing the latitude values, must not be null * @param lon the name of the dataset providing the longitude values, must not be null */ public void setGeolocationDatasetNames(String lat, String lon) { Guardian.assertNotNullOrEmpty("lat", lat); Guardian.assertNotNullOrEmpty("lon", lon); setGeolocationDatasetNames(new String[]{lat, lon}); }
/** * @param fileNameWithoutExt checks if the file with the given file name (without extension) is also a header file * * @return if it is a FAST L5 Header */ private boolean isFastL5Header(final String fileNameWithoutExt) { Guardian.assertNotNullOrEmpty("fileNameWithoutExt", fileNameWithoutExt); if (fileNameWithoutExt.equalsIgnoreCase(Landsat5FASTConstants.L5_HEADER_FILE_NAME)) { if (inputFile.length() == Landsat5FASTConstants.FAST_FORMAT_HEADER_SIZE) { return true; } } return false; }
public static int getExtensionDotPos(String path) { Guardian.assertNotNullOrEmpty("path", path); int extensionDotPos = path.lastIndexOf('.'); if (extensionDotPos > 0) { int lastSeparatorPos = path.lastIndexOf('/'); lastSeparatorPos = Math.max(lastSeparatorPos, path.lastIndexOf('\\')); lastSeparatorPos = Math.max(lastSeparatorPos, path.lastIndexOf(':')); if (lastSeparatorPos < extensionDotPos - 1) { return extensionDotPos; } } return -1; }
public MapProjection(String name, MapTransform mapTransform, String mapUnit, boolean preDefined) { Guardian.assertNotNullOrEmpty("name", name); Guardian.assertNotNull("mapTransform", mapTransform); _name = name; _mapTransform = mapTransform; _mapUnit = mapUnit; _preDefined = preDefined; }
public UserInputHistory(int maxNumEntries, String propertyKey) { Guardian.assertNotNullOrEmpty("propertyKey", propertyKey); _propertyKey = propertyKey; setMaxNumEntries(maxNumEntries); }
/** * Sets a value of type <code>boolean</code>. * * @param key the key * @param value the value * * @throws IllegalArgumentException */ public void setPropertyBool(String key, boolean value) { Guardian.assertNotNullOrEmpty("key", key); setPropertyBool(key, value ? Boolean.TRUE : Boolean.FALSE); }
/** * Tests if a tie-point grid with the given name is contained in this product. * * @param name the name, must not be <code>null</code> * * @return <code>true</code> if a tie-point grid with the given name is contained in this product, * <code>false</code> otherwise */ public boolean containsTiePointGrid(final String name) { Guardian.assertNotNullOrEmpty("name", name); return tiePointGridGroup.contains(name); }
/** * Tests if a element with the given name is contained in this element. * * @param name the name, must not be <code>null</code> * * @return <code>true</code> if a element with the given name is contained in this element, <code>false</code> * otherwise */ public boolean containsElement(String name) { Guardian.assertNotNullOrEmpty("name", name); return elements != null && elements.contains(name); }
/** * Returns the tie-point grid with the given name. * * @param name the tie-point grid name * * @return the tie-point grid with the given name or <code>null</code> if a tie-point grid with the given name is * not contained in this product. */ public TiePointGrid getTiePointGrid(final String name) { Guardian.assertNotNullOrEmpty("name", name); return tiePointGridGroup.get(name); }
/** * Constructs the object with default values * * @param parent the parent editor * @param label the label for this editor */ public FileArrayEditor(final EditorParent parent, String label) { Guardian.assertNotNullOrEmpty("label", label); _parent = parent; _label = label; _fileList = new ArrayList<File>(); _listComponent = new JList(); setName(_listComponent, _label); }
/** * Constructs a new product node with the given name and an optional description. * * @param name the node name, must not be <code>null</code> * @param description a descriptive string, can be <code>null</code> * @throws IllegalArgumentException if the given name is not a valid node identifier */ protected ProductNode(String name, String description) { Guardian.assertNotNull("name", name); name = name.trim(); Guardian.assertNotNullOrEmpty("name", name); this.name = name; this.description = description; }
/** * Tests if a band with the given name is contained in this product. * * @param name the name, must not be <code>null</code> * * @return <code>true</code> if a band with the given name is contained in this product, <code>false</code> * otherwise * * @throws IllegalArgumentException if the given name is <code>null</code> or empty. */ public boolean containsBand(final String name) { Guardian.assertNotNullOrEmpty("name", name); return bandGroup.contains(name); }
public ElevationModelDescriptor getDescriptor(String demName) { Guardian.assertNotNullOrEmpty("demName", demName); Set<ElevationModelDescriptor> services = descriptors.getServices(); for (ElevationModelDescriptor descriptor : services) { if (demName.equalsIgnoreCase(descriptor.getName())) { return descriptor; } } return null; }
public PointingFactory getPointingFactory(String productType) { Guardian.assertNotNullOrEmpty("productType", productType); Set<PointingFactory> services = typeToFactoryMap.getServices(); for (PointingFactory descriptor : services) { String[] supportedProductTypes = descriptor.getSupportedProductTypes(); for (String supportedType : supportedProductTypes) { if (productType.equalsIgnoreCase(supportedType)) { return descriptor; } } } return null; }
/** * Sets a value of type <code>Integer</code>. * * @param key the key * @param newValue the value * * @throws IllegalArgumentException */ public void setPropertyInt(String key, Integer newValue) { Guardian.assertNotNullOrEmpty("key", key); Integer oldValue = getPropertyInt(key, null); changeInternalProperty(key, oldValue, newValue); }
/** * Sets a value of type <code>Boolean</code>. * * @param key the key * @param newValue the new value * * @throws IllegalArgumentException */ public void setPropertyBool(String key, Boolean newValue) { Guardian.assertNotNullOrEmpty("key", key); Boolean oldValue = getPropertyBool(key, null); changeInternalProperty(key, oldValue, newValue); }