# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.finance
Class PositionData

    java.lang.Object
      com.google.gdata.data.AbstractExtension
          com.google.gdata.data.ExtensionPoint
              com.google.gdata.data.finance.PositionData

All Implemented Interfaces:
  Extension

    public class PositionData

extends ExtensionPoint

Data for the position.

Nested Class Summary

Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
`ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler`

Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
`AbstractExtension.AttributesHandler`

Field Summary

Fields inherited from class com.google.gdata.data.ExtensionPoint
`xmlBlob`

Fields inherited from class com.google.gdata.data.AbstractExtension
`localName, namespace`

Constructor Summary
`PositionData()` Default mutable constructor.
`PositionData(java.lang.Double gainPercentage, java.lang.Double return1w, java.lang.Double return1y, java.lang.Double return3m, java.lang.Double return3y, java.lang.Double return4w, java.lang.Double return5y, java.lang.Double returnOverall, java.lang.Double returnYTD, java.lang.Double shares)` Immutable constructor.

Method Summary
`protected void` `consumeAttributes(AttributeHelper helper)` Consumes attributes from the attribute helper.
`void` `declareExtensions(ExtensionProfile extProfile)` Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
`CostBasis` `getCostBasis()` Returns the cost basis of the position in the portfolio default currency (and exchange currency if it differs).
`DaysGain` `getDaysGain()` Returns the today's gain for the position in the portfolio default currency (and exchange currency if it differs).
`static ExtensionDescription` `getDefaultDescription(boolean required, boolean repeatable)` Returns the extension description, specifying whether it is required, and whether it is repeatable.
`Gain` `getGain()` Returns the gain for the position in the portfolio default currency (and exchange currency if it differs).
`java.lang.Double` `getGainPercentage()` Returns the percentage gain.
`MarketValue` `getMarketValue()` Returns the market value of the position in the portfolio default currency (and exchange currency if it differs).
`java.lang.Double` `getReturn1w()` Returns the 1 week return (percentage).
`java.lang.Double` `getReturn1y()` Returns the 1 year return (percentage).
`java.lang.Double` `getReturn3m()` Returns the 3 month return (percentage).
`java.lang.Double` `getReturn3y()` Returns the 3 year return (percentage).
`java.lang.Double` `getReturn4w()` Returns the 4 week return (percentage).
`java.lang.Double` `getReturn5y()` Returns the 5 year return (percentage).
`java.lang.Double` `getReturnOverall()` Returns the overall return (percentage).
`java.lang.Double` `getReturnYTD()` Returns the Year-to-date return (percentage).
`java.lang.Double` `getShares()` Returns the number of shares belonging to the position.
`boolean` `hasCostBasis()` Returns whether it has the cost basis of the position in the portfolio default currency (and exchange currency if it differs).
`boolean` `hasDaysGain()` Returns whether it has the today's gain for the position in the portfolio default currency (and exchange currency if it differs).
`boolean` `hasGain()` Returns whether it has the gain for the position in the portfolio default currency (and exchange currency if it differs).
`boolean` `hasGainPercentage()` Returns whether it has the percentage gain.
`boolean` `hasMarketValue()` Returns whether it has the market value of the position in the portfolio default currency (and exchange currency if it differs).
`boolean` `hasReturn1w()` Returns whether it has the 1 week return (percentage).
`boolean` `hasReturn1y()` Returns whether it has the 1 year return (percentage).
`boolean` `hasReturn3m()` Returns whether it has the 3 month return (percentage).
`boolean` `hasReturn3y()` Returns whether it has the 3 year return (percentage).
`boolean` `hasReturn4w()` Returns whether it has the 4 week return (percentage).
`boolean` `hasReturn5y()` Returns whether it has the 5 year return (percentage).
`boolean` `hasReturnOverall()` Returns whether it has the overall return (percentage).
`boolean` `hasReturnYTD()` Returns whether it has the Year-to-date return (percentage).
`boolean` `hasShares()` Returns whether it has the number of shares belonging to the position.
`protected void` `putAttributes(AttributeGenerator generator)` Puts attributes into the attribute generator.
`void` `setCostBasis(CostBasis costBasis)` Sets the cost basis of the position in the portfolio default currency (and exchange currency if it differs).
`void` `setDaysGain(DaysGain daysGain)` Sets the today's gain for the position in the portfolio default currency (and exchange currency if it differs).
`void` `setGain(Gain gain)` Sets the gain for the position in the portfolio default currency (and exchange currency if it differs).
`void` `setGainPercentage(java.lang.Double gainPercentage)` Sets the percentage gain.
`void` `setMarketValue(MarketValue marketValue)` Sets the market value of the position in the portfolio default currency (and exchange currency if it differs).
`void` `setReturn1w(java.lang.Double return1w)` Sets the 1 week return (percentage).
`void` `setReturn1y(java.lang.Double return1y)` Sets the 1 year return (percentage).
`void` `setReturn3m(java.lang.Double return3m)` Sets the 3 month return (percentage).
`void` `setReturn3y(java.lang.Double return3y)` Sets the 3 year return (percentage).
`void` `setReturn4w(java.lang.Double return4w)` Sets the 4 week return (percentage).
`void` `setReturn5y(java.lang.Double return5y)` Sets the 5 year return (percentage).
`void` `setReturnOverall(java.lang.Double returnOverall)` Sets the overall return (percentage).
`void` `setReturnYTD(java.lang.Double returnYTD)` Sets the Year-to-date return (percentage).
`void` `setShares(java.lang.Double shares)` Sets the number of shares belonging to the position.
`java.lang.String` `toString()`
`protected void` `validate()` Checks the attributes to see if there are any problems.

