Java Glossary

Last updated 1998 July 15 by Roedy Green ©1996-1998 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.
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, McKnight, Graphics Dude 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.
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.
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..
reference type
See value type, reference.
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. 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 colums 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 oddometer on screen spinning frantically. Repaint delay allows the oddometer 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 occurences:

  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 visibele, 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 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
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 compatibiliy 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. See CORBA, serialisation, distributed objects. See some examples. See Tengah.
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.
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.
routine
In Java functions that return nothing are called "void methods".
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. Is 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.
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.



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