com.google.gdata.data.photos.impl
Class PhotoDataImpl

java.lang.Object
  extended by com.google.gdata.data.photos.impl.GphotoDataImpl
      extended by com.google.gdata.data.photos.impl.PhotoDataImpl
All Implemented Interfaces:
BoxData, PointData, Extensible, GphotoData, MediaData, PhotoData

public class PhotoDataImpl
extends GphotoDataImpl
implements PhotoData

Implementation class for photo data objects. This class takes an ExtensionPoint and uses it to provide all of the methods that PhotoData specifies. These methods are handled by using extension classes to retrieve or set extensions of the appropriate type.


Nested Class Summary
static class PhotoDataImpl.GphotoChecksum
          Simple checksum element, has a single string for the checksum.
static class PhotoDataImpl.GphotoClient
          Simple client element, has a single string for the client.
static class PhotoDataImpl.GphotoExifTime
          Deprecated. use ExifTags instead.
static class PhotoDataImpl.GphotoHeight
          Simple height element, has a single long for the height.
static class PhotoDataImpl.GphotoPosition
          Simple position element, has a single float for the position.
static class PhotoDataImpl.GphotoRotation
          Simple rotation element, has a single int for the rotation.
static class PhotoDataImpl.GphotoSize
          Simple size element, has a single long for the size.
static class PhotoDataImpl.GphotoStreamId
           
static class PhotoDataImpl.GphotoVideoStatus
          The gphoto:videostatus field.
static class PhotoDataImpl.GphotoVideoUrl
          Simple videosrc element, has the url to the video source of the item.
static class PhotoDataImpl.GphotoWidth
          Simple width element, has a single long for the width.
 
Nested classes/interfaces inherited from class com.google.gdata.data.photos.impl.GphotoDataImpl
GphotoDataImpl.GphotoRssLink, GphotoDataImpl.GphotoType
 
Field Summary
 
Fields inherited from interface com.google.gdata.data.photos.PhotoData
KIND, PHOTO_CATEGORY, PHOTO_KIND
 
Constructor Summary
PhotoDataImpl(ExtensionPoint extensionPoint)
          Construct a new implementation of PhotoGphotoData with the given extension point as the backing storage for data.
 
