File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes HashTable or FileReaders (writing own javaEditor) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "HashTable or FileReaders (writing own javaEditor)" Watch "HashTable or FileReaders (writing own javaEditor)" New topic
Author

HashTable or FileReaders (writing own javaEditor)

vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129

Hi Everyone!
I am wrinting my own java editor using java.
which can recognize keywords and basic classes and give them apropriate Color while typing.
I am using HashTable for storing keyword,classes and there relevent Color values.more then 150 listing in singel HashTable and speed is too slow.
instead of using HashTable now i want to use FileReaders i want to put keywords and class names in different files. will it increase the speed of recognizing the keywords. if not then pls suggest me some proper way of doing all this.
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
I wrote a tutorial on how to write a text editor with syntax highlighting:
http://ostermiller.org/syntax/editor.html
vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129
Thanx Steve ,
I got read your tutorial but unable to download.
because proxy is giving error.
just tell meone thing will ur editor color word at the time of tying or after saving.
i want to use FileReader instead of HashTable suggest me.
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
The tutorial outlines proceedures that need to be followed to color text dynamically (and quickly) as the user types.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by vishwas bhatt:

I am using HashTable for storing keyword,classes and there relevent Color values.more then 150 listing in singel HashTable and speed is too slow.

Are you really sure it is the *HashTable* that is to slow? Did you profile your program?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I'm with Ilja. HashTables are pretty darn fast usually, and 150 entries is not a large number. There are many other things that could be wrong here.


"I'm not back." - Bill Harding, Twister
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HashTable or FileReaders (writing own javaEditor)
 
Similar Threads
Syntax highlighting in JTextPane
HashTables
null is java keywork or not?.
Best way for reding files on network
Performance: XML Layout vs api views