java.awt 包中有多少行代码(对于任何最新版本的 Java)?

发布于 2024-10-03 01:47:04 字数 192 浏览 1 评论 0原文

我想估计 Java AWT 包中的代码行数。版本并不重要(Java 5 或 6 都可以)。我似乎无法在任何容易访问的地方找到源代码。

我只对 java.awt 包本身感兴趣,而不对任何 java.awt._ 包感兴趣。在行数中包含注释也很好。只需在 java.awt 目录中输入“wc -l *.java”即可。

谢谢!

I'd like to get an estimate of the number of lines of code that are in the Java AWT package. Version doesn't really matter (Java 5 or 6 is fine). I can't seem to find the source code in any easily-accessible place.

I'm only interested in the java.awt package itself, not any of the java.awt._ packages. Including comments in the line count is fine too. Just a 'wc -l *.java' on the java.awt directory will do fine.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天生の放荡 2024-10-10 01:47:04

Java 文件中有 81,295 行组成 Java 6 中的 java.awt 包。

jbrandt@planetexpress:~/temp/java/awt$ wc -l *.java
     42 ActiveEvent.java
    142 Adjustable.java
    788 AlphaComposite.java
     34 AttributeValue.java
     32 AWTError.java
    557 AWTEvent.java
   1015 AWTEventMulticaster.java
     34 AWTException.java
    848 AWTKeyStroke.java
    212 AWTPermission.java
    586 BasicStroke.java
    870 BorderLayout.java
    199 BufferCapabilities.java
    658 Button.java
    226 Canvas.java
    592 CardLayout.java
    133 CheckboxGroup.java
    849 Checkbox.java
    616 CheckboxMenuItem.java
    794 Choice.java
   1225 Color.java
     48 ColorPaintContext.java
   9982 Component.java
    184 ComponentOrientation.java
     52 CompositeContext.java
     69 Composite.java
     20 Conditional.java
   4649 Container.java
    483 ContainerOrderFocusTraversalPolicy.java
    441 Cursor.java
    111 DefaultFocusTraversalPolicy.java
   1337 DefaultKeyboardFocusManager.java
    466 Desktop.java
   1680 Dialog.java
    220 Dimension.java
    138 DisplayMode.java
    462 EventDispatchThread.java
     43 EventFilter.java
    862 Event.java
   1043 EventQueue.java
    449 FileDialog.java
    681 FlowLayout.java
    158 FocusTraversalPolicy.java
     34 FontFormatException.java
   2567 Font.java
    625 FontMetrics.java
   1168 Frame.java
    276 GradientPaintContext.java
    245 GradientPaint.java
   1217 Graphics2D.java
    128 GraphicsCallback.java
     96 GraphicsConfigTemplate.java
    416 GraphicsConfiguration.java
    424 GraphicsDevice.java
    411 GraphicsEnvironment.java
   1239 Graphics.java
    646 GridBagConstraints.java
     62 GridBagLayoutInfo.java
   2211 GridBagLayout.java
    455 GridLayout.java
     39 HeadlessException.java
     40 IllegalComponentStateException.java
     63 ImageCapabilities.java
    336 Image.java
    171 Insets.java
     48 ItemSelectable.java
   1048 JobAttributes.java
   3060 KeyboardFocusManager.java
     73 KeyEventDispatcher.java
     76 KeyEventPostProcessor.java
    343 Label.java
     70 LayoutManager2.java
     66 LayoutManager.java
    147 LinearGradientPaintContext.java
    334 LinearGradientPaint.java
   1930 List.java
    933 MediaTracker.java
    483 MenuBar.java
   1027 MenuComponent.java
     26 MenuContainer.java
    900 MenuItem.java
    605 Menu.java
    177 MenuShortcut.java
    198 ModalEventFilter.java
    118 MouseInfo.java
    704 MultipleGradientPaintContext.java
    287 MultipleGradientPaint.java
   1361 PageAttributes.java
     65 PaintContext.java
     77 Paint.java
    117 Panel.java
     67 PointerInfo.java
    215 Point.java
    660 Polygon.java
    213 PopupMenu.java
     24 PrintGraphics.java
     63 PrintJob.java
    431 RadialGradientPaintContext.java
    579 RadialGradientPaint.java
   1197 Rectangle.java
   1282 RenderingHints.java
    478 Robot.java
   1316 Scrollbar.java
    428 ScrollPaneAdjustable.java
    828 ScrollPane.java
     76 SentEvent.java
    198 SequencedEvent.java
    341 Shape.java
    331 SplashScreen.java
     55 Stroke.java
    472 SystemColor.java
    460 SystemTray.java
    697 TextArea.java
   1215 TextComponent.java
    738 TextField.java
    806 TexturePaintContext.java
    123 TexturePaint.java
   2498 Toolkit.java
     42 Transparency.java
    762 TrayIcon.java
   3528 Window.java
  81295 total

