Class DataTypeImpl

    • Field Detail

      • defaultSettings

        protected Settings defaultSettings
    • Method Detail

      • getValueClass

        public java.lang.Class<?> getValueClass​(Settings settings)
        Description copied from interface: DataType
        Get the Class of the value to be returned by this datatype.
        Parameters:
        settings - the relevant settings to use or null for default.
        Returns:
        Class of the value to be returned by this datatype or null if it can vary or is unspecified. Types which correspond to a string or char array will return the String class.
      • getDefaultSettings

        public Settings getDefaultSettings()
        Description copied from interface: DataType
        Gets the default settings for this datatype.
        Returns:
        the default settings for this datatype.
      • getSettingsDefinitions

        public SettingsDefinition[] getSettingsDefinitions()
        Description copied from interface: DataType
        Gets a list of all the settingsDefinitions used by this datatype.
        Returns:
        a list of the settingsDefinitions used by this datatype.
      • setDefaultSettings

        public void setDefaultSettings​(Settings settings)
        Description copied from interface: DataType
        Set the default settings for this datatype.

        TODO: This method is reserved for internal DB use.

        Parameters:
        settings - the settings to be used as this dataTypes default settings.
      • getPathName

        public java.lang.String getPathName()
        Description copied from interface: DataType
        Get the full category path name that includes this datatype's name.

        If the category is null, then this just the datatype's name is returned.

        Specified by:
        getPathName in interface DataType
        Overrides:
        getPathName in class AbstractDataType
        Returns:
        the path, or just this type's name
      • getAlignment

        public int getAlignment()
        Description copied from interface: DataType
        Gets the alignment to be used when aligning this datatype within another datatype.
        Returns:
        this datatype's alignment.
      • addParent

        public void addParent​(DataType dt)
        Description copied from interface: DataType
        Inform this datatype that it has the given parent

        TODO: This method is reserved for internal DB use.

        Specified by:
        addParent in interface DataType
        Overrides:
        addParent in class AbstractDataType
        Parameters:
        dt - parent datatype
      • notifySizeChanged

        protected void notifySizeChanged()
        Notify all parents that the size of this datatype has changed or other significant change that may affect a parent containing this datatype.
      • notifyAlignmentChanged

        protected void notifyAlignmentChanged()
        Notify all parents that this datatype's alignment has changed
      • notifyNameChanged

        protected void notifyNameChanged​(java.lang.String oldName)
        Notify all parents that this datatype's name has changed
        Parameters:
        oldName -
      • notifyDeleted

        protected void notifyDeleted()
        Notify all parents that this datatype has been deleted
      • notifyReplaced

        protected void notifyReplaced​(DataType replacement)
        Notify any parents that I have been replaced.
        Parameters:
        replacement - replacement data type
      • notifyParents

        protected final void notifyParents​(java.util.function.Consumer<DataType> consumer)
      • getLastChangeTime

        public long getLastChangeTime()
        Description copied from interface: DataType
        Get the timestamp corresponding to the last time this type was changed within its datatype manager
        Specified by:
        getLastChangeTime in interface DataType
        Overrides:
        getLastChangeTime in class AbstractDataType
        Returns:
        timestamp of last change within datatype manager
      • getUniversalID

        public UniversalID getUniversalID()
        Description copied from interface: DataType
        Get the universal ID for this datatype.

        This value is intended to be a unique identifier across all programs and archives. The same ID indicates that two datatypes were originally the same one. Keep in mind names, categories, and component makeup may differ and have changed since there origin.

        Specified by:
        getUniversalID in interface DataType
        Overrides:
        getUniversalID in class AbstractDataType
        Returns:
        datatype UniversalID
      • replaceWith

        public void replaceWith​(DataType dataType)
        Description copied from interface: DataType
        For datatypes that support change, this method replaces the internals of this datatype with the internals of the given datatype.

        The datatypes must be of the same "type" (i.e. structure can only be replacedWith another structure.

        Specified by:
        replaceWith in interface DataType
        Overrides:
        replaceWith in class AbstractDataType
      • setLastChangeTime

        public void setLastChangeTime​(long lastChangeTime)
        Description copied from interface: DataType
        Sets the lastChangeTime for this datatype.

        Normally, this is updated automatically when a datatype is changed, but when committing or updating while synchronizing an archive, the lastChangeTime may need to be updated externally.

        Specified by:
        setLastChangeTime in interface DataType
        Overrides:
        setLastChangeTime in class AbstractDataType
        Parameters:
        lastChangeTime - the time to use as the lastChangeTime for this datatype
      • setLastChangeTimeInSourceArchive

        public void setLastChangeTimeInSourceArchive​(long lastChangeTimeInSourceArchive)
        Description copied from interface: DataType
        Sets the lastChangeTimeInSourceArchive for this datatype.

        This is used by when a datatype change is committed back to its source archive.

        Specified by:
        setLastChangeTimeInSourceArchive in interface DataType
        Overrides:
        setLastChangeTimeInSourceArchive in class AbstractDataType
        Parameters:
        lastChangeTimeInSourceArchive - the time to use as the lastChangeTimeInSourceArchive for this datatype
      • setDescription

        public void setDescription​(java.lang.String description)
                            throws java.lang.UnsupportedOperationException
        Sets a String briefly describing this DataType.
        If a data type that extends this class wants to allow the description to be changed, then it must override this method.
        Specified by:
        setDescription in interface DataType
        Overrides:
        setDescription in class AbstractDataType
        Parameters:
        description - a one-liner describing this DataType.
        Throws:
        java.lang.UnsupportedOperationException - if the description is not allowed to be set for this data type.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object