









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about different classes in an investment account management system. The classes include investmentpiechart, stockportfolio, mutualfund, and usergui. The investmentpiechart class creates a pie chart for different types of accounts, such as cash instruments, equity, and bonds. The stockportfolio and mutualfund classes manage stock portfolios and mutual fund accounts, respectively. The usergui class handles user interactions with the system.
Typology: Study notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










Milestone 6 – Class Descriptions Team “Big N Tasty” [Class: QuerySelect] If a SELECT query is run. This class is called from the GUI. It then parses all the necessary information and then returns a collection. --------------methods--------------- [balanceQuery: aString collect: aCollection count: aNumber tempC: aCollection2 user: aUser] – If they run SELECT something WHERE BALANCE, this method is called. [initialize: aCollection] – initializes the query variables before it starts [nameQuery: aString collect: aCollection count: aNumber tempC: aCollection2 user: aUser] - if they run SELECT something WHERE NAME, this method is called. [numberQuery: aString collect: aCollection count: aNumber tempC: aCollection2 user: aUser] - if they run SELECT something WHERE NUMBER, this method is called. [selectAccountQuery] - if they run SELECT ACCOUNT, this method is called. [selectPortfolioQuery] if they run SELECT PORTFOLIO, this method is called. [user] – returns the user [user: aUser] – sets the user. [Class: Query] If a REPORT query is run. This class is called from the GUI. It then parses all the necessary information and then returns a string with the necessary results of the query --------------methods--------------- [user: aUser] – sets the user. [entry: anEntry] – sets most recent entry [initialize] - intializes the instance variables [isAlphaNumeric: aString] - returns 1 if aString is an alphanumeric string of characters and 0 otherwise [parseReport: aQuery] - proceeds with parsing of query String [parseReportException: aQuery] – Parses exception reports [parseReportFull: aQuery] – Parses full reports [parseReportNormal: aQuery] – Parses normal reports [parseSelect: aCollection] – parses a collection of the information passed in [parseSelectPortfolioOrAccount: aType collection: aCollection] – Passes in a collection and the type to parse, whether portfolio or account [queryPane: aPane] – Takes results and places them into morphic GUI [results] – returns results of the query [runQuery] – runs the query
[Class: LineGraph] Creates a Line Graph depending on what method is called. Whether it creates a line graph for history over time or stock over time. --------------methods--------------- [historyMorph] – Creates a line graph for the history over time [historyBarMorph] – Creates a bar graph for the history over time [historyStockMorph] – Creates a line graph for the stock prices over time. [user] – returns the user [user: aUser] – sets the user. [wAccount: aWatchAccount] – sets the watch account variable. [wAccount] – returns the watch account [createPortfolioGraph: aNumber] – Creates a line graph for the accounts in the selected portfolio [Class: InvestmentPieChart] Creates a Pie Chart for the different types of accounts (cash instruments, equity, and bonds). For Equity, you are able to select to see what accounts have stocks in them and so on. --------------methods--------------- [initialize] – Initializes the main pie chart parts. [createBondPieChart] – Creates the Bond chart [createCashInstrumentPieChart] – Creates the Cash instruments chart [createEquityAccountsPieChart] – Creates the equity chart [createMutualFundPieChart] – Creates the mutual fund chart [createPortfolioPieChart] – Creates the portfolio pie chart [createStockPieChart] – Creates the Stock chart [portfolioList: aPortfolioList] – Passes in the portfolio list to create the portfolio pie chart [Class: Account] Handles all the account functions for a User. --------------methods--------------- [addPortfolio: aPortfolio] – adds a portfolio to this specified account [addTransaction: aTransaction] – adds a transaction to this accounts records [balance] – returns the balance for the account [balance: aString] – sets the balance for the account [deletePortfolio: aPortfolio] – Deletes a portfolio from this account [deposit: anAmount] – deposit money into this account [initialize] – initializes the account starting off [name: aString] – sets the name for the account
[initialize] – initializes the cash instrument variables if not entered [netWorth] – returns the netWorth of the account [update: aDate] – updates the account on this date. Recalculates all transactions that has occurred [Class: CommonStock] A stock portfolio contains a special cash account called the trade account. The system reports both the current value of the portfolio and the total amount of dollars invested. --------------methods--------------- [buy: anAmount] – buy this amount of stocks [display] – setting how we want the display to look like [findPortIndex] – finds the index of the portfolio that the bond is in [getStock: aStock] – gets this stock price from the web [initialize] – initializes the common stock variables if not entered [netWorth] – returns the netWorth of the account [sell: anAmount] – sell this amount of the stock [sellAmount: aString] - sell stocks at this price [sellShares: aString] – Store Sales and calculate validity by Shares [shares: aNumber] - sell this amount of shares [stockHistory: aStock] – Returns a collection of the history of the stock passed in. [stockPrice: aPrice] – price of stock [stockPrice] – returns price of stock [tradeAccount: anAccount] – special cash account for trading of stocks [Class: EquityInstrument] These are typically either Mutual Funds or Common Stocks. --------------methods--------------- [initialize] – initializes the equity instrument variables if not entered [netWorth] – returns the netWorth of the account [shares: aNumber] - sell this amount of shares [shares] - returns the amount of shares [stockPrice: aPrice] – price of stock [stockPrice] – returns price of stock [Class: MutualFund] The balance of a mutual fund account represents the number of shares currently held. Annually, mutual funds make capital gains and dividend distributions and are either automatically reinvested or the distribution is taken in cash.
--------------methods--------------- [balance] – returns the balance for the account [balance: aString] – sets the balance for the account [buy: anAmount] – buy this amount of stocks [display] – setting how we want the display to look like [findPortIndex] – finds the index of the portfolio that the bond is in [initialize] – initializes the mutual fund variables if not entered [shares: aNumber] - sell this amount of shares [shares] - returns the amount of shares [sell: anAmount] – sell this amount of shares [Class: TradeAccount] This account receives all dividend distributions paid by a stock. It also receives the proceeds of any stock sales. Stocks may only be purchased from cash in the trade account. If insufficient funds are available in the trade account, money must be transferred from a cash instrument (via withdrawal from the cash instrument and deposit into the trade account.) until there are sufficient funds to buy the desired amount. --------------methods--------------- [balance] – returns the balance for the account [balance: aString] – sets the balance for the account [deposit: anAmount] – deposit this amount of money into the account [display] – setting how we want the display to look like [initialize] – initializes the trade account variables if not entered [netWorth] – returns the netWorth of the account [user] – returns the user [user: aUser] – sets the user. [withdrawal: anAmount] – Withdraw money from an account [Class: WatchAccount] When a stock is updated, watch account is called to see if the buy or sell threshold has been reached. --------------methods--------------- [buy: anAmount] – buy this amount of stocks [buyat: aPrice] – buy at this price [buyat: aPrice amount: anAmount] – buy this amount at this price [display] – setting how we want the display to look like [initialize] – initializes the watch account variables if not entered [getStock: aStock] – gets this stock price from the web [sell: anAmount] – sell this amount of shares [sellat: aPrice] – sell at this price [sellat] – return sell price
[cashInstrumentList] - returns a list of all the casj instruments in the user [cashIntrumentSelected] - returns the currently selected cash instrument [cashIntrumentSelected: select] - changes the currently selected cash instrument, and alerts the GUI there has been a change to the model [initialize] - sets the default values for the class [interest] - sets a new interest rate for the Bond, or leaves it alone if the user presses cancel [manager: manage] - sets the manager for the BondEditor [setCashAccount] - sets the cash Account for this Bond [startGUI] - creates and opens the GUI for the BondEditor [Class: CashInstrumentEditor] A CashInstrumentEditor allows the user to edit a CashInstrument account. It displays information about the account and lets the user withdraw, and deposit from the account, as well as change the interest rate and the compounding period --------------methods--------------- [account: anAccount] - sets the account for this Editor to represent [compound] - changes the compounding period the cash instrument represented by this Editor to the currently selected duration [deposit] - throws up a window requesting an amount to deposit and adds it the balance of the cash instrument, or does nothing if cancel is pressed [initialize] - sets defaulty values for the class [interest] - throws up a window requesting a new interest rate and sets it accordingly [manager: manage] - sets the manager for this Editor [startGUI] - starts the GUI and opens it [termList] - returns a list of interest durations in an OrderedCollection [termSelected] - gets the currently selected term [termSelected: select] - sets the term to what the user selected and alerts the view to the change [withdraw] - throws up a window to request an amount to withdraw and withdraws it accordingly [Class: CommonStockEditor] A CommonStockEditor allows the user to edit a CommonStock account. It displays information about the account and lets the user buy and sell shares, as well as change the stock price (manually or through a web update feature), and create and edit a watch account for the stock --------------methods--------------- [account: anAccount] - sets the account for this Editor to represent [buy] – buy stock
[editWatch] – Edit the watch account [makeWatch] – makes a watch account [manager: manage] – sets the manager [removeWatch] – removes the watch account [sell] – sells stock [startGUI] – starts the GUI [stockPrice] – returns the stock price [updateStock] - updates the Stock value [Class: EditorSqueakenSystemWindow] EditorSqueakenSystemWindow is the subclass of SquekaenSystemWindow that can tell an AccountManager and a TradeAccount when it is closing. Also has a set size of 600@400. --------------methods--------------- [account: anAccount] - sets the account for this Editor to represent [delete] - tells it account manager that it's closing and tries to make it closable. if there are other editing windows open, the call will do nothing [manager: aManager] – sets the manager [openInWorld] – opens squeak in a new window [Class:ErrorWindow] ErrorWindow opens a small window, displays a message, and can be closed either by closing it as you would any other window or by clicking on an 'Ok' button. The easiest way to declare one is by using 'ErrorWindow new message: 'here's my message''. The message: call opens the window --------------methods--------------- [initialize] - initializes the values to defaults [message: aMessage] - sets the text for this error window to aMessage and opens the window [open] - starts an Error message window [Class: ManagerSqueakenSystemWindow] The window type used by both AccountManager and PortfolioManager. Makes sure the User that it models knows how many managers it has open and calls the closing message for whatever manager spawned it. --------------methods---------------
[portfolioSelected: aSelected] - sets selected [removeAccount] - removes the selected account from the selected portfolio [removePortfolio] - remove a portfolio [startGUI] - opens the account manager GUI [user: aUser] - sets the user [Class: Squeaken] Starts our GUI by initializing everything --------------methods--------------- [addUser: aName password: aPassword] – Adds a user and there password [foundCharacters: aString] – verifies the user name and password [foundTag: aTag] – sends a tag to verify validity [initialize] - sets up the default values for the instance variables [loadUser: aName password: aPassword] - Loads an xml file and parses it to create a User with all the data in the file. [open] - starst the UserGUI [Class: SqueakenListWindowMorph] Opens up a small window that displays a list representing an OrderedCollection of Strings that was passed-in. When the user chooses an option from the list and presses 'Select', the SqueakenListWindowMorph will return the number of the option that was selected --------------methods--------------- [accept] – accepts the user [initialize] - sets up the default values for the instance variables [list] – OrderedCollection of Strings that the morph displays [list: aList] – sets the OrderedCollection of Strings that the morph displays [selected: aSelected] – sets the number of the currently selected item in the list [selected] - number of the currently selected item in the list [setQuery: queryString initialAnswer: initialAnswer answerExtent: answerExtent acceptOnCR: acceptBoolean list: aList] – sets the query, passes in a list [request: queryString initialAnswer: defaultAnswer centerAt: aPoint inWorld: aWorld onCancelReturn: returnOnCancel acceptOnCR: acceptBoolean answerExtent: answerExtent list: aList] – Create an instance of me whose question is queryString with the given initial answer. Invoke it centered at the given point, and answer the string the user accepts. If the user cancels, answer returnOnCancel [request: queryString initialAnswer: defaultAnswer centerAt: aPoint inWorld: aWorld onCancelReturn: returnOnCancel acceptOnCR: acceptBoolean list: aList] - Create an instance of me whose question is queryString with the given initial answer.
Invoke it centered at the given point, and answer the string the user accepts. If the user cancels, answer returnOnCancel. [Class: SqueakenSystemWindow] Makes sure that deleting the window doesn't destroy the dependencies of its model so we can have multiple views for the same model --------------methods--------------- [delete] - makes sure that deleting this wondow doesn't destory the dependencies of its model so we can have multiple views for the same model [Class: TradeAccountEditor] --------------methods--------------- [account: anAccount] - sets the account for this Editor to represent [cashInstrumentList] – returns the cash instrument list [cashIntrumentSelected] – returns the cash instrument selected [cashIntrumentSelected: select] – passes in the cash instrument that is selected [deposit] – deposit amount to put in trade account [initialize] - sets up the default values for the instance variables [manager: manage] – sets the manager [startGUI] - opens the account manager GUI [withdraw] – withdraw from account [Class: UserGUI] The GUI that the user will interact with. --------------methods--------------- [addManager] – adds a manager [initialize] - sets default values for instance variables [makeClosable] - makes the main Squeaken frame closable [makeUnclosable] - makes the main Squeaken frame unclosable [managerNumber] - accessor for the number of managers. Used only for debugging [query] - gets the query [query: aQuery] - sets the query [removeManager] – removes a manager [startUGUI] - starts the user gui and sets up some stuff [updateDisplay] – updates the display [user] - gets the user
[rate] – return the rate [show] – show the transaction report [user: aUser account: anAccount amount: anAmount success: aBoolean description:aString rate:aRate] - passes in the account, amount, and whether it is a successful transaction, and a description of the transaction [user: aUser account: anAccount amount: anAmount success: aBoolean description:aString rate:aRate netWorth: worth] – passes in the account, amount, and whether it is a successful transaction, a description of the transaction, rate, and networth [user: aUser account: anAccount timestamp: aTimestamp amount: anAmount success: aBoolean description:aString time: aTime netWorth: worth rate: aRate] - passes in the account, amount, and whether it is a successful transaction, a description of the transaction, rate, timestamp, and networth [Class: TransactionsCommonStock] Transaction Reports for Common Stocks. --------------methods--------------- [initialize] - sets up the default values for the instance variables [show] – show the transaction report [stockPrice:aPrice] – pass in stock price [stockPrice] – return stock price [value: aValue] pass in value of stock [value] – return value of stock [user: aUser account: anAccount amount: anAmount value: aValue success: aBoolean stockPrice:aPrice description:aString netWorth: worth] – passes in user, account, amount, value of stock, success Boolean, stock price, description, and networth [user: aUser account: anAccount timestamp: aTimestamp amount: anAmount success: aBoolean description:aString time: aTime netWorth: worth stockPrice: aStockPrice value: aValue] - passes in user, time stamp, account, amount, value of stock, success Boolean, stock price, description, time, and networth [Class: Portfolio] Handles all portfolio operations --------------methods--------------- [accountList] - returns the list of accounts for this portfolio [accountNames] - returns the list of account names [addAccount:anAccount] - adds an account to this portfolio [addTransaction: aTransaction] - adds a transaction to this portfolio [display] - displays information for this portfolio [getAccount: anIndex] - returns the account at the specified index [historyDateCollection] - returns the historyNetCollection
[historyNetCollection] - returns the historyNetCollection [initialize] - sets default values for the portfolio [name] - gets the name [name:aString] - sets the name [netWorth] - returns the netWorth of all the Accounts in the portfolio [removeAccount: anAccount] - removes the passed-in account from its list [transactionList] - returns the list of transactions for this portfolio [transactions] - returns a String representation of the transactions for this portfolio [transactionsException] - returns a String representation of the successful transactions for this portfolio [transactionsNormal - returns a String representation of the successful transactions for this portfolio [user:aUser] - sets the user [Class: User] The main GUI that handles a user and their operations. --------------methods--------------- [accountList] - returns the accountList [accountNames] - returns the list of account names [accountSelected] - gets the selected menu item [accountSelected: selected] - sets the selected menu item [accountsInSelectedPortfolio] - returns the list of account names in the currently selected portfolio [addAccount: anAccount] - adds an account to the user [addPortfolio:aPortfolio] - adds a portfolio [addTransaction: aTransaction] - adds a transaction to the user [date: aDate] – passes in the date [display] - prints out a string representation of the user for display in the UseGUI [historyDateCollection] - returns the historyDateCollection [historyNetCollection] - returns the historyNetCollection [initialize] - sets up default values for the User [name] - returns the name [name:aString] - sets the name [netWorth] - returns the total of all the netWorths of all the user's accounts [passTime: aNumber] – [password] - Purpose: returns password [password:aString] - sets the password [portfolioGraph] – starts the portfolio graph for all accounts in selected portfolio [portfolioList] - Purpose: returns collection of portfolios [portfolioNames] - returns the list of portfolio names [portfolioSelected] - gets the selected menu item [portfolioSelected: selected] - sets the selected menu item [removeAccount: selected] - removes an Account and all of its references