Java Glossary

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

Stuck in a frame? Click here to break out.

R

RAD
Rapid Application Development. A way of rapidly building applications by manipulating components visually to create code. See IDE, Visual Café Pro, Jato, SuperCede, Vibe, Bluette, Visaj.
radio button
See checkbox.
RadixSort
is a sorting technique that mimics the old card sorters that worked column by column sending punched cards into different bins. I first heard of the idea from the late Tom Meikle who was a novice programmer when he independently discovered it back in 1968 when we implemented it for the venerable LGP-30. He called it "DigitSort". Only many years later after teaching it to scores of people did I learn it was already well known by the name RadixSort. In Java, RadixSort is faster than either QuickSort or HeapSort. It is stable, meaning it preserves existing order of equal keys. It works in linear time, unlike most other sorts. In other words, it does not bog down when you have large numbers of items to sort. The only thing that slows it down are long keys. Sorting time is proportional to key length. The biggest drawback of RadixSort is that you have to write an unconventional compare routine. RadixSort source code download. See Sort, HeapSort, QuickSort, ShellSort.
random numbers
Random numbers look simple, but they are extremely tricky. See the random numbers section of the gotchas essay. See modulus, division.
RAS
Remote Access Service, Microsoft's term for dialing up the Internet. They sound more like IBM every day with their abstract meaningless acronyms.
ray tracing
When you see those glossy computer generated 3D images with lots of shiny reflective surfaces, they were generated mathematically by tracing the path each photon might take bouncing around the scene. See free ray tracing packages from Pov-Ray and Rod Collen. The Pov-Ray (Point Of View Ray) package blew me away. It is hard to believe a package this extensive could possibly be free.
readLine
readLine will return "" for a null line in a file, and a null when you hit EOF. It won't raise an EOFException! It just keeps returning null. The string that readLine returns does not include the terminating \n, \r or \r\n pair.
Real Time
Standard Java is not suitable for real time application, such as aircraft flight control where you need guaranteed response time from accurate real-time garbage collection and deterministic real-time tasking. There are modified JVMs that give you this. See PERQ.
RealAudio
A technique that lets radio stations broadcast digitally to the entire planet using the Internet. You need a sound card and the RealAudio plugin to Netscape to receive the broadcasts. The technology is still primitive. Every listener gets sent his own private copy of the broadcast. The sound breaks up frequently because the Internet cannot deliver the information fast enough. It can also be used to deliver music samples, and spoken recordings.
red-black trees
This is the modern equivalent of IBM's old ISAM Indexed Sequential Access Method or SoftCraft's Btrieve. Red-black trees allow you to both iterate through a collection in the proper sequential order and lookup directly by key. A red-black tree is a binary search tree that uses an extra bit on every node to store the node's "colour", (Colour is just an analogy. It has nothing to do with light.) Red-black trees constrain the way that nodes may be coloured in such a way that the tree remains reasonably balanced. This property is important for insuring a good overall performance -- red-black trees guarantee that the worst case performance for the most common dynamic set operations is O(log N). See STL.
refactoring
The process of splitting out repetitive code to turn it into its own separate method. An automated tool such as a SCID to help you do might work like this:
  1. I have a method which has some code that I would like to pull out into its own method.
  2. I highlight the offending code.
  3. I select Extract Method from a popup menu
  4. The RefactoringBrowser asks me to name the method and automatically creates it and inserts the highlighted code.
  5. In the current method, the highlighted code is replace by an invocation to the newly created method.
