Package com.opengamma.strata.product
Interface Position
-
- All Superinterfaces:
CalculationTarget
,PortfolioItem
,SecurityQuantity
- All Known Subinterfaces:
EtdPosition
,ResolvableSecurityPosition
,SecuritizedProductPosition<P>
- All Known Implementing Classes:
BillPosition
,BondFutureOptionPosition
,BondFuturePosition
,CapitalIndexedBondPosition
,DsfPosition
,EtdFuturePosition
,EtdOptionPosition
,FixedCouponBondPosition
,GenericSecurityPosition
,IborFutureOptionPosition
,IborFuturePosition
,OvernightFuturePosition
,SecurityPosition
public interface Position extends PortfolioItem, SecurityQuantity
A position in a security.This is used to represent the total quantity of a
Security
. A position is effectively the sum of one or more trades.Implementations of this interface must be immutable beans.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PositionInfo
getInfo()
Gets the standard position information.double
getQuantity()
Gets the net quantity of the security.SecurityId
getSecurityId()
Gets the identifier of the underlying security.default PortfolioItemSummary
summarize()
Summarizes the portfolio item.Position
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.Position
withQuantity(double quantity)
Returns an instance with the specified quantity.-
Methods inherited from interface com.opengamma.strata.product.PortfolioItem
getId
-
-
-
-
Method Detail
-
summarize
default PortfolioItemSummary summarize()
Description copied from interface:PortfolioItem
Summarizes the portfolio item.This provides a summary, including a human readable description.
- Specified by:
summarize
in interfacePortfolioItem
- Returns:
- the summary of the item
-
getInfo
PositionInfo getInfo()
Gets the standard position information.All positions contain this standard set of information. It includes the identifier and an extensible data map.
- Specified by:
getInfo
in interfacePortfolioItem
- Returns:
- the position information
-
getSecurityId
SecurityId getSecurityId()
Gets the identifier of the underlying security.This identifier uniquely identifies the security within the system.
- Specified by:
getSecurityId
in interfaceSecurityQuantity
- Returns:
- the security identifier
-
getQuantity
double getQuantity()
Gets the net quantity of the security.This returns the net quantity of the underlying security. The result is positive if the net position is long and negative if the net position is short.
- Specified by:
getQuantity
in interfaceSecurityQuantity
- Returns:
- the net quantity of the underlying security
-
withInfo
Position withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.- Specified by:
withInfo
in interfacePortfolioItem
- Parameters:
info
- the new info- Returns:
- the instance with the specified info
-
withQuantity
Position withQuantity(double quantity)
Returns an instance with the specified quantity.- Parameters:
quantity
- the new quantity- Returns:
- the instance with the specified quantity
-
-