Method Summary
 void addStreamId(java.lang.String streamId)
          Add the streamId to the list of stream ids.
 void clearGeoBoundingBox()
          Clears the bounding box and removes the extension point.
 void clearPoint()
          Clears the point data and removes the extension point.
 void declareExtensions(ExtensionProfile extProfile)
          Declares the set of expected Extension types for an Extensible within the target extension profile.
 java.lang.String getAlbumId()
          The id of the album the photo is on.
 java.lang.String getChecksum()
          The checksum on the photo.
 java.lang.String getClient()
          The client string stored on the photo.
 java.lang.Integer getCommentCount()
          The number of comments on this photo.
 java.lang.Boolean getCommentsEnabled()
          Gets the status of the commenting preference on the photo.
 ExifTags getExifTags()
          The exif information on the photo.
 Box getGeoBoundingBox()
          Gets the bounding box of this entity.
 Point getGeoLocation()
          Gets the geo-location of the entity.
 java.lang.Long getHeight()
          The height of the photo in pixels.
 java.util.List<MediaCategory> getMediaCategories()
          Retrieve the list of media:category elements inside the media:group on this element.
 java.util.List<MediaContent> getMediaContents()
          Retrieve the list of media:content elements inside the media:group on this element.
 java.util.List<MediaCredit> getMediaCredits()
          Retrieve the list of media:credit elements inside the media:group on this element.
 MediaGroup getMediaGroup()
          Retrieve the media:group element on this element.
 MediaKeywords getMediaKeywords()
          Retrieve the list of media:keywords elements inside the media:group on this element.
 java.util.List<MediaThumbnail> getMediaThumbnails()
          Retrieve the list of media:thumbnail elements inside the media:group on this element.
 java.lang.Float getPosition()
          The position of the photo in the album.
 java.lang.Integer getRotation()
          The rotation of the photo.
 java.lang.Long getSize()
          The size of the photo in bytes.
 java.util.List<java.lang.String> getStreamIds()
          Get a list of stream ids on this element.
 java.util.Date getTimestamp()
          The time the photo was taken.
 java.lang.Long getVersion()
          The version of the image.
 java.lang.String getVideoStatus()
          The video status in case the photo entry is a video.
 java.lang.String getVideoUrl()
          Get the video url for the video that is being pointed at.
 java.lang.Long getWidth()
          The width of the photo in pixels.
 void setAlbumId(java.lang.Long albumId)
          Sets the album the photo is in.
 void setAlbumId(java.lang.String albumId)
          Sets the album the photo is in.
 void setChecksum(java.lang.String checksum)
          Set the checksum of the photo this item is about.
 void setClient(java.lang.String client)
          Set the client of the photo this item is about.
 void setCommentCount(java.lang.Integer commentCount)
          Set the number of comments on the photo this item represents.
 void setCommentsEnabled(java.lang.Boolean commentsEnabled)
          Set the whether comments are enabled in the photo this item represents.
 void setExifTags(ExifTags tags)
          Set the exif tags on the photo this item is about.
 void setGeoBoundingBox(Box boundingBox)
          Sets the bounding box for this entity based on a Box extension.
 void setGeoBoundingBox(Point lowerLeft, Point upperRight)
          Sets the bounding box based on two Point objects.
 void setGeoLocation(java.lang.Double lat, java.lang.Double lon)
          Sets the geo-location of the entity based on the lat and long coordinates passed in.
 void setGeoLocation(Point point)
          Sets the geo-location of the entity based on the Point extension.
 void setHeight(java.lang.Long height)
          Set the height of the photo the item is about.
 void setKeywords(MediaKeywords keywords)
          Set the media keywords on this element to the given keywords.
 void setPosition(java.lang.Float position)
          Set the position of the photo this item is about.
 void setRotation(java.lang.Integer rotation)
          Set the rotation in degrees of the photo.
 void setSize(java.lang.Long size)
          Set the size of the photo this item is about.
 void setTimestamp(java.util.Date timestamp)
          Set the timestamp on the photo this item is about.
 void setVersion(java.lang.Long version)
          Set the version of the photo this item is about.
 void setVideoStatus(java.lang.String videoStatus)
          Sets the video status of the video/photo entry.
 void setVideoUrl(java.lang.String videoUrl)
          Set the video url that points to the url of the actual video.
 void setWidth(java.lang.Long width)
          Set the width of the photo this item is about.
 
Methods inherited from class com.google.gdata.data.photos.impl.GphotoDataImpl
addExtension, addRepeatingExtension, declare, getBooleanValue, getDateValue, getExtension, getFloatValue, getGphotoId, getIntegerValue, getLongValue, getRepeatingExtension, getSimpleValue, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setGphotoId, setGphotoId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gdata.data.photos.GphotoData
getGphotoId, setGphotoId, setGphotoId
 
Methods inherited from interface com.google.gdata.data.photos.Extensible
addExtension, addRepeatingExtension, removeExtension, removeExtension, removeRepeatingExtension, setExtension
 

Constructor Detail

PhotoDataImpl

public PhotoDataImpl(ExtensionPoint extensionPoint)
Construct a new implementation of PhotoGphotoData with the given extension point as the backing storage for data.

Method Detail

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Description copied from interface: Extensible
Declares the set of expected Extension types for an Extensible within the target extension profile. Forwards to ExtensionPoint.declareExtensions(ExtensionProfile).

Specified by:
declareExtensions in interface Extensible
Overrides:
declareExtensions in class GphotoDataImpl
Parameters:
extProfile - the ExtensionProfile to initialize.

getVideoUrl

public java.lang.String getVideoUrl()
Get the video url for the video that is being pointed at.


