001/**
002 * DataElement -- Defines the interface in common to all data elements..
003 *
004 * Copyright (C) 2003-2025, by Joseph A. Huwaldt. All rights reserved.
005 *
006 * This library is free software; you can redistribute it and/or modify it under the terms
007 * of the GNU Lesser General Public License as published by the Free Software Foundation;
008 * either version 2 of the License, or (at your option) any later version.
009 *
010 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
011 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
012 * PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
013 *
014 * You should have received a copy of the GNU Lesser General Public License along with
015 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place -
016 * Suite 330, Boston, MA 02111-1307, USA. Or visit: http://www.gnu.org/licenses/lgpl.html
017 */
018package jahuwaldt.js.datareader;
019
020import java.util.ResourceBundle;
021
022/**
023 * Defines the interface in common to all data elements.
024 *
025 * <p> Modified by: Joseph A. Huwaldt </p>
026 *
027 * @author Joseph A. Huwaldt, Date: March 5, 2003
028 * @version February 23, 2025
029 */
030public interface DataElement extends Comparable<DataElement> {
031
032    /**
033     * The resource bundle for this package.
034     */
035    public static final ResourceBundle RESOURCES = DataReader.RESOURCES;
036    
037    /**
038     * Return the name of this data element.
039     *
040     * @return The name of this data element.
041     */
042    public CharSequence getName();
043
044    /**
045     * Change the name of this data element to the specified name.
046     *
047     * @param newName The name of this data element.
048     */
049    public void setName(CharSequence newName);
050
051    /**
052     * Return any user defined object associated with this data element. If there is no
053     * user data, then null is returned.
054     *
055     * @return The user defined object associated with this data element or null
056     *          if there isn't any.
057     */
058    public Object getUserObject();
059
060    /**
061     * Set the user defined object associated with this data element. This can be used to
062     * store any type of information with a data element that could be useful.
063     *
064     * @param data The user data to associate with this element.
065     */
066    public void setUserObject(Object data);
067}