Brett Rijnders

Welcome to my Playground

Java SE 7 Programmer II (1Z0-804) notes

This post contains a collection of notes that I have made when I was preparing for the Java SE 7 Programmer II exam. For tips on how to prepare for this exam please see my other post.

Java SE 7 Programmer II notes

String processing

  • The delimiter string itself doesn’t act as a delimiter but each character in the delimiter String acts as a delimiter. So StringTokenizer(“abcde”, “bd”) will return a, c, and e and not abcde because b and d both act as a delimiter.
  • When using “\s” as tokenizer, don’t forget to add additional backslash to escape the “\”, i.e., you should use “\\s”.
  • The word boundary is indicated by “\\b” and includes spaces, tabs, special characters and beginning and end of the line.
  • When using explicit index (e.g., %1$) the index number always starts with 1.
  • String is immutable while StringBuilder and StringBuffer are not.
  • For regular expressions the word boundary token “\b” does not actually match any character. For example the matches differ if you match with \btest\b or with \stest\s for the string “test test test test”. The first pattern will give 4 matches while the second will give only 1 match (the second “test”).
  • When using split(String regex) the trailing empty strings won’t be included.
  • The default precision for floating point number is 6.
  • When padding is specified the width needs to be specified as well, otherwise an exception is thrown.
  • The parameter %f only accepts floats or doubles, it doesn’t accept booleans, integers, chars or anything else.
  • When using Scanner there are many hasNextXXX and nextXXX methods, except for hasNextCharacter and nextCharacter, they do not exist!
  • Note that for word boundaries (when using \b as pattern) the parts before and after a word are also considered as word boundaries, even if there is no visible boundary such as white space. This means that when you use the pattern \b\w*\b on “someword” it gives someword back as a match.
  • Calendar has three important methods:
    • Add(int aField, int amount).
    • Roll(int aField, int amount), is quite similar to add(…). However, it does not modify the “larger” fields, i.e., if you add 11 months to the date in March 2014 then it would yield Februari 2014 and not Februari 2015, hence the larger fields (in this case year) is not modified.
    • Set(int aField, int value).
Read More

case study minor 3DVE, velas3D tool

paper Abstract: In the year 2012 Rijkswaterstaat wants to finish a new version of the AHN project.
The aim of the AHN project is to create an elevation record for the Netherlands, using laser
altimetry and the principles of LIDAR. This AHN-2 digital height map will have a density of up
to 30 points/m2, cover an area of 33.800 km2 and is divided into TOP10NL tiles. Problems
faced while handling these huge amounts of data leads to the research subject: “Improving
accessibility to and handling of AHN-2 LIDAR points in relatively large map areas”. The Velas3D tool
presented here, allows for seamless selection and secure retrieval of AHN-2 data via an
interactive web interface. Highlights include the usage of the LAS file format and the LibLAS
library for storage and processing of AHN-2 data.

Read More