Posts

Showing posts from October, 2011

Characteristics of Object.equals()

I am come across the characteristics specified for implementation of equals() method in Java Classes. There is nothing like which we don’t know, but here it is well explained. I thought of sharing the same just for recalling old Java learning days Here are the characteristics that every implementation of Object.equals() should follow Reflexive. For any non-null reference value x, x.equals(x) should return true Symmetric. For any non-null reference values x and y. x.equals(y) should return true if and only if y.equals(x)   returns true. Transitive. For any non-null references value x,y and z , it x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true . Consistent. For any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified. For any non-null reference value x, x.equals(null) sho

Eclipse PDE: Everything about Editor Part 5

Image
Code Completion using Content Assist This post explains about completion proposal feature of eclipse editor framework. This is part of Everything About Editor series. Content assist provides content assist help to developer while writing code in editor. It helps from static suggestion of language keyword to methods suggestion for dynamic reference on hitting “Ctrl-Space” or entering  any of activator character like ‘.’. Following two interfaces plays key role in implementing code completion for customer editor. ICompletionProposal – Responsible for providing set of proposals text, associated icons etc. IContentAssistProcessor – Responsible for calculating the completion proposals at a point in the editor. It also defines character on which it shoud auto-activate. In this example we are going to see providing content assist then user enters ‘#’. To achieve this we need to implement IComppletionProposal that will return set of proposals as well as tells framework which chara