setVideoUrl

public void setVideoUrl(java.lang.String videoUrl)
Set the video url that points to the url of the actual video. PheedVideoUrl is deprecated but included for backwards compatibility with older clients.


getVersion

public java.lang.Long getVersion()
                          throws ParseException
Description copied from interface: PhotoData
The version of the image. This is the version of the image itself, and is changed whenever the image content is changed (such as by rotation).

Specified by:
getVersion in interface PhotoData
Returns:
the gphoto:version on the item.
Throws:
ParseException

setVersion

public void setVersion(java.lang.Long version)
Set the version of the photo this item is about.

Specified by:
setVersion in interface PhotoData
Parameters:
version - the version of the photo.

getPosition

public java.lang.Float getPosition()
                            throws ParseException
Description copied from interface: PhotoData
The position of the photo in the album. This can be used to order the photo based on where the user has placed it within the album.

Specified by:
getPosition in interface PhotoData
Returns:
the gphoto:position of the photo.
Throws:
ParseException

setPosition

public void setPosition(java.lang.Float position)
Set the position of the photo this item is about. This is the photo's position in the album it is in (in the context of the feed).

Specified by:
setPosition in interface PhotoData
Parameters:
position - the position of the photo in the album.

getAlbumId

public java.lang.String getAlbumId()
Description copied from interface: PhotoData
The id of the album the photo is on.

Specified by:
getAlbumId in interface PhotoData
Returns:
the gphoto:albumId of the photo.

setAlbumId

public void setAlbumId(java.lang.String albumId)
Sets the album the photo is in.

Specified by:
setAlbumId in interface PhotoData

setAlbumId

public void setAlbumId(java.lang.Long albumId)
Sets the album the photo is in.

Specified by:
setAlbumId in interface PhotoData

getVideoStatus

public java.lang.String getVideoStatus()
Description copied from interface: PhotoData
The video status in case the photo entry is a video.

Specified by:
getVideoStatus in interface PhotoData
Returns:
the gphoto:videostatus of the video/photo.

setVideoStatus

public void setVideoStatus(java.lang.String videoStatus)
Sets the video status of the video/photo entry.

Specified by:
setVideoStatus in interface PhotoData

getWidth

public java.lang.Long getWidth()
                        throws ParseException
Description copied from interface: PhotoData
The width of the photo in pixels. This is the width of the original image stored in the database, but not necessarily the width of the image returned by querying the image url (depending on image size).

Specified by:
getWidth in interface PhotoData
Returns:
the gphoto:width of the photo.
Throws:
ParseException

setWidth

public void setWidth(java.lang.Long width)
Set the width of the photo this item is about.

Specified by:
setWidth in interface PhotoData
Parameters:
width - the width of the photo.

getHeight

public java.lang.Long getHeight()
                         throws ParseException
Description copied from interface: PhotoData
The height of the photo in pixels. This is the height of the original image stored in the database, but not necessarily the height of the image returned by querying the image url (depending on image size).

Specified by:
getHeight in interface PhotoData
Returns:
the gphoto:height of the photo.
Throws:
ParseException

setHeight

public void setHeight(java.lang.Long height)
Set the height of the photo the item is about.

Specified by:
setHeight in interface PhotoData
Parameters:
height - the height of the photo.

getRotation

public java.lang.Integer getRotation()
                              throws ParseException
Description copied from interface: PhotoData
The rotation of the photo. This is only useful when downloading the original photo as the rotation is taken into account on thumbnails and the image is always provided in the right orientation.

Specified by:
getRotation in interface PhotoData
Returns:
the gphoto:rotation of the photo.
Throws:
ParseException

setRotation

public void setRotation(java.lang.Integer rotation)
Set the rotation in degrees of the photo.

Specified by:
setRotation in interface PhotoData
Parameters:
rotation - the rotation of the photo.

getSize

public java.lang.Long getSize()
                       throws ParseException
