IP Library Granted Patent US 7,543,272
Granted Patent B1
US 7,543,272 · App. 11/165,808 · Granted Jun 2, 2009

Method and apparatus for finding terminal classes in a collection of programming language classes

Assignee: Sun Microsystems, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,543,272
App. No.
11/165,808
Granted
Jun 2, 2009
Kind
B1
Abstract

One embodiment of the present invention provides a system that facilitates finding terminal classes in a collection of programming language classes, wherein a terminal class is a class that is not extended by any other class. The system operates by receiving a collection of classes. The system then adds the classes to a map of the collection of classes, wherein keys to each class in the map include each class' superclass and the interfaces each class directly implements. Next, the system analyzes a given class in the map of the collection of classes to determine if the given class extends any other class in the collection of classes. If so, the system removes this extended class from the collection of classes. Finally, the system repeats the steps of analyzing classes and removing extended classes until all remaining classes in the collection of classes are terminal classes.

Claims (37)

1. A method for finding terminal classes in a collection of programming language classes, wherein a terminal class is a class that is not extended by any other class, the method comprising:

receiving a collection of classes;

adding the classes to a map of the collection of classes, wherein keys to each class in the map include each class' superclass and the interfaces each class directly implements;

finding all terminal classes in the collection of classes with only a single pass through the collection of classes by:

analyzing a given class in the map to determine if the given class extends any other class in the collection of classes;

if the given class extends any other class, removing this extended class from the collection of classes;

repeating the steps of analyzing classes and removing extended classes until all remaining classes in the collection of classes are terminal classes; and

automatically creating a hierarchical representation of the collection of classes.

2. The method of claim 1 , further comprising removing the given class if it does not implement a specified interface.

3. The method of claim 1 , further comprising removing the given class if it is not a driver class.

4. The method of claim 1 , wherein receiving a collection of classes further involves receiving a JAR file.

5. The method of claim 1 , further comprising analyzing the given class by loading the given class with a class loader.

6. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for finding terminal classes in a collection of programming language classes, wherein a terminal class is a class that is not extended by any other class, the method comprising:

receiving a collection of classes;

adding the classes to a map of the collection of classes, wherein keys to each class in the map include the class' superclass and the interfaces each class directly implements;

finding all terminal classes in the collection of classes with only a single pass through the collection of classes by:

analyzing a given class in the map to determine if the given class extends any other class in the collection of classes;

if the given class extends any other class, removing this extended class from the collection of classes;

repeating the steps of analyzing classes and removing extended classes until all remaining classes in the collection of classes are terminal classes; and

automatically creating a hierarchical representation of the collection of classes.

7. The computer-readable storage medium of claim 6 , wherein the method further comprises removing the given class if it does not implement a specified interface.

8. The computer-readable storage medium of claim 6 , wherein the method further comprises removing the given class if it is not a driver class.

9. The computer-readable storage medium of claim 6 , wherein receiving a collection of classes further involves receiving a JAR file.

10. The computer-readable storage medium of claim 6 , wherein the method further comprises analyzing the given class by loading the given class with a class loader.

11. An apparatus for finding terminal classes in a collection of programming language classes, wherein a terminal class is a class that is not extended by any other class, comprising:

a computer system including:

a processor coupled to a memory;

a receiving mechanism configured to receive a collection of classes;

an analysis mechanism and a removal mechanism configured to find all terminal classes in the collection of classes with only a single pass through the collection of classes, wherein:

the analysis mechanism configured to analyze a given class in the collection of classes to determine if the given class extends any other class in the collection of classes;

the removal mechanism configured to remove the extended class from the collection of classes if the given class extends any other class; and

wherein the analysis mechanism and the removal mechanism are further configured to repeat the process for all remaining classes in the collection of classes; and

a modeling mechanism configured to automatically create a hierarchical representation of the collection of classes.

12. The apparatus of claim 11 , wherein the removal mechanism is further configured to remove the given class if it does not implement a specified interface.

13. The apparatus of claim 11 , wherein the removal mechanism is further configured to remove the given class if it is not a driver class.

14. The apparatus of claim 11 , wherein the receiving mechanism is further configured to receive a JAR file.

15. The apparatus of claim 11 , wherein the analysis mechanism is part of a class loader.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037304/0183 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 24, 2005
From: KLINE, JOHN A.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 016729/0415 →
Continuity (1)
Provisional Application 6058288000 · Jun 25, 2004