Google Data APIs Client Library (1.41.1)



com.google.gdata.data.geo.impl
Class BoxDataImpl

java.lang.Object
  extended by com.google.gdata.data.geo.impl.BoxDataImpl
All Implemented Interfaces:
BoxData

public class BoxDataImpl
extends java.lang.Object
implements BoxData

Implementation of the BoxData interface. Currently only supports a non-repeating Box extension. This class uses an ExtensionPoint that is passed in to store the Box extension.


Constructor Summary
BoxDataImpl(ExtensionPoint extensionPoint)
          Construct a new BoxData with the given extension point as the backing storage of the data.
 
Method Summary
static void clearBox(ExtensionPoint ext)
          Removes the first Box extension found on the extension point.
 void clearGeoBoundingBox()
          Clears the bounding box and removes the extension point.
 void declareExtensions(ExtensionProfile extProfile)
           
static Box getBox(ExtensionPoint ext)
          Helper method to retrieve the Box extension point.
 Box getGeoBoundingBox()
          Gets the geo bounding box for this extension point.
static void setBox(ExtensionPoint ext, Box box)
          Sets the geo bounding box of the extension passed in.
 void setGeoBoundingBox(Box box)
          Sets the geo bounding box to the given box.
 void setGeoBoundingBox(Point lowerLeft, Point upperRight)
          If there is an existing box this will set the new values on it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoxDataImpl

public BoxDataImpl(ExtensionPoint extensionPoint)
Construct a new BoxData with the given extension point as the backing storage of the data.

Method Detail

setGeoBoundingBox

public void setGeoBoundingBox(Point lowerLeft,
                              Point upperRight)
If there is an existing box this will set the new values on it. Otherwise it will create a new GeoRssWhere element to contain them. If just one argument is null it will throw an exception.

Specified by:
setGeoBoundingBox in interface BoxData
Parameters:
lowerLeft - the lower left coordinate of the box.
upperRight - the upper right coordinate of the box.

setGeoBoundingBox

public void setGeoBoundingBox(Box box)
Sets the geo bounding box to the given box. If there is an existing box it will copy the values from the given box, otherwise it will use the new box as the extension.

Specified by:
setGeoBoundingBox in interface BoxData
Parameters:
box - the box that bounds this entity.

getGeoBoundingBox

public Box getGeoBoundingBox()
Gets the geo bounding box for this extension point.

Specified by:
getGeoBoundingBox in interface BoxData
Returns:
a Box that contains the boundary for the content of this entity.

clearGeoBoundingBox

public void clearGeoBoundingBox()
Description copied from interface: BoxData
Clears the bounding box and removes the extension point.

Specified by:
clearGeoBoundingBox in interface BoxData

setBox

public static void setBox(ExtensionPoint ext,
                          Box box)
Sets the geo bounding box of the extension passed in. This will first try to replace any existing bounding box information. If there is no existing bounding box, then it'll simply add the box extension.

Parameters:
ext - The extension point to add the Box to.
box - The new box information.

getBox

public static Box getBox(ExtensionPoint ext)
Helper method to retrieve the Box extension point. Note this will return empty boxes but will only return an GeoRssWhere extension point if it contains a GmlEnvelope.

Parameters:
ext - The containing extension point.
Returns:
An extension point that implements the Box interface and contain box information.

clearBox

public static void clearBox(ExtensionPoint ext)
Removes the first Box extension found on the extension point. If the box extension is a GeoRssWhere, it will only remove the GeoRssWhere extension if it does not contain a Point extension.

Parameters:
ext - The extension point from which to clear the Box extension.

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)