Java Glossary

Last updated by Roedy Green ©1996-1999 Canadian Mind Products.

Stuck in a frame? Click here to break out.

H

HackSaw
InnovVal System Solutions' library of code for writing TCP/IP applications including: FTP file uploading and downloading, SMTP and POP3 email, HTTP file and header retrieval, USENET postings, file attachments using MIME and UU encoding/decoding and proxy support. $230 US.
handle
To do whatever action is necessary to deal with an event. An event handler decides what kind of event has come in, and calls the corresponding more specific action routine to handle the event. MacIntosh programmers use the term handle to mean a pointer to a pointer. This allows the thing pointed to be moved, and all references are thereby automatically forwarded to the new location. Java pointers (called references) are usually implemented as handles. See reference, event.
handle body
See peer.
hashCode
If you want to file something away for later retrieval, it can be faster if you file it numerically rather than by a long alphabetic key. A hashCode is a way of computing a small digest numeric key from a long String or even an arbitrary clump of bytes. The numeric key itself is meaningless and the hashCode functions for computing them can look a bit insane. However, when you go to look for something, you can do the same digest calculation on the long alphabetic key you are looking for, and no matter how bizarre an algorithm you used, you will calculate the same hashCode, and will be able to look up numerically with it. Of course there is always the likelihood two different Strings will have the same digest hashCode. However, even then, it greatly narrows down the search, hence speeding it up. A Hashtable goes a step further, scrunching down the hashCode even further to an even smaller number that it can use to directly index an array, usually by dividing it by some prime number and taking the remainder.

In JDK 1.0.x and 1.1.x the hashCode function for long Strings worked by sampling every nth character. This pretty well guaranteed you would have many Strings hashing to the same value, thus slowing down Hashtable lookup. In JDK 1.2 the function has been improved to multiply the result so far by 31 then add the next character in sequence. This is a little slower, but is much better at avoiding collisions. See Hashtable.

HashJava
a source code shrouder. See shroud.
Hashtable
For Strings, Hashtables work pretty much as you would expect if you are familiar with hashing. The only catch is remembering to import java.util.Hashtable (with a small t in table). Here is how you use a Hashtable: Some fine points: See primes, hashCode.
Hayes
Hayes was one of the first companies to make modems for the XT/AT. They are now bankrupt. Since there are no official standards on how to make your modem dial a number, hang up, etc. most modem manufacturers copy one of the Hayes models. The phrase "Hayes compatible" is a give-away that the modem is NOT compatible with any particular Hayes model. It means they concocted a hodgepodge of commands from various Hayes models with a dollop of extra features of their own. Hayes modems were high quality, and by definition do not have compatibility problems. The only thing the matter with them was their outrageous price. Hayes patented the +++ method of getting a modem into command state. Let's hope that patent died along with the company. See AT command set.
HeapSort
Williams and Floyd's sorting algorithm that models employees jockeying for position on the corporate ladder. Another analogy is a tennis tournament where winners of low level contests (comparing bigness of key) compete at the next higher level. In Java, HeapSort is faster than QuickSort but slower than RadixSort. HeapSort is unstable in that it sometimes disturbs the order of existing records with equal keys. You can turn it into a stable sort by appending the existing order as a minor key. Free source code is available from Roedy Green at Canadian Mind Products. To learn more about HeapSort's behaviour see Eppstein's paper. HeapSort is particularly fast if the data are already almost sorted. The source code is available both in prettified HTML or download. See Sort, RadixSort, QuickSort.
Heatherington
Hayes patented method of putting a pause before and after the +++ string used to gain a modem's attention. The required pause helps avoid inadvertently attracting the modem's attention when you send files (such as this one) containing the string +++.
HelloWorld
HelloWorld is usually the first Java program a novice writes. To compile it, type:
javac HelloWorld.java
and later run it with:
java HelloWorld
If this does not work, here are some likely problem areas:
  1. The name of the source file must be HelloWorld.java, precisely, and the name of the public class in your source must be HelloWorld, precisely, including case.
  2. You specify the .java extension to compile, but leave the .class extension off to execute. How logical!
  3. You may not specify the fully qualified drive and path: e.g.

  4. java C:\TEMP\HelloWorld
    is not permitted.
  5. As a corollary, make sure the current directory is where the HelloWorld.class file is.
  6. You have to get the case exactly correct. e.g.

  7. java Helloworld
    is not permitted.
  8. make sure your CLASSPATH looks something like this:

    CLASSPATH=.;D:\Jdk1.1.5\lib\classes.zip
    Note the . to include the current directory. See CLASSPATH for more details.
  9. If your HelloWorld is an Applet rather than an application, you need some HTML commands to invoke it. You don't just load it in your browser as if it were a web page. See Applet for more details on composing that HTML.
If you have a more complex program, using a package, the name of the class you put on the java command line would be myPackage.myClass. myClass.class needs to live in a directory called C:\myPackage. The current directory needs to be C:\ for Java to be able to find the class. The full truth is a little more complex, e.g. you can have zip and JAR files too.

