public class PortfolioData extends ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
AbstractExtension.AttributesHandler
xmlBlob
localName, namespace
Constructor and Description |
---|
PortfolioData()
Default mutable constructor.
|
PortfolioData(java.lang.String currencyCode,
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)
Immutable constructor.
|
Modifier and Type | Method and Description |
---|---|
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 portfolio in the portfolio default currency.
|
java.lang.String |
getCurrencyCode()
Returns the ISO4217 currency code.
|
DaysGain |
getDaysGain()
Returns the today's gain for the portfolio in the portfolio default
currency.
|
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 portfolio in the portfolio default currency.
|
java.lang.Double |
getGainPercentage()
Returns the percentage gain.
|
MarketValue |
getMarketValue()
Returns the market value of the portfolio in the portfolio default
currency.
|
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).
|
boolean |
hasCostBasis()
Returns whether it has the cost basis of the portfolio in the portfolio
default currency.
|
boolean |
hasCurrencyCode()
Returns whether it has the ISO4217 currency code.
|
boolean |
hasDaysGain()
Returns whether it has the today's gain for the portfolio in the portfolio
default currency.
|
boolean |
hasGain()
Returns whether it has the gain for the portfolio in the portfolio default
currency.
|
boolean |
hasGainPercentage()
Returns whether it has the percentage gain.
|
boolean |
hasMarketValue()
Returns whether it has the market value of the portfolio in the portfolio
default currency.
|
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).
|
protected void |
putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
|
void |
setCostBasis(CostBasis costBasis)
Sets the cost basis of the portfolio in the portfolio default currency.
|
void |
setCurrencyCode(java.lang.String currencyCode)
Sets the ISO4217 currency code.
|
void |
setDaysGain(DaysGain daysGain)
Sets the today's gain for the portfolio in the portfolio default currency.
|
void |
setGain(Gain gain)
Sets the gain for the portfolio in the portfolio default currency.
|
void |
setGainPercentage(java.lang.Double gainPercentage)
Sets the percentage gain.
|
void |
setMarketValue(MarketValue marketValue)
Sets the market value of the portfolio in the portfolio default currency.
|
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).
|
java.lang.String |
toString() |
protected void |
validate()
Checks the attributes to see if there are any problems.
|
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
disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable
public PortfolioData()
public PortfolioData(java.lang.String currencyCode, 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)
currencyCode
- ISO4217 currency code.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).public void declareExtensions(ExtensionProfile extProfile)
ExtensionPoint
declareExtensions
in class ExtensionPoint
extProfile
- the ExtensionProfile to initialize.public CostBasis getCostBasis()
public void setCostBasis(CostBasis costBasis)
costBasis
- cost basis of the portfolio in the portfolio default
currency or null
to resetpublic boolean hasCostBasis()
public java.lang.String getCurrencyCode()
public void setCurrencyCode(java.lang.String currencyCode)
currencyCode
- ISO4217 currency code or null
to resetpublic boolean hasCurrencyCode()
public DaysGain getDaysGain()
public void setDaysGain(DaysGain daysGain)
daysGain
- today's gain for the portfolio in the portfolio default
currency or null
to resetpublic boolean hasDaysGain()
public Gain getGain()
public void setGain(Gain gain)
gain
- gain for the portfolio in the portfolio default currency or
null
to resetpublic boolean hasGain()
public java.lang.Double getGainPercentage()
public void setGainPercentage(java.lang.Double gainPercentage)
gainPercentage
- percentage gain or null
to resetpublic boolean hasGainPercentage()
public MarketValue getMarketValue()
public void setMarketValue(MarketValue marketValue)
marketValue
- market value of the portfolio in the portfolio default
currency or null
to resetpublic boolean hasMarketValue()
public java.lang.Double getReturn1w()
public void setReturn1w(java.lang.Double return1w)
return1w
- 1 week return (percentage) or null
to resetpublic boolean hasReturn1w()
public java.lang.Double getReturn1y()
public void setReturn1y(java.lang.Double return1y)
return1y
- 1 year return (percentage) or null
to resetpublic boolean hasReturn1y()
public java.lang.Double getReturn3m()
public void setReturn3m(java.lang.Double return3m)
return3m
- 3 month return (percentage) or null
to resetpublic boolean hasReturn3m()
public java.lang.Double getReturn3y()
public void setReturn3y(java.lang.Double return3y)
return3y
- 3 year return (percentage) or null
to resetpublic boolean hasReturn3y()
public java.lang.Double getReturn4w()
public void setReturn4w(java.lang.Double return4w)
return4w
- 4 week return (percentage) or null
to resetpublic boolean hasReturn4w()
public java.lang.Double getReturn5y()
public void setReturn5y(java.lang.Double return5y)
return5y
- 5 year return (percentage) or null
to resetpublic boolean hasReturn5y()
public java.lang.Double getReturnOverall()
public void setReturnOverall(java.lang.Double returnOverall)
returnOverall
- overall return (percentage) or null
to
resetpublic boolean hasReturnOverall()
public java.lang.Double getReturnYTD()
public void setReturnYTD(java.lang.Double returnYTD)
returnYTD
- Year-to-date return (percentage) or null
to
resetpublic boolean hasReturnYTD()
protected void validate()
AbstractExtension
validate
in class AbstractExtension
public static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
required
- whether it is requiredrepeatable
- whether it is repeatableprotected void putAttributes(AttributeGenerator generator)
AbstractExtension
AbstractExtension.generate(XmlWriter,ExtensionProfile)
. Default implementation
does nothing, though generally this is discouraged unless there really are
no attributes.putAttributes
in class AbstractExtension
generator
- attribute generatorprotected void consumeAttributes(AttributeHelper helper) throws ParseException
AbstractExtension
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.consumeAttributes
in class AbstractExtension
helper
- attribute helperParseException
- any parsing exceptionpublic java.lang.String toString()
toString
in class java.lang.Object