hi, expert here , i'm new in java , currently doing my assignment which is under software architecture subject . purpose for this assignment is to develop a program which base on better perfomance, saving memory space, faster and so on . this assignment is actually belongs to KWIC (keyword in context)architecture problem I - shared data architecture . as for below class, it one of my program part, this class use to circular the user input text, but i use some sample text to do it first. generally , the first element of text will append to last element of text and then second element will shift to first element and following .
as for result :
ARCHITECTURE WINS TECHNOLOGY WARS HOW WINS TECHNOLOGY WARS HOW ARCHITECTURE TECHNOLOGY WARS HOW ARCHITECTURE WINS WARS HOW ARCHITECTURE WINS TECHNOLOGY
When is this boolean set to True??? Because it skips the while statement. If it's default is false, then just remove it as a boolean. Unless I'm missing a method. I do that sometimes. [ January 16, 2004: Message edited by: Steve Wysocki ] [ January 16, 2004: Message edited by: Steve Wysocki ]
Joined: Jan 08, 2004
boolean "chgStrControl" variable will set true after display the first line of result , it show in last three line of code. besides, chgStrControl variable actually use for decide to take latest appended string for tokenize..
Do you need the synchronization that Vector uses? Would ArrayList be better in this instance?
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Jan 08, 2004
my reason to use vector is because of i can add string to tokenize without using any wasted space , in this program , you see input string "how architecture win technology wars" , but in fact , it actually for testing purpose , this program suppose let user keyin input string rather than predefine, so if user keyin in 10 words to tokenize, i need only need one vector with 10 elements, so it save space rather prefix the size of array .. anyway , is it better i use arraylist ? what is the reason behind ...tq
Marilyn de Queiroz
Joined: Jul 22, 2000
Vector is an old class that uses synchronization. ArrayList does almost the same thing without the synchronization, so it's faster.