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 PositionInfogetInfo()Gets the standard position information.doublegetQuantity()Gets the net quantity of the security.SecurityIdgetSecurityId()Gets the identifier of the underlying security.default PortfolioItemSummarysummarize()Summarizes the portfolio item.PositionwithInfo(PortfolioItemInfo info)Returns an instance with the specified info.PositionwithQuantity(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:PortfolioItemSummarizes the portfolio item.This provides a summary, including a human readable description.
- Specified by:
summarizein 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:
getInfoin 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:
getSecurityIdin 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:
getQuantityin interfaceSecurityQuantity- Returns:
- the net quantity of the underlying security
-
withInfo
Position withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.- Specified by:
withInfoin 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
-
-