Methods inherited from class com.google.gdata.data.ExtensionPoint

`addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren`

Methods inherited from class com.google.gdata.data.AbstractExtension
`disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PositionData

    public PositionData()

  Default mutable constructor.

### PositionData

    public PositionData(java.lang.Double gainPercentage,
                        java.lang.Double return1w,
                        java.lang.Double return1y,
                        java.lang.Double return3m,
                        java.lang.Double return3y,
                        java.lang.Double return4w,
                        java.lang.Double return5y,
                        java.lang.Double returnOverall,
                        java.lang.Double returnYTD,
                        java.lang.Double shares)

  Immutable constructor.

  Parameters:
    `gainPercentage` - percentage gain.
    `return1w` - 1 week return (percentage).
    `return1y` - 1 year return (percentage).
    `return3m` - 3 month return (percentage).
    `return3y` - 3 year return (percentage).
    `return4w` - 4 week return (percentage).
    `return5y` - 5 year return (percentage).
    `returnOverall` - overall return (percentage).
    `returnYTD` - Year-to-date return (percentage).
    `shares` - number of shares belonging to the position.

Method Detail

### declareExtensions

    public void declareExtensions(ExtensionProfile extProfile)

  Description copied from class: `ExtensionPoint`
  Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.

  Overrides:
    `declareExtensions` in class `ExtensionPoint`
  Parameters:
    `extProfile` - the ExtensionProfile to initialize.

### getCostBasis

    public CostBasis getCostBasis()

  Returns the cost basis of the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    cost basis of the position in the portfolio default currency (and exchange currency if it differs)

### setCostBasis

    public void setCostBasis(CostBasis costBasis)

  Sets the cost basis of the position in the portfolio default currency (and exchange currency if it differs).

  Parameters:
    `costBasis` - cost basis of the position in the portfolio default currency (and exchange currency if it differs) or `null` to reset

### hasCostBasis

    public boolean hasCostBasis()

  Returns whether it has the cost basis of the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    whether it has the cost basis of the position in the portfolio default currency (and exchange currency if it differs)

### getDaysGain

    public DaysGain getDaysGain()

  Returns the today's gain for the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    today's gain for the position in the portfolio default currency (and exchange currency if it differs)

### setDaysGain

    public void setDaysGain(DaysGain daysGain)

  Sets the today's gain for the position in the portfolio default currency (and exchange currency if it differs).

  Parameters:
    `daysGain` - today's gain for the position in the portfolio default currency (and exchange currency if it differs) or `null` to reset

### hasDaysGain

    public boolean hasDaysGain()

  Returns whether it has the today's gain for the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    whether it has the today's gain for the position in the portfolio default currency (and exchange currency if it differs)

### getGain

    public Gain getGain()

  Returns the gain for the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    gain for the position in the portfolio default currency (and exchange currency if it differs)

### setGain

    public void setGain(Gain gain)

  Sets the gain for the position in the portfolio default currency (and exchange currency if it differs).

  Parameters:
    `gain` - gain for the position in the portfolio default currency (and exchange currency if it differs) or `null` to reset

### hasGain

    public boolean hasGain()

  Returns whether it has the gain for the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    whether it has the gain for the position in the portfolio default currency (and exchange currency if it differs)

### getGainPercentage

    public java.lang.Double getGainPercentage()

  Returns the percentage gain.

  Returns:
    percentage gain

### setGainPercentage

    public void setGainPercentage(java.lang.Double gainPercentage)

  Sets the percentage gain.

  Parameters:
    `gainPercentage` - percentage gain or `null` to reset

### hasGainPercentage

    public boolean hasGainPercentage()

  Returns whether it has the percentage gain.

  Returns:
    whether it has the percentage gain

### getMarketValue

    public MarketValue getMarketValue()

  Returns the market value of the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    market value of the position in the portfolio default currency (and exchange currency if it differs)

### setMarketValue

    public void setMarketValue(MarketValue marketValue)

  Sets the market value of the position in the portfolio default currency (and exchange currency if it differs).

  Parameters:
    `marketValue` - market value of the position in the portfolio default currency (and exchange currency if it differs) or `null` to reset

### hasMarketValue

    public boolean hasMarketValue()

  Returns whether it has the market value of the position in the portfolio default currency (and exchange currency if it differs).

  Returns:
    whether it has the market value of the position in the portfolio default currency (and exchange currency if it differs)

### getReturn1w

    public java.lang.Double getReturn1w()

  Returns the 1 week return (percentage).

  Returns:
    1 week return (percentage)

### setReturn1w

    public void setReturn1w(java.lang.Double return1w)

  Sets the 1 week return (percentage).

  Parameters:
    `return1w` - 1 week return (percentage) or `null` to reset

### hasReturn1w

    public boolean hasReturn1w()

  Returns whether it has the 1 week return (percentage).

  Returns:
    whether it has the 1 week return (percentage)

### getReturn1y

    public java.lang.Double getReturn1y()

  Returns the 1 year return (percentage).

  Returns:
    1 year return (percentage)

### setReturn1y

    public void setReturn1y(java.lang.Double return1y)

  Sets the 1 year return (percentage).

  Parameters:
    `return1y` - 1 year return (percentage) or `null` to reset

### hasReturn1y

    public boolean hasReturn1y()

  Returns whether it has the 1 year return (percentage).

  Returns:
    whether it has the 1 year return (percentage)

### getReturn3m

    public java.lang.Double getReturn3m()

  Returns the 3 month return (percentage).

  Returns:
    3 month return (percentage)

### setReturn3m

    public void setReturn3m(java.lang.Double return3m)

  Sets the 3 month return (percentage).

  Parameters:
    `return3m` - 3 month return (percentage) or `null` to reset

### hasReturn3m

    public boolean hasReturn3m()

  Returns whether it has the 3 month return (percentage).

  Returns:
    whether it has the 3 month return (percentage)

### getReturn3y

    public java.lang.Double getReturn3y()

  Returns the 3 year return (percentage).

  Returns:
    3 year return (percentage)

### setReturn3y

    public void setReturn3y(java.lang.Double return3y)

  Sets the 3 year return (percentage).

  Parameters:
    `return3y` - 3 year return (percentage) or `null` to reset

### hasReturn3y

    public boolean hasReturn3y()

  Returns whether it has the 3 year return (percentage).

  Returns:
    whether it has the 3 year return (percentage)

### getReturn4w

    public java.lang.Double getReturn4w()

  Returns the 4 week return (percentage).

  Returns:
    4 week return (percentage)

### setReturn4w

    public void setReturn4w(java.lang.Double return4w)

  Sets the 4 week return (percentage).

  Parameters:
    `return4w` - 4 week return (percentage) or `null` to reset

### hasReturn4w

    public boolean hasReturn4w()

  Returns whether it has the 4 week return (percentage).

  Returns:
    whether it has the 4 week return (percentage)

### getReturn5y

    public java.lang.Double getReturn5y()

  Returns the 5 year return (percentage).

  Returns:
    5 year return (percentage)

### setReturn5y

    public void setReturn5y(java.lang.Double return5y)

  Sets the 5 year return (percentage).

  Parameters:
    `return5y` - 5 year return (percentage) or `null` to reset

### hasReturn5y

    public boolean hasReturn5y()

  Returns whether it has the 5 year return (percentage).

  Returns:
    whether it has the 5 year return (percentage)

### getReturnOverall

    public java.lang.Double getReturnOverall()

  Returns the overall return (percentage).

  Returns:
    overall return (percentage)

### setReturnOverall

    public void setReturnOverall(java.lang.Double returnOverall)

  Sets the overall return (percentage).

  Parameters:
    `returnOverall` - overall return (percentage) or `null` to reset

### hasReturnOverall

    public boolean hasReturnOverall()

  Returns whether it has the overall return (percentage).

  Returns:
    whether it has the overall return (percentage)

### getReturnYTD

    public java.lang.Double getReturnYTD()

  Returns the Year-to-date return (percentage).

  Returns:
    Year-to-date return (percentage)

### setReturnYTD

    public void setReturnYTD(java.lang.Double returnYTD)

  Sets the Year-to-date return (percentage).

  Parameters:
    `returnYTD` - Year-to-date return (percentage) or `null` to reset

### hasReturnYTD

    public boolean hasReturnYTD()

  Returns whether it has the Year-to-date return (percentage).

  Returns:
    whether it has the Year-to-date return (percentage)

### getShares

    public java.lang.Double getShares()

  Returns the number of shares belonging to the position.

  Returns:
    number of shares belonging to the position

### setShares

    public void setShares(java.lang.Double shares)

  Sets the number of shares belonging to the position.

  Parameters:
    `shares` - number of shares belonging to the position or `null` to reset

### hasShares

    public boolean hasShares()

  Returns whether it has the number of shares belonging to the position.

  Returns:
    whether it has the number of shares belonging to the position

### validate

    protected void validate()

  Description copied from class: `AbstractExtension`
  Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.

  Overrides:
    `validate` in class `AbstractExtension`

### getDefaultDescription

    public static ExtensionDescription getDefaultDescription(boolean required,
                                                             boolean repeatable)

  Returns the extension description, specifying whether it is required, and whether it is repeatable.

  Parameters:
    `required` - whether it is required
    `repeatable` - whether it is repeatable
  Returns:
    extension description

### putAttributes

    protected void putAttributes(AttributeGenerator generator)

  Description copied from class: `AbstractExtension`
  Puts attributes into the attribute generator. Called from `AbstractExtension.generate(XmlWriter,ExtensionProfile)`. Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

  Overrides:
    `putAttributes` in class `AbstractExtension`
  Parameters:
    `generator` - attribute generator

### consumeAttributes

    protected void consumeAttributes(AttributeHelper helper)
                              throws ParseException

  Description copied from class: `AbstractExtension`
  Consumes attributes from the attribute helper. May also use `AttributeHelper.consumeContent(boolean)` to consume the element's text content. Called from `AbstractExtension.getHandler(com.google.gdata.data.ExtensionProfile, java.lang.String, java.lang.String, org.xml.sax.Attributes)`. Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

  Overrides:
    `consumeAttributes` in class `AbstractExtension`
  Parameters:
    `helper` - attribute helper
  Throws:
    `ParseException` - any parsing exception

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`