public class

PositionData

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

Class Overview

Data for the position.

Summary

Constants
String GAINPERCENTAGE XML "gainPercentage" attribute name
String RETURN1W XML "return1w" attribute name
String RETURN1Y XML "return1y" attribute name
String RETURN3M XML "return3m" attribute name
String RETURN3Y XML "return3y" attribute name
String RETURN4W XML "return4w" attribute name
String RETURN5Y XML "return5y" attribute name
String RETURNOVERALL XML "returnOverall" attribute name
String RETURNYTD XML "returnYTD" attribute name
String SHARES XML "shares" attribute name
String XML_NAME XML element name
Fields
private Double gainPercentage Percentage gain
private Double return1w 1 week return (percentage)
private Double return1y 1 year return (percentage)
private Double return3m 3 month return (percentage)
private Double return3y 3 year return (percentage)
private Double return4w 4 week return (percentage)
private Double return5y 5 year return (percentage)
private Double returnOverall Overall return (percentage)
private Double returnYTD Year-to-date return (percentage)
private Double shares Number of shares belonging to the position
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
PositionData()
Default mutable constructor.
PositionData(Double gainPercentage, Double return1w, Double return1y, Double return3m, Double return3y, Double return4w, Double return5y, Double returnOverall, Double returnYTD, Double shares)
Immutable constructor.
Public Methods
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).
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).
Double getReturn1w()
Returns the 1 week return (percentage).
Double getReturn1y()
Returns the 1 year return (percentage).
Double getReturn3m()
Returns the 3 month return (percentage).
Double getReturn3y()
Returns the 3 year return (percentage).
Double getReturn4w()
Returns the 4 week return (percentage).
Double getReturn5y()
Returns the 5 year return (percentage).
Double getReturnOverall()
Returns the overall return (percentage).
Double getReturnYTD()
Returns the Year-to-date return (percentage).
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.
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(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(Double return1w)
Sets the 1 week return (percentage).
void setReturn1y(Double return1y)
Sets the 1 year return (percentage).
void setReturn3m(Double return3m)
Sets the 3 month return (percentage).
void setReturn3y(Double return3y)
Sets the 3 year return (percentage).
void setReturn4w(Double return4w)
Sets the 4 week return (percentage).
void setReturn5y(Double return5y)
Sets the 5 year return (percentage).
void setReturnOverall(Double returnOverall)
Sets the overall return (percentage).
void setReturnYTD(Double returnYTD)
Sets the Year-to-date return (percentage).
void setShares(Double shares)
Sets the number of shares belonging to the position.
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String GAINPERCENTAGE

XML "gainPercentage" attribute name

Constant Value: "gainPercentage"

private static final String RETURN1W

XML "return1w" attribute name

Constant Value: "return1w"

private static final String RETURN1Y

XML "return1y" attribute name

Constant Value: "return1y"

private static final String RETURN3M

XML "return3m" attribute name

Constant Value: "return3m"

private static final String RETURN3Y

XML "return3y" attribute name

Constant Value: "return3y"

private static final String RETURN4W

XML "return4w" attribute name

Constant Value: "return4w"

private static final String RETURN5Y

XML "return5y" attribute name

Constant Value: "return5y"

private static final String RETURNOVERALL

XML "returnOverall" attribute name

Constant Value: "returnOverall"

private static final String RETURNYTD

XML "returnYTD" attribute name

Constant Value: "returnYTD"

private static final String SHARES

XML "shares" attribute name

Constant Value: "shares"

static final String XML_NAME

XML element name

Constant Value: "positionData"

Fields

private Double gainPercentage

Percentage gain

private Double return1w

1 week return (percentage)

private Double return1y

1 year return (percentage)

private Double return3m

3 month return (percentage)

private Double return3y

3 year return (percentage)

private Double return4w

4 week return (percentage)

private Double return5y

5 year return (percentage)

private Double returnOverall

Overall return (percentage)

private Double returnYTD

Year-to-date return (percentage)

private Double shares

Number of shares belonging to the position

Public Constructors

public PositionData ()

Default mutable constructor.

public PositionData (Double gainPercentage, Double return1w, Double return1y, Double return3m, Double return3y, Double return4w, Double return5y, Double returnOverall, Double returnYTD, 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.

Public Methods

public void declareExtensions (ExtensionProfile extProfile)

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.

Parameters
extProfile The ExtensionProfile to initialize.

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)

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)

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

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)

public Double getGainPercentage ()

Returns the percentage gain.

Returns
  • percentage gain

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)

public Double getReturn1w ()

Returns the 1 week return (percentage).

Returns
  • 1 week return (percentage)

public Double getReturn1y ()

Returns the 1 year return (percentage).

Returns
  • 1 year return (percentage)

public Double getReturn3m ()

Returns the 3 month return (percentage).

Returns
  • 3 month return (percentage)

public Double getReturn3y ()

Returns the 3 year return (percentage).

Returns
  • 3 year return (percentage)

public Double getReturn4w ()

Returns the 4 week return (percentage).

Returns
  • 4 week return (percentage)

public Double getReturn5y ()

Returns the 5 year return (percentage).

Returns
  • 5 year return (percentage)

public Double getReturnOverall ()

Returns the overall return (percentage).

Returns
  • overall return (percentage)

public Double getReturnYTD ()

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

Returns
  • Year-to-date return (percentage)

public Double getShares ()

Returns the number of shares belonging to the position.

Returns
  • number of shares belonging to the position

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)

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)

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)

public boolean hasGainPercentage ()

Returns whether it has the percentage gain.

Returns
  • whether it has the percentage gain

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)

public boolean hasReturn1w ()

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

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

public boolean hasReturn1y ()

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

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

public boolean hasReturn3m ()

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

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

public boolean hasReturn3y ()

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

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

public boolean hasReturn4w ()

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

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

public boolean hasReturn5y ()

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

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

public boolean hasReturnOverall ()

Returns whether it has the overall return (percentage).

Returns
  • whether it has the overall return (percentage)

public boolean hasReturnYTD ()

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

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

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

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

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

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

public void setGainPercentage (Double gainPercentage)

Sets the percentage gain.

Parameters
gainPercentage Percentage gain or null to reset

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

public void setReturn1w (Double return1w)

Sets the 1 week return (percentage).

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

public void setReturn1y (Double return1y)

Sets the 1 year return (percentage).

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

public void setReturn3m (Double return3m)

Sets the 3 month return (percentage).

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

public void setReturn3y (Double return3y)

Sets the 3 year return (percentage).

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

public void setReturn4w (Double return4w)

Sets the 4 week return (percentage).

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

public void setReturn5y (Double return5y)

Sets the 5 year return (percentage).

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

public void setReturnOverall (Double returnOverall)

Sets the overall return (percentage).

Parameters
returnOverall Overall return (percentage) or null to reset

public void setReturnYTD (Double returnYTD)

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

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

public void setShares (Double shares)

Sets the number of shares belonging to the position.

Parameters
shares Number of shares belonging to the position or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

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

Parameters
generator Attribute generator

protected void validate ()

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.