Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 1.1 Source Code Directory
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes:
"C:\fyicenter\jdk-1.1.8\src".
Here is the list of Java classes of the JDK 1.1 source code:
✍: FYIcenter
⏎ java/rmi/server/UID.java
/* * @(#)UID.java 1.7 01/12/10 * * Copyright 2002 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package java.rmi.server; import java.io.*; /** * Abstraction for creating identifiers that are unique with respect * to the the host on which it is generated. */ public final class UID implements java.io.Serializable { private static final long serialVersionUID = 1086053664494604050L; private int unique; private long time; private short count; /** * In the absence of an actual pid, just do something somewhat * random. */ private static int getHostUniqueNum() { return (new Object()).hashCode(); } private static int hostUnique = getHostUniqueNum(); private static long lastTime = System.currentTimeMillis(); private static short lastCount = Short.MIN_VALUE; private static Object mutex = new Object(); private static long ONE_SECOND = 1000; // in milliseconds /** * Create a pure identifier that is unique with respect to the * host on which it is generated. This UID is unique under the * following conditions: a) the machine takes more than one second * to reboot, and b) the machine's clock is never set backward. * In order to construct a UID that is globally unique, simply * pair a UID with an InetAddress. */ public UID() { synchronized (mutex) { if (lastCount == Short.MAX_VALUE) { boolean done = false; while (!done) { time = System.currentTimeMillis(); if (time < lastTime+ONE_SECOND) { // pause for a second to wait for time to change try { Thread.currentThread().sleep(ONE_SECOND); } catch (java.lang.InterruptedException e) { } // ignore exception continue; } else { lastTime = time; lastCount = Short.MIN_VALUE; done = true; } } } else { time = lastTime; } unique = hostUnique; count = lastCount++; } } /** * Create a "well-known" ID. There are 2^16 -1 such possible * well-known ids. An id generated via this constructor will not * clash with any id generated via the default UID * constructor which will generates a genuinely unique identifier * with respect to this host. */ public UID(short num) { unique = 0; time = 0; count = num; } private UID(int unique, long time, short count) { this.unique = unique; this.time = time; this.count = count; } public int hashCode() { return (int)time + (int)count; } public boolean equals(Object obj) { if ((obj != null) && (obj instanceof UID)) { UID uid = (UID)obj; return (unique == uid.unique && count == uid.count && time == uid.time); } else { return false; } } public String toString() { return Integer.toString(unique,16) + ":" + Long.toString(time,16) + ":" + Integer.toString(count,16); } /** * Write uid to output stream. */ public void write(DataOutput out) throws java.io.IOException { out.writeInt(unique); out.writeLong(time); out.writeShort(count); } /** * Get the uid from the input stream. * @param in the input stream * @exception IOException If uid could not be read * (due to stream failure or malformed uid) */ public static UID read(DataInput in) throws java.io.IOException { int unique = in.readInt(); long time = in.readLong(); short count = in.readShort(); return new UID(unique, time, count); } }
⏎ java/rmi/server/UID.java
Or download all of them as a single archive file:
File name: jdk-1.1.8-src.zip File size: 1574187 bytes Release date: 2018-11-16 Download
⇒ Backup JDK 1.1 Installation Directory
2018-11-17, 175367👍, 0💬
Popular Posts:
JDK 11 java.rmi.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) module. JDK 11 RMI m...
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...
HttpComponents Client Source Code Files are provided in the source package file, httpcomponents-clie...
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...