See java.exe for a detailed discussion of how Java.exe combines package names, class names and the CLASSPATH to find the classes.

help
text the user can request to help her understand a program. Context sensitive help tries to guess just what questions the user would be asking herself at that particular stage of the program. Java documentation and help tends to be based on HTML files.
Hermit Crab
A variable length record manager for Java, something not so ambitious as SQL, but more efficient.
hexadecimal
or hex for short, base 16 numbers, e.g. 08Cf, made of the digits 0..9 and a..f. This is the number system we would have used had we sixteen fingers instead of ten. You can display in hex using code like this: You can convert a hex String to internal binary like this:

Since the computer uses binary internally, it makes no sense to talk about converting an int from hex to decimal or back, only a String.

In Java you can use hex literals like this

See Literals for more details. The computer chip works internally in binary (base 2 numbers), with numbers made only of the digits 0 and 1, low voltage/high voltage. Binary numbers are somewhat bulky to write out, so they are usually written in base 16, hex. It is very easy to convert hex to binary and visa versa using the following table. For example, the hex number 8cf is 100011001111 in binary. Converting between decimal and hex is more difficult. You must do successive divisions and moduluses by 10 or 16.
DecimalHexBinary
000000
110001
220010
330001
440100
550101
660110
770111
881000
991001
10a1010
11b1011
12c1100
13d1101
14e1110
15f1111
See the Learn To Count Applet to sharpen your intuition on how binary, hex and octal work. See binary, octal, literal.
hide
make temporarily invisible. "hide" is deprecated. With JDK 1.1 you are supposed to use setVisible(false); instead. hide is also used to describe what one window does to another when it is painted over top of it. See setVisible, show.
hit counters
One of the most commonly requested Applets is one that will display the number of visitors to a page like this: Unfortunately, it is not possible to write such a program in Java without the co-operation of a server somewhere to centrally record the current value of the counter.

Happily there are people who will provide you with free hit counters and free use of their server, usually in exchange for some advertising on the counter. One of the least objectionable is:

makers of the excellent software I use dozens of times a day to comb these web pages for HTML errors.

You can get a commercial, advertising-free hit counter, including use of the counting server, for about $35 to $600 a year, depending on number of hits. Try the WebCounter people.

Commercial hit counters generally give faster response than free ones. Before you sign up see if you can find some of that vendor's hit counters on other people's sites and see how responsive they are. A sluggish hit counter can be very annoying to your visitors.

Some hit counters let you substitute your own set of ten gifs for the digits 0 to 9 to create the counter. With search engines, you can find hundreds of sets of free gifs to use.

Clever hit counter software is not fooled by the same person visiting the same page several times in succession.

There is not much point combing the web for hit counter software to run on your server. Most ISPs won't let you run it. They may have some software they have tested they will let you run, usually for a fee. The hit counters on my pages are handled by Novell's SSI and are sent as ASCII text. Every ISP will have his own preferred way of doing them, usually with CGI.

In theory, you could create a Java Applet to display a hit counter. The central site could send the value of the count over in compact binary. However, this would be slower than using CGI since tche browser would need to download the Java Applet containing contain code and a complete set of GIFs for all the digits. Further the browser user would need to load the Java interpreter. This would take considerably more time than just sending the count or the gifs needed to display the current count. The other problem is the count would not work for people who did not have Java installed or if their Java did not work, or if the Java Plug-In 1.2 had sabotaged the 1.1 version. If there were some way of caching Applets, this technique could be very fast. Perhaps we will see them in future, using smoooth animations or other gimickry. See CGI, SSI.

hide
HomeSite
an HTML authoring tool for Windows-95 and NT bought out by Allaire. See Cold Fusion.
Hook
In the old days, the telephone mouthpiece rested on hook-shaped cradle when it was not in use. To use the phone, you lifted the mouthpiece "off-hook" which gave you a dial tone. To stop using the phone, you placed it back "on-hook". We still use these terms for the electrical modem equivalents.
HoseMocha
uses a simple trick to confuse the Mocha reverse engineering tool by inserting an unreachable bogus opcode. See shroud.
Hot Java
a web browser from Sun, written in Java, that competes with Netscape. Its main advantage is that it is the first out to support new features of Java.
HotSpot
Sun's JIT coming real soon now. Code runs first in interpreted mode and is then analyzed and compiled optimized to target platform. It aggressively inlines frequently used methods, then uses traditional optimisation techniques on the larger code chunks. The HotSpot compiler builds heavily on work done in a broken_linkPhD thesis by Henry Massalin. The thesis is the mother of all self-modifying code. You not only optimise, you continuously re-optimise. See JIT, optimiser.
HSB
Hue Saturation Brightness. Java's alternative to RGB (Red Green Blue) for specifying colour. Java defines HSB as three floating point numbers between 0. and 1. Note that Java's definition does not match Paint Shop Pro's definition, even if you scale HSB to 0..255. Roughly hue represents the position on the rainbow or colour wheel, only loosely related to the frequency or wavelength of the simulated colour.
hue spectrum
frequency spectrum
Saturation is how white the colour is, how broad the spectrum. Brightness is how much light shines out of that colour, the amplitude of the light waves. See the Netscape Colour chart of the Netscape/X11 133 standard colours in HSB form. You can view it sorted by hue, saturation, brightness, alphabetically or hue, brightness, saturation. You can generate an RGB-HSB equivalence table with the little application below.