Description copied from interface: PhotoData
The size of the photo in bytes. Read only, calculated by the server.

Specified by:
getSize in interface PhotoData
Returns:
the gphoto:size of the photo.
Throws:
ParseException

setSize

public void setSize(java.lang.Long size)
Set the size of the photo this item is about.

Specified by:
setSize in interface PhotoData
Parameters:
size - the size of the photo.

getClient

public java.lang.String getClient()
Description copied from interface: PhotoData
The client string stored on the photo. Clients can use this to provide additional information about the photo that they can use later.

Specified by:
getClient in interface PhotoData
Returns:
the gphoto:client of the photo.

setClient

public void setClient(java.lang.String client)
Set the client of the photo this item is about.

Specified by:
setClient in interface PhotoData
Parameters:
client - the client that created the photo.

getChecksum

public java.lang.String getChecksum()
Description copied from interface: PhotoData
The checksum on the photo. This is another piece of client-provided information that will be stored on the server and returned to the client.

Specified by:
getChecksum in interface PhotoData
Returns:
the gphoto:checksum of the photo.

setChecksum

public void setChecksum(java.lang.String checksum)
Set the checksum of the photo this item is about.

Specified by:
setChecksum in interface PhotoData
Parameters:
checksum - the checksum on the photo.

getTimestamp

public java.util.Date getTimestamp()
                            throws ParseException
Description copied from interface: PhotoData
The time the photo was taken. Modifiable by the client.

Specified by:
getTimestamp in interface PhotoData
Returns:
the gphoto:timestamp of the photo.
Throws:
ParseException

setTimestamp

public void setTimestamp(java.util.Date timestamp)
Set the timestamp on the photo this item is about.

Specified by:
setTimestamp in interface PhotoData
Parameters:
timestamp - the timestamp on the photo.

getExifTags

public ExifTags getExifTags()
Description copied from interface: PhotoData
The exif information on the photo. See the documentation for ExifTags for more information on available exif fields.

Specified by:
getExifTags in interface PhotoData
Returns:
the exif:tags ExifTags for the photo.

setExifTags

public void setExifTags(ExifTags tags)
Set the exif tags on the photo this item is about.

Specified by:
setExifTags in interface PhotoData
Parameters:
tags - the exif tags for the photo.

getCommentsEnabled

public java.lang.Boolean getCommentsEnabled()
Description copied from interface: PhotoData
Gets the status of the commenting preference on the photo. If comments are not enabled on the photo no comments may be sent.

Specified by:
getCommentsEnabled in interface PhotoData
Returns:
true if comments are enabled in the photo the item represents.

setCommentsEnabled

public void setCommentsEnabled(java.lang.Boolean commentsEnabled)
Set the whether comments are enabled in the photo this item represents.

Specified by:
setCommentsEnabled in interface PhotoData
Parameters:
commentsEnabled - true if comments are enabled in the photo.

getCommentCount

public java.lang.Integer getCommentCount()
                                  throws ParseException
Description copied from interface: PhotoData
The number of comments on this photo.

Specified by:
getCommentCount in interface PhotoData
Returns:
the comment count on the photo this item represents.
Throws:
ParseException

setCommentCount

public void setCommentCount(java.lang.Integer commentCount)
Set the number of comments on the photo this item represents.

Specified by:
setCommentCount in interface PhotoData
Parameters:
commentCount - the number of comments on the photo.

getStreamIds

public java.util.List<java.lang.String> getStreamIds()
Get a list of stream ids on this element.

Specified by:
getStreamIds in interface PhotoData
Returns:
a list of streamIds associated with this photo.

addStreamId

public void addStreamId(java.lang.String streamId)
Add the streamId to the list of stream ids.

Specified by:
addStreamId in interface PhotoData

setGeoLocation

public void setGeoLocation(java.lang.Double lat,
                           java.lang.Double lon)
Description copied from interface: PointData
Sets the geo-location of the entity based on the lat and long coordinates passed in. This will create a new Point object if none exists, otherwise it will copy the new coordinates into the existing object.

