- I/O
- Java has a bewildering array of I/O (input/output) routines. Many you
can cascade together like Lego blocks to create variants. Have a look at
this essay on JDK 1.0.2 candidate methods or this
essay on JDK 1.1 candidate methods for the task at
hand. The JDK 1.1 essay also shows suggested classes to use when upgrading
deprecated JDK 1.0.2 methods.
I have also written an amanuensis
Applet in Java, available with source code, to automatically generate
Java source code for various combinations of file type and data type. You
can just experiment to learn from complete examples, or you can cut and
paste the code into your own applications.
Java works with six types
of file:
- 7 or 8-bit ASCII characters
- UTF 8-bit Unicode compressed character encoding. See binary
format.
- 16-bit Unicode characters
- Java binary format -- platform independent
big-endian binary representations. Have a look
at this essay to see how DataOutputStream
formats each of the primitive data types.
- raw bytes
- persistent objects
Java is missing basic input routines. You have to roll your own with java.util.StringTokenizer,
java.io.StreamTokenizer or readLine to split the input up into strings,
then use various conversion methods to convert to float, int etc.
See conversion, serialisation, binary format, println format, endian,
encoding.
- IAC
- Inter-Applet communication.
- IANA
- The Internet Assigned Numbers Authority (IANA) is the central
coordinator for the assignment of unique parameter values for Internet
protocols. Amongst other values, Content Types, Content Subtypes,
Character Sets, Access Types, and Conversion values for MIME will be
assigned and listed by the IANA. IANA specifies the standard for naming
character sets used by MIME and the encodings Java uses to translate 8-bit
to 16-bit characters. java.io.CharToByteConverter converts Unicode to
other conventions. see encoding.
- ICAP
- Internet Calendar Access Protocol. A
protocol for exchanging information about scheduling meetings and
appointments.
- iconify
- shrink an application down to an icon. It still runs in the
background, usually shutting down some of its displaying logic.
- icons
- Small bit map pictures, in Java, in the form of gif files. Dean S.
Jones has created a public collection you can use in your programs. Java
does not directly support animated gifs.
- iContract
- A preprocessor for Java to allow Eiffel like design by contract
assertions.The expressions are a superset of Java, compatible with a
subset of the latest UML OCL (Object Constraint
Language (OCL). Highlight features include quantifiers (forall,
exists) to specify properties of enumerations, implications, old- and
return-value references in postconditions, as well as the naming of
exception classes to throw.
- IDE
- Integrated Development Environment. A smart editor that lets
you edit, compile and debug all from within the same program.
Most IDEs understand the Java class structure and let you rapidly
find the method declarations or source code. In future IDEs will
offer other services such as global variable renaming,
multilingual source code and application code, and displaying the
same source code in various different formats such as decision
table, standard Java, tuple, postfix JASM or traditional
bytecode. Dave Dyer has written an essaycomparing
the various vendor IDE offerings. Also see the JavaWorld
reviews. See AFC, Biss, Bluette, Bongo, Cafe, Chicory,
Codewarrior, EMACS JDE, FreeBuilder, GRASP, GWT, IFC/JFC (Swing), J++,
JBuilder, JDE, JaWiz, Jakarta, Jato, Java WorkShop, Javelin, Kawa,
Koala, Latte, Metrowerks, Mojo, NetBeans, Parts For Java,
Roaster, SAWT, Simplicity, SubArctic, SuperCede, VIBE,
Xelfi.
- idempotent
- A fancy mathematician's word meaning having no lasting observable
effect on the state of the world, e.g. a database query with no history of
it recorded, and no change to the database.
- IDL
- Interface Definition Language. Generally refers to the OMG/CORBA IDL.
Used to define interfaces to objects. Defines the types of objects
according to the operations that may be performed on them and the
parameters to those operations. Similar to a C++ header file. In the CORBA
context, an IDL compiler generates stubs which can be called by client
code and skeletons for implementing server code. IDL compilers exist to
map the IDL definitions into various languages: C, C++, Smalltalk,
Java.
- iDoc
- A tool for proofreading JavaDoc comments. See JavaDoc.
- IEEE 754
- the internal binary format used for floating point and double
numbers. The format assigns a meaning to every possible combination of
bits. There are also representation for NAN (Not A Number) and plus and
minus infinity.
A double is 8 bytes, 64 bits,
covers a range from
±4.94065645841246544e-324d to ±1.79769313486231570e+308d,
is formed of 3 fields:
1-bit sign
11-bit base 2 exponent
biased+1023
52-bit fraction, lead 1 implied
e.g. 3. =
0x4008000000000000
-3. = 0xC008000000000000
A float is 4
bytes, 32 bits,
covers a range from ±1.40129846432481707e-45 to
±3.40282346638528860e+38,
is formed of 3 fields:
1-bit sign
8-bit base 2 exponent biased+127
23-bit fraction, lead 1 implied
e.g. 3. = 0x404000
-3. = 0xC04000
- IETF protocols
- A set of standard Internet protocols established and maintained by
the Internet Engineering Task Force (IETF).
Better known IETF protocols include FTP, NNTP, and SMTP. See Net
Components.
- IFC
- According to Barry J. Wark, IFC stands for Internet
Foundation Classes. The IFC is an application
framework/class library developed by Netscape as an alternative to Sun's
AWT. Basically, IFC replaces the GUI classes in the standard Java
distribution (the AWT) with classes that are written purely in Java (so
they look the same on any machine) and draw themselves using the AWT
machinery. IFC uses a slightly different event mechanism (some think it's
better, others don't) from AWT. IFC has caught on to a certain extent
because it offers features like drag and drop and a TextView object which
handles rich styling, which the AWT doesn't yet offer. Also, because it is
pure Java, development time for cross platform apps is less. Sun took IFC
and reworked it to make it more general and dubbed it JFC. See JFC, AFC,
Swing.
- IIOP
- Internet Inter-Orb Protocol. Internet
Object Request Broker Protocol. This is a generic scheme to send objects
over TCP/IP links. There are plans to extend it to support the full Java
RMI. See CORBA.
- IIRC
- Internet speak for if I recall
correctly.
- IIS
- Internet Information Server, a Windows NT 4.0 feature.
- ILU
- Inter Language Unification. Xerox Parc's scheme for masking the
difference between languages in applications. Languages in this context
refers to computer programming languages, not human natural
languages.
- Image
- a pre-composed raster picture in the form of a bit map, e.g.
*.gif. *.jpg or a bit image in RAM. Images are often downloaded
over the Internet asynchronously by a separate thread. Dealing
with synchronising that is a major stumbling block for new Java
programmers. See also graphics object. The Image class is
abstract. You can't instantiate an Image with a constructor. Part
of the problem is Image is associated with some very platform
dependent code. Besides the terrifying ways of dealing with
ImageProducers, ImageConsumers and ImageObservers, there are some
simple techniques to create an Image. A simple offscreen drawing
technique works like this:
// use Component.createImage to get you a blank image to draw on.
Image img = createImage(width, height);
Graphics gi = img.getGraphics();
// Now use gi.drawString etc. to draw,
// just as you would in a paint routine.
// That gives you an off-screen bit map of your image.
// To blast the image onto the screen in your paint routine use:
g.drawImage(img, x, y, this);
Another easy way to get an Image is with, surprise,
getImage:
Image jimmy = Toolkit.getDefaultToolkit().getImage( "C:\\myDir\\jimmy.gif" );
There is a variant of getImage that works in Applets and
takes a URL instead of filename.
Unfortunately saving an image to disk in GIF or JPG format
is not so easy. There are no built-in ways to do it. You have to
look for third party image-savers such as Jimi. See Peter van der
Linden's FAQ for some options. You can of course serialise the
Image, but you can't reconstitute it on a different platform
because the format of the pickled Image is platform dependent.
Don't try to send images over RMI either for the same reason. One
way to do it is to use uk.co.demon.windsong.image.ZipImage
in to convert the Image to a device Independent GZipOutputStream,
and the companion uk.co.demon.windsong.image.ImageProducer to
reconstitute it.
See JPEG, GIF, Jimi.
- IMF
- Intel Media Framework. See Intel Media
Framework, Java Edition.
- IMHO
- Netspeak for In My Humble Opinion.
Sometimes has a slightly sarcastic connotation implying the original
poster does not know what she is talking about.
- IMNSHO
- Netspeak for In My Not So Humble
Opinion. A slightly more honest variant of IMHO.
- implement
- when a class provides the methods necessary to define some interface
we say that class implements the interface. Implementing an interface is
closely related to extending a class. A new class can extend at most one
superclass, but it may implement several interfaces.
- import
- Because of the rigid source code naming convention, the Java compiler
can easily find the corresponding source or class files just from the
fully qualified name of a package and class. Unlike C or C++ we do not
need to include headers to help the compiler determine what sorts of
parameters other routines want; it can go look for itself. The import
statement is not like the C++ include. So long as you fully qualify
your reference in the code to class names with myPackage.myClass there is
no need for imports. They just allow shorthand. Even when you do have an
import, you can still fully qualify your references to classes. Let us say
your package is called Roedy.MyPackage and your class is called
MyClass. There are two forms of the import statement:
- import Roedy.MyPackage.MyClass;
- import Roedy.MyPackage.*;
Then you can refer to the class as plain MyClass, static methods as
MyClass.myStaticMethod() and static variables and constants as
MyClass.myStaticValue, without the Roedy.MyPackage qualification. There is
no form of the import that lets you get away with coding your references
without MyClass. e.g. just myStaticMethod() or myStaticValue. The most
common problems with import are:
- failing to get upper/lower case
precisely correct in the import statement package and classnames.
- failing to name each source module as X.java where X is the name of
the public class defined in that source file.
- Your imports must be accessible via the CLASSPATH.
- Mismatch of CLASSPATH and import. The more qualification you specify
in the CLASSPATH, the less you are allowed to specify in the import
statement. You may not specify a directory both in the import and in the
classpath. The import gives the lower levels of qualification the
CLASSPATH the higher. Another way of stating this is your CLASSPATH should
point to the directory just above the one named for your package's highest
level of qualification.
- Failing to import each package branch separately. import
java.awt.*; does not automatically import
java.awt.event.* as well. You must separately import
java.awt.event.*.
See CLASSPATH.
- Inferno
- AT&T/Lucent's new network operating system that hosts Limbo, a
competitor to Java. See Dis, Limbo, Styx, Plan 9.
- InfoBus
- a standard for JavaBean components to exchange binary information,
something like a platform-independent, streamlined DDE.
- inherit
- When a class extends a superclass with additional methods and
instance variables we say the new class inherits the methods and variables
of the superclass. The new class may override some of the superclass's
methods and shadow some of its variables. Not all the inheritance is
visible, but it is present. Be careful, the inheritance rules for
[public/protected/package/private] [static/instance] [method/variable]
[abstract/actual] [class/interface] are all different. See override,
shadow, overload, implement, extend.
- init
- routine that gets run only once at the beginning of an Applet. See
start, main.
- init string
- Before your modem will work, the computer must send it a set of
arcane commands called a "modem initialisation
string". The set of commands is different for every brand
and model of modem, and often for each different modem program as well.
Almost certainly, you will need the help of a maven to figure these out
for you. Happily, modem software usually comes with giant tables of init
strings for hundreds of models of modem. If yours in on the list, you are
in luck and can ignore them. One of the biggest advantages of the
Internet, is once you have figured out to connect to you ISP, you are
connected to the world. You don't need a separate modem init string for
each place you call.
- initialise
- Java automatically initialises all non-local variables with a default
value, i.e. 0 or null, even chars. However Java does NOT automatically
initialise local variables, though it will initialise any arrays or
objects newly created to be stored in local variables. The Java compiler
is clever. If you forget to initialise when it is required, it will tell
you at compile time. You never need to worry about inadvertently accessing
uninitialised variables. Java always protects you from your folly. When
you create an array of objects, Java automatically initialises all the
slots to null, for both singly and doubly dimensioned arrays e.g. String [
] or String [ ] [ ]. It does NOT create a new object for each slot.
- inner
classes
- A new feature of Java 1.1 where nested local classes are allowed to
be defined inside enclosing classes and create possibly anonymous classes
and objects. Dick Baldwin has written an essay explaining
them. You can define an anonymous class, create an anonymous instance of
it, and pass it as a parameter to a some method all in one (albeit very
long) line. They are primarily for use by code generators. If you want to
write really hard to follow code, you can nest inner classes within inner
classes. You can refer to this of the outer class via
MyOuterClass.this. You can refer to the outer class's methods by
myOuterInstanceMethod() or MyOuterClass.this.myOuterInstanceMethod(); See
anonymous classes, callback, delegate object.
- inner join
- See join.
- Inprise
- The makers of JBuilder. Formerly known as Borland, they have renamed
themselves in hopes the public will forget their good reputation with
products like Delphi, C++, Turbo Pascal, Quattro Pro and dBase.
- insets
- top, left, bottom and right margins, specified in that order. The layout manager will ensure
components have some breathing room around them.
- Install Builder
- See Wise, installation.
- Install Maker
- See Wise, installation.
- Install Manager
- See Wise, installation.
- Install Master
- See Wise, installation.
- Install Shield
- A program that lets you produce executables for installing Java apps
for a variety of platforms. See installation.
- InstallAnywhere
- A program that lets you produce executables for installing
Java apps for a variety of platforms. It claims to produce much
smaller distributables that install faster than the Install
Shield competition. Further it will also handle installing a
suitable Java VM. See installation.
- installation
- Installing Java and the JDK can be quite a production. See
HelloWorld and CLASSPATH for the most common problems. Though
Java is multiplatform, the run-time installation makes use of
very platform specific features such as AUTOEXEC.BAT and the PATH
and SET commends. Before Java can become a common application
language, (as opposed to Applet language) we need much simpler,
foolproof installations. See Alphaworks, Castanet, Install
Shield, InstallAnywhere, J'Express, Marimba, SmartJ, Wise.
- instance method
- a subroutine or function designed to work on the current
object. Methods are always part of some class. You can't have
stand-alone methods the way you can in C or C++. An instance
method has access to all the instance variables, other instance
methods, as well as the static class-as-a-whole methods and
variables. See static, class method.
- instance variable
- a variable part of a class. Each instantiated object of this class
will have its own private copy of this variable. See static, class
variable.
- instanceof
- instanceof is a curious beast.
It is an operator, not a function. It has more powers than many give it
credit for, and it lacks some you might expect of it. I summarise with
this table:
Code |
Effect |
dog instanceof Dog |
true |
dalmatian instanceof
Dog |
true |
dog instanceof
Dalmatian |
false |
dalmatian instanceof
ShowDogInterface |
true |
dalmatian instanceof
dog |
syntax error |
! dalmatian instanceof
Dog |
syntax error |
! (dalmatian instanceof
Dog) |
false |
dog instanceOf
Dalmatian |
syntax error |
dalmatian instanceof
"Dog" |
syntax error |
dalmatian instanceof
Class.forName("DogPackage.Dog") |
syntax error |
Just to keep you on your toes, there are related methods
isInstance and isInstanceOf.
- instantiate
- The keyword "new" will allocate some RAM and create a new
object for you and initialise all its fields to zeros/nulls. The code in
the various constructors then initialises the fields. This process of
creating an object is called instantiation. When a method starts
executing, all the local/temporary variables for that entire method (all
embedded blocks too) are allocated slots on the stack. It does not wait
until you actually enter a block. These local variables are not
automatically initialised. Though the process is similar, the allocation
of ram space for local variables is not usually referred to as
instantiation. Methods other than constructors may return a newly minted
object. The creation with new inside such a method is called
instantiation, but you would not normally say that the method as a whole
instantiated an object.
- Intel Media
Framework, Java Edition
- Sometimes known as IMF (Intel Media Framework),
MFJ (Media Framework for Java), or JMF (Java
Media Framework). It is a set of classes to support video
and audio on Windows 95 and NT. The native classes transparently take
advantage of the Intel MMX processor instructions. The free downloadable
software development kit is a whopping 6 MB. You can read the Infoworld story
on its significance or the IBM spin on the story.
See JMF, sound, AU, wav, IMF.
- interface
- An interface is like a class with some restrictions. All its methods
must be abstract instance methods. All its variables must be static final,
i.e. constants. However, interfaces can do something classes cannot. Your
new class can extend only one superclass to inherit methods and variables
from, however it can implement multiple interfaces. An interface enforces
how some of your methods must look to the outside world. It says nothing
about how you implement them. In contrast, a class usually brings with it
some default implementations.
- Intermute
- a program to filter out advertisements and sounds from your web
browsing.
- internal modem
- Internal modems fit inside your computer. There are specific types of
internal modems for each brand of computer. Internal modems are cheaper
than external. They take up no desk space. See external, WinModem.
- interned Strings
- Since Strings are immutable, if two different methods
"accidentally" use the same String, they can share a
copy of the same string. The process of converting duplicated
strings to shared ones is called interning. String.intern() gives
you the address of the canonical master String. You can compare
interned Strings with simple == (which compares pointers) instead
of .equals which compares the characters of the String one by
one. Because Strings are immutable, the intern process is free to
further save space, for example, by not needing separate string
literal for "pot" when it exists as a substring of some
other literal such as "hippopotamus" There there are
two reasons for interning Strings:
- To save space, by removing String literal duplicates.
- To speed up String equality compares.
All String literals present at compile time are automatically
interned. It is only Strings generated on the fly as the program
runs that might not be interned. A nasty side effect of this
behaviour is that a program will work fine for some simple cases,
but fail on complex ones. The problem comes if you used
== to test for String equality where you should have
used .equals. The wrong code will still work much of the
time because most String literals are unique. See the gotchas on
String comparison.
- Internet
- The collection of computers, satellite links, fibre optic
links etc. that connect together a substantial proprortion of the
world's computers in one giant network where any computer can
talk to any other computer. I have an essay in progress on the
future of the Internet.
- InterNIC
- The people who assign IP dotted quad addresses and domain names ending
in .com and .net. They don't handle .gov,
.mil or .ca. Their job is to make sure no two people
have the same domain name or IP. At the InterNIC website, you can check if
a given domain name has already been taken. You can also find out who owns
any given domain. You can also look up a company name, and see what their
corresponding domain name is. The site is very busy because of the
speculation fad buying and selling domain names.
- interpret
- the process of running the JVM universal byte code output of a Java
compiler on a conventional computer using a program (usually written in C
and assembler) that simulates the ideal Java CPU. See JVM, JIT.
- interpreter
- See design patterns.
- intranet
- A network of LANs used within a single company.
- invalidate
- To mark a component or container (and its parents) as needing to be
re-laid out and repainted soon usually because the component (or one of
its children) has resized, become visible or become invisible. 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(). If the value of a component
changes, but not the size or position of where it is displayed on the
screen, there is no need to invalidate, just repaint that component.
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. See repaint, validate,
layout.
- IP
- Internet Protocol. The lowest level protocol of
the Internet upon which everything else is based. It simply sends
packets, with no checks that they arrived and no retransmission.
Built on top of this are the UDP and TCP/IP protocols. Every
machine on the Internet has a unique 32-bit address called its
IP. It is written as a dotted quad e.g. 216.66.157.8, four
numbers 0..255. Sometimes it is written as a giant 32-bit decimal
number e.g. [3520566083] -> [209.215.147.67]. In Java you can
determine the IP of the machine running the Java application or
Applet with:
import java.io.*;
import java.net.*;
// ...
try
{
InetAddress localaddr = InetAddress.getLocalHost();
System.out.println ( "Local IP Address : " + localaddr.getHostAddress());
System.out.println ( "Local hostname : " + localaddr.getHostName());
}
catch ( UnknownHostException e )
{
System.err.println ( "Can't detect localhost : " + e);
}
You can similarly find out the name or IP of an arbitrary website
given either its name or IP with:
InetAddress cmp = InetAddress.getByName("216.66.157.8");
InetAddress sun =
InetAddress.getByName("www.sun.com");
instead of getLocalHost. Obviously you must be online to the
Internet for these calls to work, and you need a functioning DNS
(Domain Name Service lookup) server. I have
heard reports that if either of these conditions are not met,
instead of getting an exception, you just get 0.0.0.0 as the IP
of every website.
Websites have a permanently assigned IP. For dialup, usually you
have a temporarily assigned IP that stays constant until you hang
up. DHCP is a technique of automatically assigning temporary IP
numbers. With the explosive growth of the Internet we are running
out of IP numbers, and will at some point have to go to a
different protocol with more address bits.
For computers not directly attached to the Internet, you don't
need unique IP numbers. You can use these ones reserved for local
use.
IANA-Allocated, Non-Internet Routable, IP
Addresses
Address Class Range |
Network Address Range |
localhost |
127.0.0.1 |
A |
10.0.0.0 .. 10.255.255.255 |
B |
172.16.0.0 .. 172.31.255.255 |
C |
192.168.0.0 .. 192.168.255.255 |
See subnet mask, datagram, DHCP, UDP, TCP/IP, IPv6.
- IPv6
- The successor protocol to IP. The new protocol has addresses
four times bigger 128 bits, 16 bits verses the 32 bits 4 bytes in
the current IP version 4. The new headers, surprisingly, are
smaller than before, and are fixed length to streamline
processing. New features include:
- 128 bit from and 128 bit to address in the header.
- Plug & Play. You can get a universally unique address
from the 48-bit MAC burned into your Ethernet card. This can be
used as the low order 48 bits of your IP address.
- Support for packet priority and "flows".
Flows are services like live audio or video broadcasts that
require special packet handling.
- Jumbograms. You can now have packets bigger than 64K.
- Routing structure in the address.
- Dynamically assigned IPs are standard. Microsoft has a
proprietary DHCP scheme for the current IP protocol.
See DHCP, IP, TCP/IP, datagram, UDP.
- IRC
- Inter Relay Chat. A scheme for real time chat.
Chats are moderated either by a human or by a "bot" a
program that acts as moderator.
- IRQ
- Interrupt Request. A computer has 7 to 15
"shoulders", each attached to a wire running the length
of the computer bus. A device can demand the computer's immediate
attention by sending a pulse down one of these wires. You must assign
COM1: and COM3: to IRQ 4 and COM2: and COM4: to IRQ 3. If you don't the
computer will not know it was your serial port that needed attention. See
IRQ in the Computer Buyer's Guide for more
detailed information.
- ISAPI
- Internet Server API
- ISDN
- Integrated Services Data Network. The
phone company could much more efficiently transport digital traffic if it
used an end-to-end all-digital technique. Even though the long distance
circuits are digital, the local loops are not. If the local loops were
also digital, the data would arrive at the phone exchange in a much more
compact form, which would be cheaper to transport over the long distance
lines. ISDN is way to convert your local phone loop to all digital. You
rent a special modem from the phone company that gives you 64,000 bits per
second. (Typical conventional modems are only 300 to 28,800 BPS) Unlike a
conventional modem, the ISDN version gives you two extra lower-speed
channels. Because of the high capital costs, and because such technology
is obsolete before the ink on the plans is dry, ISDN implementation has
been progressing very slowly.
- ISO10646
- The International Standards Organisation
standard for a 32-bit or 16-bit character code that includes most of the
world's national character encodings. Two byte Unicode covers the first
64K. See Unicode.
- ISO8601:1988
- The International Standards Organisation
standard for dates yyyy-mm-dd, e.g. 1998-12-31.
- ISO8859-1
- The International Standards Organisation
standard for an 8-bit Latin-1 character code.
- ISP
- Internet Service Provider. A company through whom you can attach to
the Internet. You can find out your local ISP's from a map showing the world's ISP
providers.
In future these companies will federate (after the manner of health
clubs) so that you can always access the net via a local call no matter
where you travel. For now, IBM offers such service at a premium rate.
- iterator
- See design patterns.
- ITU-TSS
- International Telecommunications Union -
Telecommunications Standards Sector. This is the new
name for the CCITT.
- ITUT
- International Telecommunications Union -
Telecommunications Standards Sector. This is the alternate acronym
for ITU-TSS the new name for the CCITT.