// ColorspaceTest.class
// Demonstrates correspondence between RGB and HSB
import java.awt.Color.*;
public class ColorspaceTest

// end class Color spaceTest
You can play with Rich Franzen's colourwheel Applet to sharpen your HSB intuition. See wavelength, RGB, CYMK.
HST
Before the invention of the CCITT V.32 modem standards for 9600 BPS modems, US Robotics invented a proprietary protocol that runs even faster at 14,400 BPS. It became popular on US bulletin board system, but never caught on outside the USA. It is gradually being replaced by V.32
HTML
HyperText Markup Language. A platform independent technique of distributing formatted documents via the web. The bold, italic etc. in the document you are reading now (presumably on a web browser), is encoded by embedding tags like <B> and <I>. This markup scheme works on any brand of computer and allows web sites to send all information in a standard way, without having to worry about what brand of computer the recipient has, or what software she uses. I have composed an ASCII format cheat sheet to help you compose HTML. It shows you how to create all the special characters like:
< > & " ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ ÷ ×
and all the accented characters like:
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß
à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ.
The Quoter Amanuensis will automatically convert HTML's reserved characters to their &amp &eacute; &copy; etc. form.

Unfortunately there is no symbol to get you a trademark TM. The &eacute; style abbreviations are not kosher in HTML3.2. They are not part of the HTML 3.2 spec, but Netscape and Internet Explorer still support them. See the list of special characters and the bare bones html guide. There is the classic A Beginner's Guide to HTML, and then move to the following tutorial for FORMS.
You can see how well your browser supports various fonts by examining this list:
Arial Courier New Impact Scribble
Arial Black Courier-Bold Monaco Symbol (Symbol)
AvantGarde-Book Courier-BoldOblique MS Sans Serif Tahoma
AvantGarde-BookOblique Courier-Oblique MS Serif Terminal
AvantGarde-Demi Garamond NewCenturySchlbk-Bold Times
AvantGarde-DemiOblique Geneva NewCenturySchlbk-BoldItalic Times New Roman
Bookman-Demi Helvetica NewCenturySchlbk-Italic Times-Bold
Bookman-DemiItalic Helvetica-Bold NewCenturySchlbk-Roman Times-BoldItalic
Bookman-Light Helvetica-BoldOblique New York Times-Italic
Bookman-LightItalic Helvetica-Narrow Palatino Times-Roman
Britannic Bold Helvetica-Narrow-Bold Palatino-Bold Verdana
Comic Sans MS Helvetica-Narrow-BoldOblique Palatino-BoldItalic Webdings (Webdings)
Comic Sans MS Bold Helvetica-Narrow-Oblique Palatino-Italic ZapfChancery-MediumItalic
Courier Helvetica-Oblique Palatino-Roman ZapfDingbats (ZapfDingbats)
When it comes to HTML4, and CSS style sheets, browser support is shaky. You have to stick to a subset of features that are commonly supported.

The W3 Consortium offers an W3C_logoonline validator for the various HTML dialects. It is sort of a Lint for HTML. It can ensure your HTML will work properly on browsers other than the one you tested it on. The W3C consortium also controls the various HTML standards.

For speed, and control, I use HTML Checked!CSE HTMLValidator 3.03 to check my web pages offline.

If you writing Java source code for an Applet, you can persuade the browser you are running under to display an HTML page with:
java.net.URL url = new java.net.URL(<fileName>);
getAppletContext().showDocument(url);

Unfortunately that does not allow you to take a hunk of HTML you have in a String, perhaps as the result of a POST, and display it. In that case you somehow have to persuade your server to put that html in a file where you can find it via URL. Alternatively you could use Sun's not-free HTML rendering classes.

If you are writing an application you are SOL. For applications, there is no standard HTML rendering class, though BISS-AWT has some primitive HTML rendering code. Andrew Moulden offshore@netcomuk.co.uk has also written Calpane an HTML rendering class, based on Swing.

See DTD, css, SSI, Koala, WebTwin, W3C.

HTTP
Hypertext Transer Protocol. A protocol used on the Internet by web browsers to transport text and graphics. It is focusses on grabbing a page at a time, rather setting up a session.
HTTPS
Hypertext Transer Protocol Secure. Used for encrypted communication between browsers and servers. All transmission of HTTP data are made with the SSL protocol. See HTTP, SSL.
HyperProf
a profile viewer and class browser that uses a hyperbolic plane to place the class tree.
Hz
Hertz, cycles per second. Modems sing to each other, so sometimes you will see references to the frequencies of the tones they sing.



CMP_home HTML Checked! award
CMP_home Canadian Mind Products You can get an updated copy of this page from http://mindprod.com/jglossh.html The Mining Company's
Focus on Java
Best of the Net Award