Package org.esa.snap.core.datamodel
Class FlagCoding
java.lang.Object
com.bc.ceres.core.ExtensibleObject
org.esa.snap.core.datamodel.ProductNode
org.esa.snap.core.datamodel.MetadataElement
org.esa.snap.core.datamodel.SampleCoding
org.esa.snap.core.datamodel.FlagCoding
- All Implemented Interfaces:
Extensible
Provides the information required to decode integer sample values that
are combined of single flags (bit indexes).
-
Field Summary
Fields inherited from class org.esa.snap.core.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME -
Constructor Summary
ConstructorsConstructorDescriptionFlagCoding(String name) Constructs a new flag coding object with the given name. -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisitor(ProductVisitor visitor) Accepts the given visitor.Adds a new flag definition to this flags coding.Adds a new flag definition to this flags coding.Returns a metadata attribute wich is the representation of the flag with the given name.intgetFlagMask(String name) Returns the flag mask value for the specified flag name.String[]Returns a string array which contains the names of all flags contained in thisFlagCodingobject.Methods inherited from class org.esa.snap.core.datamodel.SampleCoding
addAttribute, addElement, addSample, addSamples, getSampleCount, getSampleName, getSampleValueMethods inherited from class org.esa.snap.core.datamodel.MetadataElement
addElementAt, containsAttribute, containsElement, createDeepClone, dispose, getAttribute, getAttributeAt, getAttributeDouble, getAttributeDouble, getAttributeIndex, getAttributeInt, getAttributeInt, getAttributeNames, getAttributes, getAttributeString, getAttributeString, getAttributeUTC, getAttributeUTC, getElement, getElementAt, getElementGroup, getElementIndex, getElementNames, getElements, getNumAttributes, getNumElements, getParentElement, getRawStorageSize, removeAttribute, removeElement, setAttributeDouble, setAttributeInt, setAttributeString, setAttributeUTC, setModifiedMethods inherited from class org.esa.snap.core.datamodel.ProductNode
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, setNodeName, setOwner, toString, updateExpressionMethods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
Constructor Details
-
FlagCoding
Constructs a new flag coding object with the given name.- Parameters:
name- the name
-
-
Method Details
-
getFlag
Returns a metadata attribute wich is the representation of the flag with the given name. This method delegates to getPropertyValue(String).- Parameters:
name- the flag name- Returns:
- a metadata attribute wich is the representation of the flag with the given name
-
getFlagNames
Returns a string array which contains the names of all flags contained in thisFlagCodingobject.- Returns:
- a string array which contains all names of this
FlagCoding.
If thisFlagCodingdoes not contain any flag,nullis returned
-
addFlag
Adds a new flag definition to this flags coding.- Parameters:
name- the flag nameflagMask- the flag's bit maskdescription- the description text- Returns:
- A new attribute representing the flag.
- Throws:
IllegalArgumentException- ifnameis null
-
addFlag
Adds a new flag definition to this flags coding.- Parameters:
name- the flag nameflagMask- the flag's bit maskdescription- the description text- Returns:
- A new attribute representing the flag.
- Throws:
IllegalArgumentException- ifnameis null- Since:
- SNAP 0.5
-
getFlagMask
Returns the flag mask value for the specified flag name.- Parameters:
name- the flag name- Returns:
- flagMask the flag's bit mask as a 32 bit integer
- Throws:
IllegalArgumentException- ifnameis null, or a flag with the name does not exist
-
acceptVisitor
Accepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.The method simply calls
visitor.visit(this).- Overrides:
acceptVisitorin classMetadataElement- Parameters:
visitor- the visitor, must not benull
-