Specified by:
setGeoLocation in interface PointData
Parameters:
lat - The latitude coordinate, between -90 and 90 degrees.
lon - The longitude coordinate, between -180 and 180 degrees.

setGeoLocation

public void setGeoLocation(Point point)
Description copied from interface: PointData
Sets the geo-location of the entity based on the Point extension. This will use the passed in extension as the geo location if none already exists, otherwise it will copy the given point's data into the existing point object.

Specified by:
setGeoLocation in interface PointData
Parameters:
point - A point containing the latitude and longitude coordinates.

getGeoLocation

public Point getGeoLocation()
Description copied from interface: PointData
Gets the geo-location of the entity.

Specified by:
getGeoLocation in interface PointData
Returns:
a Point that contains the geo-coordinates (latitude and longitude).

getGeoBoundingBox

public Box getGeoBoundingBox()
Description copied from interface: BoxData
Gets the bounding box of this entity.

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

setGeoBoundingBox

public void setGeoBoundingBox(Point lowerLeft,
                              Point upperRight)
Description copied from interface: BoxData
Sets the bounding box based on two Point objects. If there is an existing Box on this object, the new points will be copied into the existing box rather than creating a new box.

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 boundingBox)
Description copied from interface: BoxData
Sets the bounding box for this entity based on a Box extension. If there is an existing Box on this object, the new box will have its points copied into the existing box rather than using the passed-in box.

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

clearPoint

public void clearPoint()
Description copied from interface: PointData
Clears the point data and removes the extension point.

Specified by:
clearPoint in interface PointData

clearGeoBoundingBox

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

Specified by:
clearGeoBoundingBox in interface BoxData

getMediaGroup

public MediaGroup getMediaGroup()
Description copied from interface: MediaData
Retrieve the media:group element on this element. This will return null if there was no media:group element set.

Specified by:
getMediaGroup in interface MediaData
Returns:
the media:group element on the element.

getMediaContents

public java.util.List<MediaContent> getMediaContents()
Description copied from interface: MediaData
Retrieve the list of media:content elements inside the media:group on this element. If either the media:group or media:content elements are missing then an empty list will be returned.

Specified by:
getMediaContents in interface MediaData
Returns:
a list of media:content elements found on the element.

getMediaCategories

public java.util.List<MediaCategory> getMediaCategories()
Description copied from interface: MediaData
Retrieve the list of media:category elements inside the media:group on this element. If either the media:group or media:category elements are missing then an empty list will be returned.

Specified by:
getMediaCategories in interface MediaData
Returns:
a list of media:category elements found on the element.

getMediaCredits

public java.util.List<MediaCredit> getMediaCredits()
Description copied from interface: MediaData
Retrieve the list of media:credit elements inside the media:group on this element. If either the media:group or media:credit elements are missing then an empty list will be returned.

Specified by:
getMediaCredits in interface MediaData
Returns:
a list of media:credit elements found on this element.

getMediaThumbnails

public java.util.List<MediaThumbnail> getMediaThumbnails()
Description copied from interface: MediaData
Retrieve the list of media:thumbnail elements inside the media:group on this element. If either the media:group or media:thumbnail elements are missing then an empty list will be returned.

Specified by:
getMediaThumbnails in interface MediaData
Returns:
a list of media:thumbnail elements found on the element.

getMediaKeywords

public MediaKeywords getMediaKeywords()
Description copied from interface: MediaData
Retrieve the list of media:keywords elements inside the media:group on this element. If either the media:group or media:keywords elements are missing then an empty list will be returned.

Specified by:
getMediaKeywords in interface MediaData
Returns:
the media:keywords elements found on the element.

setKeywords

public void setKeywords(MediaKeywords keywords)
Description copied from interface: MediaData
Set the media keywords on this element to the given keywords. Will create the media:group element as needed.

Specified by:
setKeywords in interface MediaData