Arksoft Podcast Episode 5 – Java Standard Libraries Part1 Core java packages

Written by Larry Gray on . Posted in podcast

RSS feed is http://arksoft.libsyn.com/rss

  • Other types of classes, Error
  • assert keyword and AssertionError can turn off with compiler option
  • debugging using System.out.println();
  • serializable keyword
  • Also need to explain that you do not have to extend an abstract class to use its static members.
  • Also its a compile time error to try to have a abstract static method or member.
  • explain java arrays, no 2 dimentioned arrays, only arrays of arrays
java, javax, and org
  • java
    • applet
      • applet is a java.awt.Panel
      • start, stop, init, destroy
      • methods to play sound
      • methods for loading images
      • other utility type methods
    • awt
      • Canvas,Panel, Frame, Button, Menu, Edit Box etc.
      • Layout management classes
      • Image processing classes
      • Color classes
      • Windows event handling classes for mouse and key events and window events.
      • Graphics drawing and shapes
      • Clipboard
      • Drag and Drop
      • Fonts and printing
    • beans
    • io
      • Streams and Buffered Streams
      • Readers and Writers
      • File IO
      • Object Streams serialization
      • Input and output streams
      • standard out, in and error
      • Piped Streams
      • Ramdon Access File
      • Sequential Input and Output
      • Stream Tokenizer
      • String Reader and Writer
    • lang
      • Interfaces
        • Cloneable
        • Comparable
        • Iterable
        • Runnable
      • Classes
        • Object
        • Byte, Boolean, Character, Double, Fload, Integer, Long, Short, String
        • Class, Pacakge  java reflections  introspection  java.lang.reflect package
        • ClassLoader
        • Math
        • Number
        • String Buffer
        • System
        • Tread and Thread related
        • Throwable
          • All Errors and Exceptions
      • Exceptions
        • ClassCast, ArrayIndexOutOfBounds, NullPointerException
        • Exception, RuntimeException, checked and unchecked exceptions
        • NumberFormatException
        • SecurityException
      • Error
        • Error  could or should try to catch java.lang.Error to provide more debug info. But typically these are not thrown or caught by a developer.
        • Errors are more related to the system and are fatal in nature.
        • Errors cause the program to crash. Errors are unchecked by compiler.
        • NoClassDefFoundError, OutOfMemoryError
    • math
      • BigDecimal
      • BigInteger
    • net
      • sockets, cookies, urlstreams,
      • Inet4, Inet6 andInet address
      • InetSocketAddress can be hostename+port or ip+port
      • unicast, multicast, tcp an udp
      • ServerSocket and Socket(client socket)
      • Well known ports 0 to 1023 and IANA maintains the official list of well-known and registered ranges, registered ports 1024 through 49151, dynamic or private ports 49152 through 65535
      • javax.websockets note
      • SocketIpml is an example of an abstract class in the api, which All socket classes must extend.
      • Password Authentication, network permissions, JarURLConnection, HTTPURLConnection
      • URLConnections
      • SocketException, SocketTimeOutException, MalformedURLExcption, ConnectException, UnknownHostExcpetion
    • nio
      • nio.file gives you some tools for working with folders and files on a system.
    • rmi
      • remote method invocation
      • allows you to setup and create an rmi client server. the client may call or invoke methods on the server and get return values back.
    • security
      • deals with certificates, public and private key encryption,
      • policy files,  and permissions
    • sql
      • and javax.sql are powerful set of classes for accessing databases
      • its called java database connectivity and is database independent, any database with a driver can be accessed with java. standard sql can be used to manipulate the database.
      • you bassically connect to a database and if that goes well you can use direct execution of sql or prepared statments. You will get back a resultset which is like a table of data.
      • you will see a lot of interfaces that have no implementation. This is because DriverManager gives you an implementation of Connection which gives  you an implmementation of ResultSet etc.
      • And this is a perfect example of the power of Interfaces.
      • So basically using Java you program the "front end to a database".
      • By the way let me mention right now HSQLDB a database written in Java and new rewrite of it called H2. I've used both and they work well.
      • SQLException and other SQLException sublcasses
    • text
      • classes for handling numbers and dates time in text and conversion to actual number or date objects.
      • Also for other text formatting problems.
    • time
      • classes for handling clock and callender type problems.
    • util
      • Arrays, ArrayList, ArrayDequeue
      • Collections such as, Collection, Set, Map, List, HashMap, HashSet, EnumMap, EnumSet, Hashtable, LinkedHashMap, LinkedHashSet, LinkedList, Stack, TreeMap, TreeSet, PriorityQUeue, Queue, Dictionary(Hashtable), Vector
      • Calender, Date, Time, Gregorian Calender, Locale, Simple Time Zone, TimeZone
      • Observable Class, Observer Interface
      • Properties files class
      • DoubleStatisticsSummary, LongStatisticsSummary and IntStatisticsSummary  give count, min, max, sum, and average.
      • Formatter interprets printf style strings
      • Random Class gives a stream of Int, Long or Double Random numbers
      • Scanner, scans Files, Streams or Sources and Strings, will split based on delimiters or whitespace.
        • Also finds tokens, search strings, and next data of various types such as int, double, and others.  Its a  handy way to process text data.
      • Currency class
      • StringJoiner and StringTokenizer  for joining and spliltting strings
      • Timer
      • UUID universal unique immutible identifier.
      • Objects has methods for opearting on Objects.
        • deepEquals() similar in concopt to deepClone()
