Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // wordIndex.m
- // Program 2
- //
- // Created by Mark Grandi on 9/13/11.
- // Copyright 2011 __MyCompanyName__. All rights reserved.
- //
- #import "wordIndex.h"
- @implementation wordIndex
- /**
- Init method
- */
- - (id)init {
- self = [super init];
- if (self) {
- // Initialization code here.
- }
- return self;
- }
- /**
- Dealloc override from NSObject
- */
- - (void) dealloc {
- // release instance variables
- [word release];
- [lineNumberArray release];
- // call superclass
- [super dealloc];
- }
- /**
- description override
- @return a string description
- */
- - (NSString*) description {
- NSString *result = [NSString stringWithFormat: @"<wordIndex: word: '%@', count: '%@', lineNumberArray: '%@'", word, count, lineNumberArray];
- return [result autorelease];
- }
- /**
- getter for word
- @return the word instance variable
- */
- - (NSString*) word {
- return word;
- }
- /**
- Setter for word
- @param newWord - the new word
- */
- - (void) setWord:(NSString*) newWord {
- if (word != newWord) {
- [word release];
- word = [newWord copy];
- }
- }
- /*
- getter for count
- @return the count instance variable
- */
- - (int) count {
- return count;
- }
- /*
- setter for count
- @param newCount - the new count
- */
- - (void) setCount: (int) newCount {
- count = newCount;
- }
- /*
- getter for lineNumberArray
- @return the lineNumberArray instance variable
- */
- - (NSMutableArray*) lineNumberArray {
- return lineNumberArray;
- }
- /*
- Setter for lineNumberArray
- @param newArray - the new NSMutableArray
- */
- - (void) setLineNumberArray:(NSMutableArray *)newArray {
- if (lineNumberArray != newArray) {
- [lineNumberArray release];
- lineNumberArray = [newArray copy];
- }
- }
- @end
Add Comment
Please, Sign In to add comment