reference type
See value type, reference.
references
Safe pointers. You can't do arithmetic on them. They always point to the beginning of objects. It is impossible to create an invalid one. They automatically dereference as appropriate. 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. Java hides the details of how the references work from the programmer. The JVM automatically dereferences one or two levels of pointer indirection as needed. Your program cannot even figure out how references are implemented..
reflection
Reflection is primarily for very generic programs such as database browsers or visual code editors. Reflection allows Java code to discover information about the fields, methods and constructors of loaded classes and to dynamically invoke them.
regex
see regular expressions.
regular expressions
a system of pattern masks to describe strings to search for, sort of a more generalised wildcarding. Daniel Saverse has written a free package. Marc W.F. Meurrens maintains a list of code regular expression processors. See the GNU parser. See OROMatcher.
relation
When an SQL programmer is trying to impress you with his academic qualifications he will refer to a table of rows and columns as a relation.
RelationView
In dbAnywhere, a RelationView is the result set table of an SQL query that can be displayed. See dbAnywhere.
remove
detach a child component from its parent e.g. remove a button from its enclosing dialog box. Does this free any native mode GUI resources used by the child? See also hide, dispose.
repaint
repaint() requests an erase and redraw (update) after a small time delay. This allows time for more changes to the screen before actually redrawing. Without the delay you would end up repainting the screen many times a second, once for every tiny change. Imagine an odometer on screen spinning frantically. Repaint delay allows the odometer to spin without labouriously painting every single value. When you invoke repaint(), it sends a message to the native GUI suggesting that it would be a good idea if sometime in the distant future when it is convenient and things are slack and when the GUI feels in the mood that the painting work should be done. The native GUI enqueues this request, not the Java SystemEventQueue. As windows occlude each other and reveal each other, the native GUI itself decides that certain components, or parts of components also need to be repainted. The native GUI merges all these requests and removes the duplicates. It may reorder them so that background panels are repainted before the overlaying components.

The GUI then repaints some components on it own and indirectly generates ComponentEvent.COMPONENT_RESIZED, PaintEvent.UPDATE and PaintEvent.PAINT events to request the Java side of things handle the painting. These are enqueued into the SystemEventQueue just like ordinary events. These events in turn trigger the update() and paint() methods of the affected component to be called.

What triggers a repaint? There is a chain of occurrences:

  1. invalidate() (marking a container, and its enclosing containers, as needing to be re-laid out.) Sometimes application code directly calls invalidate(). More often invalidate() gets called as a side effect of adding or deleting a component, making a component visible or invisible (The AWT is smart enough not to invalidate if you setVisible(true) when the component is already visible), changing the size or location of a component with setSize(), setLocation() or setBounds(). invalidate() is also called as the first step in processing a COMPONENT_RESIZED event. Invoking invalidate by itself will not schedule a repaint or validate().
  2. validate() (formerly knows as pack). This redoes the layout if necessary deciding on new sizes and locations of all the components in the container. Most often it gets called directly by application programmers, after a frame or other container been composed, but just before the Frame.setVisible(true). validate() is also called as the second step in processing a COMPONENT_RESIZED event. Invoking validate() by itself will not schedule a repaint.
  3. setVisible(true) (formerly known as show). setVisible(true) for containers will typically invoke validate(). For now, it is probably safer not to count on setVisible doing this, and invoke it yourself. Unless the component is already visible, setVisible(true) for components will invalidate() the parent container (and the enclosing containers too). Unless the container is already invisible, setVisible(false) for containers will typically invalidate() the parent container (and the enclosing containers too). Unless the component is already invisible, setVisible(false) for components will invalidate() the parent container (and the enclosing containers too). setVisible also schedules a repaint if necessary.
  4. repaint() does not actually paint. It calls the peer repaint which enqueues a request in some platform-dependent way inside the native GUI for a repaint. repaint() is also called as the third step in processing a COMPONENT_RESIZED event. Calling repaint() directly won't invoke setVisible() or validate().
  5. SystemEventQueue. When the native GUI is good and ready, it indirectly enqueues a PaintEvent.PAINT or PaintEvent.UPDATE event into Java's SystemEventQueue using Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(Event e). The event dispatcher in EventDispatcherThread.run eventually pops events off the SystemEventQueue and dispatches them. The PAINT and UPDATE events are specially handled. For an update event, the component's update() method is invoked, and passed a Graphics state which includes the clip region to be erased/redrawn.
  6. The update() method typically erases the component (the erasure is automatically clipped), or does nothing if the paint method will cover the entire area. Then it typically calls paint.
  7. The paint() method then actually does the drawing, using the Graphics state object passed to it which includes the clip region. The paint routine is usually oblivious of the clip region. It just paints everything, and allows the AWT to prune off the unwanted data. Container.update() and Container.paint() arrange to paint all the contained lightweight components after painting the background of the container. The native GUI handles scheduling or actually repainting of any contained heavyweight components. updateAll and paintAll are responsible for painting all the contained components.