Java Lang Object
  • clone
  • equals
  • finalize
  • getClass
  • toString
  • hashCode
  • notify, notify all and wait
Java Lang String
  • You can build strings from byte arrays, char arrays, Strings, StringBuffers.
  • Searching and matching
  • splitting, substring, joining strings, replace operations
  • converting primitives to strings
  • comparing strings
  • ends and starts with
  • is empty or length = 0 and length
  • to upper and lower case
  • makes char arrays from whole or part of string
  • makes byte arrays from whole or part of string
  • formatter for working with printf style strings
Java Util Arrays
  • make an array a List
  • binary searching of arrays
  • copying arrays and parts of arrays
  • deep equals, deep hashcode and deep toString
  • comparing equality
  • filling an array
  • hashcodes for types of arrays
  • parallel operations on arrays using functions
  • setting all elements using functions
  • sorting arrays
  • iterating methods called spliterators
  • turns the array into a stream for use in IO operations
  • and toString for types of arrays
Java Awt Graphics class A graphics object is an object that wraps up a piece of screen real estate. Your application based on the size of your frame is given some space on the screen. The graphics image underlying of course can be larger than that space and positioned at the top left corner of that space as 0,0  with + Y going downward and +X going across to right. Upside down Cartesian coordinates or algebra coordinates.  You usually work with BuffedImages and cast to Image and use that with Graphics or Graphics2D classes. Graphics and Graphics2D are interfaces so you would get one from the paint or paintComponent methods in Canvas, Panel or JPanel classes
  • clearing and filling rectangles
  • drawing boxes, rectangles, ovals, circles, arcs
  • drawing Strings, char arrays, and byte arrays as text
  • drawing lines and polygons
  • filling shapes
  • drawing images and textures
  • drawing in clipped regions
  • drawing in xor mode (reverse image)
  • Graphics 2D has more than this.. I will cover in next podcast
  • get and set pen color for drawing or text.
  • has methods for working with fonts
  • If you want to get a sub image from the main image you have to use BufferedImage class By making a BufferedImage with an Image object
  next podcast will be java extended libraries
  • javax
    • accessability
    • activation
    • activity
    • annotation
    • crypto
    • imageio
    • jws
    • lang
    • management
    • naming
    • net
    • print
    • rmi
    • script
    • security
    • sound
    • sql
    • swing
    • tools
    • transaction
    • xml
  • org
    • w3c.dom
    • xml.sax

Tags: , , , , , , ,

Trackback from your site.

Leave a comment