Java Glossary

Last updated 1998 July 22 by Roedy Green ©1996-1998 Canadian Mind Products.
Stuck in a frame? Click here to break out.

P

package
When a source file gets too large, you can split it up, and still have it behave much as if it were one file by declaring all the parts as belonging to the same package. In C++ terminology, all classes in the same package are friends of each other. You just add a line such package cmp.business; at the top of each source *.java file. The more qualification you have specified in your CLASSPATH the less qualification you are allowed to specify in your import statements. There is no redundancy permitted. If you can't understand my handwaving, try reading Sun's. See import, CLASSPATH. See package scope.
package scope
If you have a variable or method in your class that you don't want clients of your class directly accessing, don't give it a public, protected or private declaration. Due to an oversight in the design of Java, you can't explicitly declare the default "package" accessibility. Other members of the package will be able to see it, but classes outside the package that inherit from yours, won't. The protected accessibility attribute offers slightly more visibibily. See public, private, protected.
PackerLayout
A custom layout manager more sophisticated that the standard GridBagLayout manager based on the the TCL layout manager. See Layout.
PackAJar
Konasoft's tools for preparing JAR files. See JAR.
PAD
Packet Assembler/Disassembler. One of its jobs is to reassemble arriving packets in the proper order. It is a small computer owned by the local packet net company (Datapac in Canada). You can access it using your modem with a local phone call. The PAD will then route your call via digital satellite, fibre optic and microwave links almost anywhere on earth. Though static on the line between your computer and the PAD can cause errors, once it reaches the PAD, special error detection and correction methods guarantee your data gets to its final destination with no further errors added. This method is much cheaper than phoning long distance. Packet nets use long distance circuits about 250 times more efficiently than 2400 BPS modems phoning direct. Many modems cannot call directly more than a few hundred miles because of the static and other distortions. Any modem using the packet nets can easily reach the four corners of the earth.
paint
Actually do the drawing of some component. Does not erase the background first. The paint routine is not responsible for painting children, or scheduling their repainting. paints are triggered as the spirit moves the native GUI. It may call paint at any time. It may even call your paint routine several times, to paint a single component, each time with a different clipping region. Container.Paint() calls each contained flyweight component's paint routine in turn. For efficiency, it bypasses the call if the component is definitely outside the clipregion. For heavyweight contained components, the native GUI handles repainting without AWT involvement. Container.update() behaves similarly. See also repaint, update.
panel
to make applet layout easier, you break a frame up into regions and compose each of them separately. Each region is called a panel. Panels don't have any visible bounding lines. See frame, canvas.
parallel port
hardware to which you may attach a parallel printer or centronics interface device. See PortIO.
parameters
parameters are always passed by value not by reference. The called method gets a copy of each primitive and a copy of the pointer to each object. The called method can therefore not change any local variables in the caller. However it can change the contents of objects (which includes strings and arrays) passed to it. Some people may argue that counts as call by reference, however a callee cannot make the callers variables point to different objects, just change the contents of objects. Objects are always accessed by reference, (literally via a reference) even when parameters are not involved. You can kludge call by reference by passing values back to your caller inside an array or by returning a freshly minted object full of values.
parameterised types
See genericity.
parent
parent is not the same thing as a superclass. Roughly speaking parent is the immediately enclosing graphical element. If a button is in a panel and the panel is in an applet we say the panel is the parent of the button and the applet is the parent of the panel. A parent can have many children, but a child can have only one parent. This defines a hierarchy of objects that describe a screen layout.
parentheses
Parentheses, look like this (). Java uses them for surrounding parameter lists. See brackets, braces.
parity
Modems often use a crude error detecting mechanism by adding an extra bit to each character sent, so that the number of ones is always even. If static reverses one of the bits, the result will no longer have an even number of ones in it and the receiving end will know something has gone wrong.
parser
a program that analyses syntax. It might for example look at a piece of Java source code and find all the variable names, method names and operators in order to compile it into JVM byte code, or it might analyse HTML, or your own invented language. The original LEX/YACC/Bison generated C code. There are now variants that generate Java code. JavaSoft has a page on parsers. My personal favourite, based mainly on the accessible documentation is JavaCC. See JavaCUP, JavaCC (formerly Jack), ANTLR (formerly PCCTS), JLEX, BYACC, YACC, PCCTS, Koala, VisualParse++.
PARTS
Park Place's class library of pluggable components for Java. PARTS started life out in Smalltalk.
Parts For Java
This may be the same thing as Park Place's Parts?? A Java IDE environment similar to Smalltalk.
PCCTS
a YACC-like parser-generator, now renamed to ANTLR. Scott Stanchfield has written a tutorial. See ANTLR, parser, YACC.
PCGrasp
A code beautifier. See beautifier.
peer
Associated with each component are three objects -- e.g. the standard AWT button object, a peer mirroring interfacing button object constructed in the style that the native GUI likes, and perhaps also a hidden button object internal to the native GUI. The behavior of the particular component can depend heavily on the peer. The same Java program may behave quite differently on different platforms, following maxim, when in Rome do as the Romans.
Percolator
A Java source code beautifier. It does a quite number of things besides just re-indenting It will break long lines, sort methods and variable definitions and add comments. See beautifier, coding standards.
Personal Java
The full Business Java language with the enterprise communications stripped out of it (no remote RMI). It also has no security breakout. It still contains the AWT GUI. This is the Java you might see in a pocket organiser. See Business Java, Embedded Java, Windows CE.
persistence
Writing Java objects to disk in a way that they can be read back in again later. See serialisation.
PGP
Pretty Good Privacy. A technique for encrypting and digital signatures based on the difficulty of finding the prime factors of very large numbers.
pickle file
The file that contains the persistent state information for a JavaBean object. See JavaBeans
PicoJava
The smallest of the Sun Java silicon chips. You can find a wealth of material on them by using the Sun search engine. See JVM..
picon
a Personal Icon that may be a photo or a logo displayed while people are reading your posts or email. The Galahad Internet browser supports picons. The University of Indiana provides a registry for both personal and institutional picons. You can also assign your own picons to other people to classify in whatever way you want. These sound like a frill, but are a serious tool to help in dealing with information overload.
Pizza
a superset of Java that adds templates, closures and algebraic data types.
Plan 9
AT&T's new distributed operating system. See Inferno.
PLAF
Pluggable Look And Feel. Swing's ability to change the look and feel of a applet or application on the fly. Plafable components automatically change to track the the current look and feel.
Platibus
a version control system.
play
play pre-recorded audio on a sound card. Java does not yet have a standard set of beeps and clicks.
pointer
Java does not have pointers like C or C++. It has something almost as powerful, but many times safer called "references". See References.
PolarDoc
a replacement for Sun's JavaDoc. PolarDoc also documents inner classes.
polymorphism
The generic term for having many forms. You can use the same name for several different things and the compiler automatically figures out which version you wanted. There are several forms of polymorphism supported in Java, shadowing, overriding, and overloading.
POP3
Post Office Protocol version 3. The protocol most commonly used for fetching mail from a server. Some POP3 servers can also be used to send mail. The advantage of POP3 or sending is it will work even if you come in to pick up your mail via a foreign ISP. Further it has better authentication. See SMTP, IMAP, GoodHost, Hacksaw, MassMail, JavaMail.
portability
The main point of Java is that your code should run on any platform without changes, without even recompiling. Portability is a Good Thing TM even if you don't plan to run the program on more that one platform. Why? Portability leaves open the option to upgrade hardware, or to jump ship to some other operating system if your current vendor misbehaves. It makes it easier to upgrade to future versions of the current operating system. It leaves open the option to reuse or sell your software to some other user with different hardware or operating system. It makes it easier to get help. No matter what platform your expert uses, he can still run or debug your code for you. Unfortunately, manufacturers of hardware and operating systems historically have done their darndest to discourage portability. It is to their economic advantage to lock you in to their hardware or OS. We programmers and users need to fight back by avoiding Java tools that lock you in to one platform. Ease of switching platforms encourages vigourous competition between vendors. Peter Linden recommended having a look at this essay on the issue. The flip side of this issue is that Sun has made some major boo-boos which then are forced on the entire industry. These include a Date/Calender set of classes only their mother could love, lack of consistency in the naming of conversion functions and i/o methods, and a serialisation technique that is slow and incapable of handling even a 1000-element list.
PortIO
Java does not officially support serial or parallel ports, however Central Data has created the PortIO interface and an implementation for their EtherLite ® serial/parallel cards. It works with a streams interface. The source code is in the public domain to make it possible to port to other port hardware or platforms. See serial port, parallel port.
post
Posting an event refers to the JDK 1.0 process of giving an event to a parent if the child did not completely handle it or vice versa. The postEvent routine for a component typically immediately calls the component's handleEvent method. If handleEvent returns false, indicating the event is not yet completely handled, postEvent then calls the parent postEvent, percolating it on up. (The percolating may be done by the parent's postEvent, or if it doesn't handle it by the component's postEvent.) If nobody handles it, postEvent posts the event to component's peer. The key fact to understand is that postEvent insists on immediately completely handling the event. It does not requeue it to be done later. In JDK 1.1 "post" refers to putting an event into a queue destined for components. See also dispatch, deliver, handle. In datacommunications, post meants to place at electronic message in a public Internet usegroup newsgroup for all to see.
PowerJ
Sybase's rapid application development (RAD) Java development tool formerly code-named "Starbuck" then "Jato" based on Optima++.
PostScript
A full-blown computer language used by typesetters, printers and screens to draw graphics and text in a resolution-independent way. Java programs will use the Bravo interface to generate PostScript programs that are then interpreted for printer, screen or typesetter. See Bravo, GhostScript.
http://www.sybase.com/products/powerj/
PPP
Point To Point Protocol. The protocol for dialling up an Internet provider. It lets you simultaneously browse remote machines while file transfers go on in the background. It is gradually replacing the older, slower and more complicated to configure SLIP protocol. PPP also lets you send Novell Netware traffic over the line to simulate a LAN.
PPTP
Microsoft's Point To Point Tunnelling Protocol. The protocol for dialling up an Internet provider then out over the Internet then into a Microsoft LAN. It lets you do the same sorts of things you could over a local LAN.
precedence
Java inherits a very complicated operator precedence scheme from C. Operators with lower precedence numbers are done first. The advantage of precedence is it means you need fewer parentheses. The disadvantage is you must memorise this table perfectly to understand what code will do. Once you learn this table you will know if:
x = a | b & c;
means:
x = (a | b) & c;
or
x = a | (b & c);
Precedence Operator Association
1 ++ --
(unary) + - ~ !
(cast)
Right
2 * / % Left
3 + - Left
4 << >> >>> Left
5 < > <= >= Left
6 == != Left
7 & Left
8 ^ Left
9 | Left
10 && Left
11 || Left
12 ? : Right
13 = *= /= += -=
<<= >>= >>>=
&= ^= |=
Right
PreparedStatement
See Statement.
pretty-printer
a program that reformats Java source to standard indentations and prints it. It may also use bold, italics or type faces to highlight sytantic elements. See cbVan.
Primes
A number divisible only by itself and one. Primes are useful in constructing Hashtables. You can download Java source code to perform an Eratosthenes sieve to compute the primes, whether a number is prime, or the next prime above or below a given number.
primitive
Primitive variables include boolean, char, byte, short, int, long, float and double. Strings, arrays and objects are not primitives.
Type Signed? Bits Bytes Lowest Highest
boolean n/a 1 1 false true
char unsigned Unicode 16 2 '\u0000' '\uffff'
byte signed 8 1 -128 +127
short signed 16 2 -32,768 +32,767
int signed 32 4 -2,147,483,648 +2,147,483,647
long signed 64 8 -9,223,372,036,854,775,808 +9,223,372,036,854,775,807
float signed exponent and mantissa 32 4 ±1.40129846432481707e-45 ±3.40282346638528860e+38
double signed exponent and mantissa 64 8 ±4.94065645841246544e-324 ±1.79769313486231570e+308
See literal, binary formats, IEEE 754, unsigned.
Principle Of Least Astonishment
In designing a language or computer program, generally, you should ensure the effect of any command is the one that least astonishes the user. See gotchas.
printing
The Java 1.0 JDK does not support printing. JDK 1.1 does, via java.awt.PrintJob. You print using the same techniques you use for drawing on the screen. It is much like drawing a high-res screen the size of a sheet of paper. Components now have a print method to print themselves which is usually the same as the one to draw them on the screen. To handle text you use Canvases and drawString, or TextFields. To get properly aligned text without borders, consider the KL-Group components or Swing. Applets cannot print, with one exception, signed applets running under IE4 in JDK 1.1. For example to print everything in a frame:

PrintJob pj = getToolkit().getPrintJob(theFrame, jobTitle, null /* properties */);
Graphics pg = pj.getGraphics(); // get Graphics object for the first page.
printAll(pg); // print this component and its subcomponents, at (0,0).
pg.dispose(); // release the first page to the print queue.
pg = pj.getGraphics(); // get graphics object for second page.
pg.drawLine(0,0,100,100); // draw directly onto the graphics object as if it were a canvas.
pg.dispose(); // release the second page to the print queue.
pj.end(); // Finish off the print job, start printing.

In Win95 and NT, the print job properties are ignored. They are system dependent. But here is how Sun implements them:
Properties howPrint = new Properties();
howPrint.put("awt.print.destination","printer");
// could be "printer" or "file", default "printer"
howPrint.put("awt.print.fileName","TEMP/TEMP.PRN");
// file to receive the PostScript or other physical printer commands
howPrint.put("awt.print.numCopies","1");
// default 1
howPrint.put("awt.print.orientation","portrait");
// could be "portrait" or "landscape", default "portrait"
howPrint.put("awt.print.paperSize","letter");
// could be "letter","legal","executive" or "a4". default "letter"
howPrint.put("awt.print.printer","lp")
// name of command/utility that will do the printing
howPrint.put("awt.print.options","");
// options to pass to the print command/utility
PrintJob pj = getToolkit().getPrintJob(theFrame, "Print Test #1", howPrint);
Graphics pg = pj.getGraphics();
printAll(pg);
pg.dispose();
pj.end();
Here is a little PostScript grid.ps program. copy grid.ps lpt1: (where lpt1: is a PostScript printer) to print out a 1/10" by 1/6" grid on transparent film. It will be useful in designing or checking printouts, especially those on pre-printed forms. See Bravo, JDK.
printf
See the java.text.DecimalFormat and java.text.NumberFormat classes in JDK 1.1. Unfortunately, Java 1.0.2 has no equivalent to the C printf or sprintf function for formatting numbers for display. You have to roll your own. One such class is available from San Diego State University called sdsu.FormatString. Acme also has one. Eliote Rusty Harold did one. Gary Cornell and Cay Horstmann's book Core Java includes one. The Lava Rocks tutorials also includes one. See format, println format, NumberFormat.
println format
PrintStream.println and PrintStream.print display binary data as a stream of human- readable characters. The formatting is primitive. To see how it works have a look at this essay. See binary format.
private
If you have a variable or method that you want no one else to use, declare it private. Even programmers that extend your class won't be able to use it. See public, protected, package.
procedure
"procedure" in Pascal is a "static void method" in Javanese. See method.
projection
In SQL, a high fallutin' word for listing the columns you want included in the results of a query, i.e. the list of fields in a SELECT statement. In dbAnywhere, a Projection object is an non-visible object your program can interact to get or set the value of some particular column in an SQL table. For example, if you wanted a dummy object that did not display on the screen, but that gave you program access to the database values in a column, you would use a Projection object that implements the ProjBinder interface. I think you would still need a ProjBinder object to glue it to the RelationView object. dbAnywhere, ProjBinder
ProjLink
In dbAnywhere, a ProjLink is an interface to bind GUI objects to a particular column of the the database. A ProjLink interface provides methods for the GUI object to report data changes to the database (notifySetData), and for the database to report changes to the GUI object (notifyDataChange). For example if you had a dbAware GUI textfield, it would implement the ProjLink interface. There would be a ProjBinder object to glue it to RelationView object. The GUI object needs a setBinding method that creates the link by calling RelationView.bindProj. setBinding is not part of the ProjLink interface. See ListLink, Link, Binder, dbAnywhere
properties
A platform-independent generalisation of the DOS SET environment, or the Windows *.INI files. In Java, even each object could have its own list of properties. It provides for defaults, and a hierarchical structure. Properties also can be used to store other sorts of hierarchical data on disk. You can interrogate the run-time environment with code like this:

String slash = System.getProperty("file.separator");
You can also use all the other methods of the Properties class such as Enumeration System.propertyNames() to view the list of possible property names.
Properties files on disk are similar to the old Windows 3.1 INI files, except they have no [..] sections. They are ASCII text files of keyword=value pairs. Comments begin with #. Lines may be continued by ending them in a trailing \. Lines are terminated by a linefeed, not necessarily a CrLf as is common in Win95. Look at your fonts.properties or serialver.properties file to see an example.
System
PropertyName
Description accessible
in applet?
file.separator File separator (e.g., "/") yes
java.class.path Java classpath no
java.class.version Java class version number yes
java.home Java installation directory no
java.vendor Java vendor-specific string yes
java.vendor.url Java vendor URL yes
java.version Java version number yes
line.separator Line separator yes
os.arch Operating system architecture yes
os.name Operating system name yes
path.separator Path separator (e.g., ":") yes
user.dir User's current working directory no
user.home User home directory no
user.name User account name no
Property has a second meaning. In JavaBeans, components have associated persistent objects. You can modify various fields in those objects to configure them. The accessible fields of a JavaBean are called "properties". They are accessible via public get/set methods. There need not be an actual field, just the get/set methods that simulate one.
See JavaBeans.
proprietary
A pejorative term for an innovative concept that is not quite ready for prime time.
protected
If you have a variable or method in your class that you don't want clients of your class directly accessing, declare it protected. Classes who extend your class will still be able to use it even if they are not part of the same package. The Default package accessibility has slightly more restricted visibility. Consider the following code:
public class A { protected int p };
// presume class B is in a different package from A
class B extends A {
  void myMethod()
    {
    p = 1;    // ok
    A a = new A();
    a.p = 1;  // not ok, p would have to be public for this to work.
    }
  }
