/** * February 27, 2008 * Document ID: GXD0074_en, version 1.00 */ /** * Version and file information goes here * * Copyright statement goes here */ package nl.gx.conventions; /** * Class description goed here * * @author Firstname Lastname */ public class Example { /** * Nice javadoc */ public static int DUMMY_COUNT = 3; /** * Nice javadoc */ public int myPublicSomethingElse; private String myPrivateSomething; // Private so no javadoc mandatory /** * Constructor * @param something * @param somethingelse */ public Example(String something, int somethingElse) { myPrivateSomething = something; myPublicSomethingElse = somethingElse; } /** * Getter for something * @return something */ public String getSomething() { return myPrivateSomething; } /** * Setter for something * @param something */ public void setSomething(String something) { myPrivateSomething = something; } /** * Makes it so * @param action action to perform */ public void makeItSo(String action, int count) { boolean expression = action.equals("do") && count > DUMMY_COUNT; makeItSo(action, expression); } /** * Return 1 devided by given number * @param number the number to be devided */ public int getError(int number) { // FIXME (ivol): this won’t work if myNumber equals 0 return 1/number; } /** * Makes it so * @param action action to be performed * @param expression conditional expression which must be true to perform action */ protected void makeItSo(String action, boolean expression) { if (expression) { // Perform the action try { performAction(action); } catch (Exception e) { e.printStackTrace(); } } else { // Do nothing } } // No javadoc necessary for private method private void performAction(String action) throws Exception { } // No javadoc necessary for private method private int doComplexCalculation(); // TODO (ivol): must be implemented, return 0 for now return 0; } }