public class AvailableSharesTracker
extends java.lang.Object
Constructor and Description |
---|
AvailableSharesTracker(int date,
long shares)
Constructor to provide the original information, normally the buy transaction but could be
a short sale.
|
Modifier and Type | Method and Description |
---|---|
void |
allot(long sharesAllotted)
Remove shares from the available (typically because they have been sold).
|
long |
getAvailableShares() |
int |
getLastDateInt() |
void |
updateDate(CurrencyType secCurr,
int asofDate)
Update the date of this tracker, adjusting the number of available shares for any splits that
happened between
getLastDateInt() and asofDate . |
public AvailableSharesTracker(int date, long shares)
date
- The date to begin tracking the available shares at.shares
- The number of shares to begin tracking with.public void allot(long sharesAllotted)
sharesAllotted
- The number of shares to remove. Can be negative if a buy to cover a
short sale is being processed, but is typically positive.public long getAvailableShares()
getLastDateInt()
.public int getLastDateInt()
public void updateDate(CurrencyType secCurr, int asofDate)
getLastDateInt()
and asofDate
.secCurr
- The currency type to use for the splits check.asofDate
- The date to update to. Note that this should always be greater than or equal
to getLastDateInt()
, do not go backwards in time.