001/**
002 * 
003 */
004package icy.common;
005
006/**
007 * Collapsible interface for collapsible event used by UpdateEventHandler.<br/>
008 * As we use HashMap to store these events, so we rely on Object.equals(..) and
009 * Object.hashcode() implementation for these events.
010 * 
011 * @author Stephane
012 */
013public interface CollapsibleEvent
014{
015    /**
016     * Collapse current object/event with specified one.
017     * 
018     * @return <code>false</code> if collapse operation failed (object are not 'equals')
019     */
020    public boolean collapse(CollapsibleEvent event);
021
022    /**
023     * Returns <code>true</code> if the current event is equivalent to the specified one.<br/>
024     * We want event to override {@link Object#equals(Object)} method as we use an HashMap to store
025     * these event
026     * in the {@link UpdateEventHandler} class.
027     */
028    public boolean equals(Object event);
029
030    /**
031     * Returns hash code for current event. It should respect the default {@link Object#hashCode()}
032     * contract.
033     */
034    public int hashCode();
035}