You might expect Label.setText(), as a side effect, to call repaint(), but it does not. The native GUI is smart enough to internally handle the repainting as a side effect of peer.setText(). Anything that just changes the contents of the display, but not its size or location need not invalidate(), just a repaint() since the old layout will do fine. See also event, invalidate, validate, setVisible, update, paint.
reshape
Deprecated method. See setSize, setBounds, setLocation, repaint.
return
There are three general ways to get information computed inside a method back to the caller, and one extra way that only works if caller and callee are in the same class:
  1. You can return one and only one value to the caller (primitive or object) with return. Java allows multiple inputs to a method but only one output. This restriction is very deeply burned into both the design of Java and the JVM. e.g.
      return a+b;
  2. Hide the values you want to return inside objects that were passed as parameters. e.g.
      void myMethod(Thing t)
        {
        t.a = 42;
        return;
        }
      // end myMethod
  3. hide them inside an object (possibly an an array) created inside the caller, and return that object. e.g.
      int[] myMethod()
        {
        // ...
        int[] r = new int[3];
        r[0] = ans0;
        r[1] = ans1;
        r[2] = ans3;
        return r;
        }
      // end myMethod
  4. If caller and callee belong to the same class, there is another technique which must be used with care. Hide the information in instance or static variables that both caller and callee can access. There is a way around this same class restriction, but it would generally be considered poor programming form, so I won't corrupt you with the details.
The one thing a method cannot do is make the caller's parameter variables change value, or point to different objects, the way you can in Pascal or C++. If you change a parameter's value inside a called method, you only change the callee's local copies. See call by value, call by reference.
return type
A method may either return no value (void) or a value e.g. (int). You can't have two functions that are identical other than the return type. Java has no way to figure out for sure in any given situation which one to use.
reverse engineer
See disassemble
RGB
Red Green Blue. The colour-describing scheme most commonly used in Java and HTML. The alternative is HSB (Hue Saturation Brightness). See the Netscape Colour Chart to sharpen your intuition on how the two schemes work. See this geometric colour chart for yet another way to look at the colours.

When you mix paints, the primary colours are red, yellow and blue, but when you mix beams of light, (as on a CRT screen), the primary colours are red, green and blue. The primaries differ because every extra pigment subtracts from the light reflected and every extra beam of light adds to the light projected. The asymmetry is still puzzling. Why is the primary yellow replaced by green, when you switch from pigments to light beams, but red stays invariant?

The rules of how you can simulate non-primary colours (i.e. other frequencies on the visual spectrum) by blending primaries are a function, not of physics, but of biology -- how the human vision receptors work. There is thus no requirement for the scheme to be simple or logical, just functional.

There are four kinds of colour receptor in your eye. One set of cones are most sensitive to light at 420 nm (nanometers) (blue-violet), another set to 434 nm (blue), rods at 498 (green), and another set of cones cones at 564 (yellow-green). (This goes counter to my intution. I suspect an error either in those frequencies or in the colours shown below for those frequencies. It seems intuitively to me my eyes are most sensitive in the yellow-orange region.) Each is sensitive to other colours (frequencies) as well but it drops off around the most sensitive point in roughly a bell shaped curve. Rods are sensitive to low light intensities. They function primarily for night vision.
wavelength spectrum

Colour vision works by your brain comparing the frequency of firing of the various types of receptor. You can thus fool the brain into thinking it is seeing orange, for example, by showing it a beam of red light at the same time as a beam of green light at 2/3 the intensity. That produces a similar aggregate stimulating effect on the receptors that a beam of pure orange 630 nm light would.

There are colours like brown and purple that don't appear on the spectrum. They are made of a mixture of true spectral colours. They too can be simulated with mixtures of red, green and blue light. See the University of Toronto Colour page, the Computer Vision links, HSB, CYMK.

