001package jmri.beans;
002
003import java.beans.PropertyChangeEvent;
004
005/**
006 * Interface that defines the methods needed to fire property changes.
007 *
008 * @author Randall Wood Copyright 2020
009 */
010// This package-protected interface exists so that multiple implementations can inherit the Javadocs
011interface PropertyChangeFirer {
012
013    /**
014     * Fire an indexed property change.
015     *
016     * @param propertyName the programmatic name of the property that was
017     *                     changed
018     * @param index        the index of the property element that was changed
019     * @param oldValue     the old value of the property
020     * @param newValue     the new value of the property
021     */
022    void fireIndexedPropertyChange(String propertyName, int index, boolean oldValue, boolean newValue);
023
024    /**
025     * Fire an indexed property change.
026     *
027     * @param propertyName the programmatic name of the property that was
028     *                     changed
029     * @param index        the index of the property element that was changed
030     * @param oldValue     the old value of the property
031     * @param newValue     the new value of the property
032     */
033    void fireIndexedPropertyChange(String propertyName, int index, int oldValue, int newValue);
034
035    /**
036     * Fire an indexed property change.
037     *
038     * @param propertyName the programmatic name of the property that was
039     *                     changed
040     * @param index        the index of the property element that was changed
041     * @param oldValue     the old value of the property
042     * @param newValue     the new value of the property
043     */
044    void fireIndexedPropertyChange(String propertyName, int index, Object oldValue, Object newValue);
045
046    /**
047     * Fire a property change.
048     *
049     * @param propertyName the programmatic name of the property that was
050     *                     changed
051     * @param oldValue     the old value of the property
052     * @param newValue     the new value of the property
053     */
054    void firePropertyChange(String propertyName, boolean oldValue, boolean newValue);
055
056    /**
057     * Fire a property change.
058     *
059     * @param event the PropertyChangeEvent to be fired
060     */
061    void firePropertyChange(PropertyChangeEvent event);
062
063    /**
064     * Fire a property change.
065     *
066     * @param propertyName the programmatic name of the property that was
067     *                     changed
068     * @param oldValue     the old value of the property
069     * @param newValue     the new value of the property
070     */
071    void firePropertyChange(String propertyName, int oldValue, int newValue);
072
073    /**
074     * Fire a property change.
075     *
076     * @param propertyName the programmatic name of the property that was
077     *                     changed
078     * @param oldValue     the old value of the property
079     * @param newValue     the new value of the property
080     */
081    void firePropertyChange(String propertyName, Object oldValue, Object newValue);
082
083}