Coding Styleguide

Tabs, Line Breaks, Encoding

Spaces

Empty lines

Statement blocks

       if (done) {
           ...
       } else {
           ...
       }
       switch (a) {
       case 1:
           ...
           break;
       case 2:
           ...
           break;
       default:
           ...
       }
       for (int i = 0; i < count; i++) {
           ...
       }
       while (!found) {
           ...
       }

Class Layout

package de.deepamehta.topics;

import de.deepamehta.BaseTopic;
import de.deepamehta.service.ApplicationService;
...
//
import java.text.DateFormat;
import java.util.*;



/**
 * Last functional change: 17.9.2007 (2.0b8)<br>
 * Last documentation update: 6.7.2007 (2.0b8)<br>
 * Jörg Richter<br>
 * jri@freenet.de
 */
public class CalendarTopic extends LiveTopic {



    // *****************
    // *** Constants ***
    // *****************



    private static final int CALENDAR_DAY_START_HOUR = 9;
    private static final int CALENDAR_DAY_END_HOUR = 22;
    ...



    // *****************
    // *** Variables ***
    // *****************



    ...
    ...



    // *******************
    // *** Constructor ***
    // *******************



    public CalendarTopic(BaseTopic topic, ApplicationService as) {
        super(topic, as);
    }



    // ************************
    // *** Overriding Hooks ***
    // ************************



    // ------------------
    // --- Life Cycle ---
    // ------------------



    public CorporateDirectives evoke(Session session, String topicmapID, String viewmode) {
        ...
    }



    // ---------------------------
    // --- Handling Properties ---
    // ---------------------------



    public CorporateDirectives propertiesChanged(Hashtable newProps, Hashtable oldProps,
                                            String topicmapID, String viewmode, Session session) {
        ...
    }

    public Vector disabledProperties(Session session) {
        ...
    }



    // **********************
    // *** Custom Methods ***
    // **********************



    void updateView(CorporateDirectives directives) {
        ...
    }



    // *********************
    // *** Inner Classes ***
    // *********************



    private class GridCell {
        ...
    }
}




Jörg Richter
jri@freenet.de
18.9.2007