ucar.unidata.data.imagery
Class AddeImageDescriptor

java.lang.Object
  extended by ucar.unidata.data.imagery.AddeImageDescriptor
All Implemented Interfaces:
Comparable, XmlDelegate, XmlPersistable

public class AddeImageDescriptor
extends Object
implements Comparable, XmlPersistable, XmlDelegate

A class to hold an image directory + the location

Version:
$Revision: 1.27 $
Author:
IDV Development Team

Constructor Summary
AddeImageDescriptor()
          Default constructor for unpersistence; does nothing
AddeImageDescriptor(AddeImageDescriptor that)
          Create a descriptor from another.
AddeImageDescriptor(AreaDirectory directory, String imageSource)
          Create an image descriptor from the source and AreaDirectory
AddeImageDescriptor(AreaDirectory directory, String imageSource, AddeImageInfo info)
          Create an image descriptor from the source and AreaDirectory
AddeImageDescriptor(int relativeIndex, AddeImageDescriptor that)
          Create a descriptor from another, but change the relative index
AddeImageDescriptor(String imageSource)
          Create an image descriptor from the source
 
Method Summary
 int compareTo(Object o)
          Implementation for Comparable.
 Element createElement(XmlEncoder encoder)
          We just have this here so we can define a XmlDelegate for the AreaDirectory class
 Element createElement(XmlEncoder encoder, Object object)
          This is the delegate method for AreaDirectory
 Object createObject(XmlEncoder encoder, Element element)
          Create an image descriptor from the XML element
 boolean equals(Object o)
          See if this AddeImageDescriptor is equal to the object in question
 AreaDirectory getDirectory()
          Get the AreaDirectory (used by XML persistence)
 AddeImageInfo getImageInfo()
          Get the image info of this image (used by persistence)
 DateTime getImageTime()
          Get the time of the image
 boolean getIsRelative()
          Get the IsRelative property.
 int getRelativeIndex()
          Get the RelativeIndex property.
 String getSource()
          Get the source of this image (used by persistence)
 boolean initFromXml(XmlEncoder encoder, Element element)
          DO nothing.
protected  boolean isFromFile()
          Does this represent a file
 void setDirectory(AreaDirectory d)
          Set the AreaDirectory (used by XML persistence)
 void setImageInfo(AddeImageInfo s)
          Set the image info of this image (used by persistence)
 void setIsRelative(boolean value)
          Set the IsRelative property.
 void setRelativeIndex(int value)
          Set the RelativeIndex property.
 void setSource(String s)
          Set the source of this image (used by persistence)
 String toString()
          Get a text representation of this object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddeImageDescriptor

public AddeImageDescriptor()
Default constructor for unpersistence; does nothing


AddeImageDescriptor

public AddeImageDescriptor(int relativeIndex,
                           AddeImageDescriptor that)
Create a descriptor from another, but change the relative index

Parameters:
relativeIndex - new relative index
that - other image descriptor

AddeImageDescriptor

public AddeImageDescriptor(AddeImageDescriptor that)
Create a descriptor from another.

Parameters:
that - other image descriptor

AddeImageDescriptor

public AddeImageDescriptor(String imageSource)
Create an image descriptor from the source

Parameters:
imageSource - ADDE URL

AddeImageDescriptor

public AddeImageDescriptor(AreaDirectory directory,
                           String imageSource)
Create an image descriptor from the source and AreaDirectory

Parameters:
directory - image metadata
imageSource - ADDE URL of image

AddeImageDescriptor

public AddeImageDescriptor(AreaDirectory directory,
                           String imageSource,
                           AddeImageInfo info)
Create an image descriptor from the source and AreaDirectory

Parameters:
directory - image metadata
imageSource - ADDE URL of image
info - Image info
Method Detail

isFromFile

protected boolean isFromFile()
Does this represent a file

Returns:
Is it a file

createElement

public Element createElement(XmlEncoder encoder)
We just have this here so we can define a XmlDelegate for the AreaDirectory class

Specified by:
createElement in interface XmlPersistable
Parameters:
encoder - encoder to use
Returns:
encoded version of this

createObject

public Object createObject(XmlEncoder encoder,
                           Element element)
Create an image descriptor from the XML element

Specified by:
createObject in interface XmlDelegate
Parameters:
encoder - encoder to use
element - XML description of this object
Returns:
image description based on the element

initFromXml

public boolean initFromXml(XmlEncoder encoder,
                           Element element)
DO nothing. Just here for the XmlPersistable interface.

Specified by:
initFromXml in interface XmlPersistable
Parameters:
encoder - encoder for XML
element - XML element
Returns:
true

createElement

public Element createElement(XmlEncoder encoder,
                             Object object)
This is the delegate method for AreaDirectory

Specified by:
createElement in interface XmlDelegate
Parameters:
encoder - XML encoder for this object
object - an AddeImageDescriptor
Returns:
XML representation

getDirectory

public AreaDirectory getDirectory()
Get the AreaDirectory (used by XML persistence)

Returns:
this objects image metadata

setDirectory

public void setDirectory(AreaDirectory d)
Set the AreaDirectory (used by XML persistence)

Parameters:
d - image metadata

getSource

public String getSource()
Get the source of this image (used by persistence)

Returns:
ADDE URL

setSource

public void setSource(String s)
Set the source of this image (used by persistence)

Parameters:
s - the ADDE URL for this image

getImageInfo

public AddeImageInfo getImageInfo()
Get the image info of this image (used by persistence)

Returns:
AddeImageInfo

setImageInfo

public void setImageInfo(AddeImageInfo s)
Set the image info of this image (used by persistence)

Parameters:
s - the AddeImageInfo for this image

setIsRelative

public void setIsRelative(boolean value)
Set the IsRelative property.

Parameters:
value - The new value for IsRelative

getIsRelative

public boolean getIsRelative()
Get the IsRelative property.

Returns:
The IsRelative property

setRelativeIndex

public void setRelativeIndex(int value)
Set the RelativeIndex property.

Parameters:
value - The new value for RelativeIndex

getRelativeIndex

public int getRelativeIndex()
Get the RelativeIndex property.

Returns:
The RelativeIndex

getImageTime

public DateTime getImageTime()
Get the time of the image

Returns:
nominal time of the image (may be null)

toString

public String toString()
Get a text representation of this object

Overrides:
toString in class Object
Returns:
representation as a String

compareTo

public int compareTo(Object o)
Implementation for Comparable.

Specified by:
compareTo in interface Comparable
Parameters:
o - object in question
Returns:
comparison
See Also:
Comparable

equals

public boolean equals(Object o)
See if this AddeImageDescriptor is equal to the object in question

Overrides:
equals in class Object
Parameters:
o - object in question
Returns:
true if o is an AddeImageDescriptor and they area equivalent