See public, private, package.
protocol
Since the phone lines have static, and since phone calls mysteriously disconnect from time to time, and since, in general, modems have no facilities to handle these problems, we need ways to detect and correct errors in software. There are all sorts of schemes of doing this. When two computers get together by modem, you have to decide on which of these methods (protocols) to use. Unfortunately there is no automatic way of handling this. In descending order of my personal preference, here are some of the protocols:
TCP/IP, ZOOMIT, ZMODEM, KERMIT, TELINK, YMODEM, XMODEM, ASCII.
The term can be more general, describing the rigid rules by which any two programs communicate.
prototype
A design pattern useful when the classes to instantiate are specified at run time, e.g. dynamically loaded. The prototype object factory uses exemplar (prototype/example) objects that it simply clones to produce the desired objects. The factory need know nothing of the class structure of the objects it creates. See design pattern.
proxy
A server that stands between your machine and the potentially hostile world of the Internet. Instead of directly asking machines on the Internet to do things for you, you ask the proxy server to ask your behalf. In return for this loss of directness and freedom, the proxy web and ftp servers may cache your pages and data resulting in faster access. If the proxy implements a firewall it also attempts to protect you from the hostile world, and your own stupidity. A proxy makes a group of users behind the firewall look like a single very active user to the outside world. It makes all its requests of the Internet via a single IP. When results come back, it remembers who internally was talking to that external site. Proxy is also one of the design patterns. See design patterns. see design patterns, firewall.
pseudocode
When someone wants to give you just the outline of an algorithm, he may write it out in an ad hoc language that is a cross between English and various computer languages he may know. No computer can compile it. It leaves out too many details.
public
If you have a variable or method you want users of your class to be able to access, you must declare it public. See private, protected, package.
Pure Java
Java written without any custom native classes certified portable by Sun.
Pure Java Developer's Journal
Cobb Group, Ziff-Davis's Java magazine. See Java Developer's Journal.
pure virtual
In C++ a pure virtual function is one defined as having a dummy implementation, the infamously goofball "=0" syntax. This means you can't instantiate any objects of this class because that method is deliberately undefined. You must override it in some subclass with a real definition. The Javanese way of doing this is to declare a method "abstract". See abstract, virtual.
push server
A server than selects information for you and preloads it onto your local machine, and keeps it up to date so that you can begin reading immediately. PointCast is a well known push service. HotBot from hotwire takes another approach. In contrast, with a pull service, the local machine does the selecting logic.
PVCS
Intersolve's pioneering work on a Poly Version Control System. This allows you to track changes to software, to maintain multiple versions, and to undo changes that did not work out. In future, version control systems will work at much finer granularity, allowing programmers to work much more independently without interfering with each other and will make it much easier to mesh the work of different programmers. A job concept similar to the map maker or circuit designer's layer is the key. In future, version control systems will store the deep structure of a program (in Chomsky's sense), rather than some particular textual representation. In other words, they will store source code as a directed graph (nodes and references) in a database and manipulate it as such rather that treating it as text and manipulating it with a text editor as we do now. This will allow you to view the same program is many different representations (e.g. decision table, flow chart, or traditional Java) without disturbing the data stored in the version control database. See jaunt, TLIB.
PVM
PVM (Parallel Virtual Machine) is a software package that permits a heterogeneous collection of Unix computers hooked together by a network to be used as a single large parallel computer. Thus large computational problems can be solved more cost effectively by using the aggregate power and memory of many computers. The software is very portable. The source, which is available free through nettle, has been compiled on everything from laptops to Crays. See JavaPVM and JPVM.



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/jglossp.html