There are 81,295 lines in the java files that make up the java.awt package in Java 6.

jbrandt@planetexpress:~/temp/java/awt$ wc -l *.java
     42 ActiveEvent.java
    142 Adjustable.java
    788 AlphaComposite.java
     34 AttributeValue.java
     32 AWTError.java
    557 AWTEvent.java
   1015 AWTEventMulticaster.java
     34 AWTException.java
    848 AWTKeyStroke.java
    212 AWTPermission.java
    586 BasicStroke.java
    870 BorderLayout.java
    199 BufferCapabilities.java
    658 Button.java
    226 Canvas.java
    592 CardLayout.java
    133 CheckboxGroup.java
    849 Checkbox.java
    616 CheckboxMenuItem.java
    794 Choice.java
   1225 Color.java
     48 ColorPaintContext.java
   9982 Component.java
    184 ComponentOrientation.java
     52 CompositeContext.java
     69 Composite.java
     20 Conditional.java
   4649 Container.java
    483 ContainerOrderFocusTraversalPolicy.java
    441 Cursor.java
    111 DefaultFocusTraversalPolicy.java
   1337 DefaultKeyboardFocusManager.java
    466 Desktop.java
   1680 Dialog.java
    220 Dimension.java
    138 DisplayMode.java
    462 EventDispatchThread.java
     43 EventFilter.java
    862 Event.java
   1043 EventQueue.java
    449 FileDialog.java
    681 FlowLayout.java
    158 FocusTraversalPolicy.java
     34 FontFormatException.java
   2567 Font.java
    625 FontMetrics.java
   1168 Frame.java
    276 GradientPaintContext.java
    245 GradientPaint.java
   1217 Graphics2D.java
    128 GraphicsCallback.java
     96 GraphicsConfigTemplate.java
    416 GraphicsConfiguration.java
    424 GraphicsDevice.java
    411 GraphicsEnvironment.java
   1239 Graphics.java
    646 GridBagConstraints.java
     62 GridBagLayoutInfo.java
   2211 GridBagLayout.java
    455 GridLayout.java
     39 HeadlessException.java
     40 IllegalComponentStateException.java
     63 ImageCapabilities.java
    336 Image.java
    171 Insets.java
     48 ItemSelectable.java
   1048 JobAttributes.java
   3060 KeyboardFocusManager.java
     73 KeyEventDispatcher.java
     76 KeyEventPostProcessor.java
    343 Label.java
     70 LayoutManager2.java
     66 LayoutManager.java
    147 LinearGradientPaintContext.java
    334 LinearGradientPaint.java
   1930 List.java
    933 MediaTracker.java
    483 MenuBar.java
   1027 MenuComponent.java
     26 MenuContainer.java
    900 MenuItem.java
    605 Menu.java
    177 MenuShortcut.java
    198 ModalEventFilter.java
    118 MouseInfo.java
    704 MultipleGradientPaintContext.java
    287 MultipleGradientPaint.java
   1361 PageAttributes.java
     65 PaintContext.java
     77 Paint.java
    117 Panel.java
     67 PointerInfo.java
    215 Point.java
    660 Polygon.java
    213 PopupMenu.java
     24 PrintGraphics.java
     63 PrintJob.java
    431 RadialGradientPaintContext.java
    579 RadialGradientPaint.java
   1197 Rectangle.java
   1282 RenderingHints.java
    478 Robot.java
   1316 Scrollbar.java
    428 ScrollPaneAdjustable.java
    828 ScrollPane.java
     76 SentEvent.java
    198 SequencedEvent.java
    341 Shape.java
    331 SplashScreen.java
     55 Stroke.java
    472 SystemColor.java
    460 SystemTray.java
    697 TextArea.java
   1215 TextComponent.java
    738 TextField.java
    806 TexturePaintContext.java
    123 TexturePaint.java
   2498 Toolkit.java
     42 Transparency.java
    762 TrayIcon.java
   3528 Window.java
  81295 total
倦话 2024-10-10 01:47:04

这是一道什么样的编程题?

无论如何,下载 这个 perl 脚本,解压 Java 源代码,您通常可以在名为 src.zip 的文件中找到该源代码在你的 java home 中(或者你可以从 Oracle 网站下载它们)并计算它们。

What kind of programming question is this one?

In any case download this perl script, unzip java sources that you can usually find in a file named src.zip somewhere in your java home (otherwise you can download them from Oracle site) and count them..

安人多梦 2024-10-10 01:47:04

据我统计,OpenJDK7的jdk/src/share/classes/java/awt目录下有83188个,不包括子包。

编辑:现在没有子包。

There are 83188 in the jdk/src/share/classes/java/awt directory of OpenJDK7, by my count, not including subpackages.

EDIT: Now without subpackages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文