File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes about class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "about class" Watch "about class" New topic
Author

about class

toy lee
Greenhorn

Joined: Feb 08, 2001
Posts: 3
hi,all
I am researching some codes.the below lines make me puzzle.
I don't understand the meaing of them
System.out.print("preloading...");
c = uci.gef.CmdSetMode.class;
c = uci.gef.ModePlace.class;
c = uci.gef.ModeModify.class;
c = uci.gef.SelectionResize.class;
c = uci.ui.ColorRenderer.class;
c = uci.ui.Swatch.class;
c = uci.util.EnumerationEmpty.class;
c = uci.util.EnumerationSingle.class;
c = uci.uml.util.GenCompositeClasses.class;
c = uci.uml.visual.FigClass.class;
c = uci.uml.visual.FigPackage.class;
c = uci.uml.visual.FigInterface.class;
c = uci.uml.visual.FigAssociation.class;
c = uci.uml.visual.FigGeneralization.class;
c = uci.uml.visual.FigRealization.class;
System.out.println(" done preloading");
I guessed that it will make a shorter time in instancing object.But I make some test that proved my guess is wrong.
Is there anyone give me some ideas?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Are you using an IDE like jBuilder or something???


"JavaRanch, where the deer and the Certified play" - David O'Meara
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
is this a puzzle or what,
Toy:
if you don't mind, could you please (i repeat please)
tell us how you got this code or where you found it?
that way, I think we could make a closer guess.
At this stage, if the comments mean something to me then. I would say:
This is a part of code from a static block which is attempting
to load some class libraries.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
toy lee
Greenhorn

Joined: Feb 08, 2001
Posts: 3
I got these codes from the argo-uml that is a open source project.
I don't understand why it declare these classes during the starup.Could it improve the performance? I read the java doc carefully,but get nothing about it. I tested the below code and
find the consumed time is same. anyone can tell me the benefits
of these codes.
code 1:
System.out.println(System.currentTimeMillis());
new ClassA();
new ClassB();
System.out.println(System.currentTimeMillis());
code 2:
System.out.println(System.currentTimeMillis());
Class c = ClassA.class;
c = ClassB.class;
new ClassA();
new ClassB();
System.out.println(System.currentTimeMillis());
 
Consider Paul's rocket mass heater.
 
subject: about class
 
Similar Threads
preloading images
preloading message
Preloading images
preloading of images and the cache
Preloading form:select