Rhapsody
Apple computer's proposed multitasking, object oriented, operating system for the Power PC-based MacIntoshes, based on NeXT's OpenStep. It will replace the failed Copeland OS, and the current Mac OS. Rhapsody Blue Box is a Mac OS emulator that runs under Rhapsody as a single task. Rhapsody Yellow Box is the part of the OS that runs new applications specially written for Rhapsody. The main problem this new OS faces is attracting application developers. It certainly would be nice to have an object oriented, Java oriented OS that can run on Intel, PowerPC and picoJava chips.
right outer join
See join.
Rippen
Sun's purely visual programming language that generates C code.
RMI
Remote Method Invocation -- a specification for RPC (remote procedure calls). The client can invoke methods on objects remotely residing in the server, possibly passing it objects as parameters and receiving an object as a result. The advantage of this technique is you don't need to create a custom transaction protocol between client and server. The class files are all that's required. The disadvantage is both client and server need access to the latest identical class definitions of the objects, something a traditional transaction processing or CGI environment does not require. In CGI, the code in client and server is independent. All that ties them together are the various messages exchanged. A special program called the Registry runs on the server. It is totally separate EXE from the server JVM containing the objects. The registry allows server objects to register themselves as available to the clients. The other disadvantage of this technique is the bulk of the transmitted serialised objects. Objects contain considerable identifier text, versioning, and of course nested referenced objects. RMI is a Java-only solution. In comparison, CORBA uses a language neutral format. RMI can use IOP as its low level protocol to give it slightly more compatibility with CORBA.
I saw a demo on coding and using RMI at the Java Colorado Software Summit. It was about 30 times simpler than I imagined it would be.
Objects on the server make a call to register themselves as open for business. Objects on the clients make a connection request. Then from then on, the objects on the clients just invoke the methods of the objects on the server as if they were local. All the parameters and results get passed back and forth automagically in serialised form.
I'm not 100% sure of this, but I don't think Microsoft Internet Explorer supports RMI directly. You have to explicitly place the files in an ARCHIVE statement and download the mother every time you run your Applet! ouch!
See some examples. See Tengah, CORBA, serialisation, distributed objects, servlets.
RNI
Microsoft's proprietary Raw Native Interface for writing native classes in C. For cross-platform work, it has been supplanted by the JNI standard. See JNI, JRI.
Roaster
a Java IDE for the Mac.
robots.txt
robots.txt is a file you can place on your website to tell web crawlers (search engines) which pages to index and which to ignore.
rock'n'scroll
A technique for scrolling on a hand held unit by tilting the screen. Other gestures such as waving the display, like a fan, actuate other functions.
Roedy Green
The author of this glossary and prolific poster on BIX.com and the Internet. To see any of my postings just ask Dejanews who keep a permanent record of nearly everything anybody says on the net. You can search for me as roedy@bix.com, roedy@oberon.ark.com or most recently as roedy@mindprod.com. See Canadian Mind Products.
rollback
SQL term for undoing the database changes made during a transaction. See commit.
rotated text
Java does not have official ways of handling rotated text. However, Jim Buzbee's Hershey Fonts handle the problem with platform independent fonts.
router
On Internet, each conversation is a two way exchange of packets. Each packet is labelled with the address number of its sender and receiver. Special purpose computers called "routers" direct the packet on the next leg of its journey. Each packet may take a different route, and may arrive out of order. A PAD (Packet Assembler / Disassembler) puts them back in the correct order. A routine can also be used to link two LANs together. It is smarter than a bridge. It looks at the destination of each message and decides if it necessary to pass it on to the other net.
routine
In Java functions that return nothing are called "void methods".
RPC
Remote Procedure Calls. See RMI.
RS232C
EIA standard that discusses the older 25 pin serial connections between computers and modems. Nearly all modems sold today use the RS-232C interface. There is no policing body. I have never in my life seen any equipment that was fully compliant with the standard. Buyer beware! For more information see the essay on RS232C.
RS422
EIA standard that discusses a newer method of sending signals using two wires per signal instead of one. RS-422 signals can travel further and faster with fewer errors that RS-232C.
RS423
EIA standard that discusses the new lower-voltage method for one-wire signaling between a computer and a modem.
RS449
EIA standard for the new method of attaching computers and modems using a 9 pin and a 37 pin connector. Though this standard has been around since 1977, it still has not caught on generally.
RTFM
Read The F***ing Manual. A rude response to a question that could have been easily answered by reading a manual or FAQ. Sometimes F***ing is rendered Fine.



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