Class DataTypeImpl

    • Field Detail

      • defaultSettings

        protected Settings defaultSettings
      • name

        protected java.lang.String name
    • Method Detail

      • getDataOrganization

        protected final DataOrganization getDataOrganization()
        Returns the DataOrganization associated with this data-types DataTypeManager
      • isNotYetDefined

        public boolean isNotYetDefined()
        Description copied from interface: DataType
        Indicates if type has not yet been defined. Such types will always return a size of 1. (example: empty structure)
        Specified by:
        isNotYetDefined in interface DataType
        Returns:
        true if this type is not yet defined.
      • getValueClass

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

        public CategoryPath getCategoryPath()
        Description copied from interface: DataType
        Gets the categoryPath associated with this data type
        Specified by:
        getCategoryPath in interface DataType
        Returns:
        the datatype's category path
      • getDataTypePath

        public DataTypePath getDataTypePath()
        Description copied from interface: DataType
        Returns the dataTypePath for this dataType;
        Specified by:
        getDataTypePath in interface DataType
        Returns:
        the dataTypePath for this dataType;
      • getDocs

        public java.net.URL getDocs()
        Description copied from interface: DataType
        The getDocs method should provide a URL pointing to extended documentation for this DataType if it exists. A typical use would be to return a URL pointing to the programmers reference for this instruction or a page describing this data structure.
        Specified by:
        getDocs in interface DataType
        Returns:
        null - there is no URL documentation for this prototype.
        See Also:
        DataType.getDocs()
      • getDisplayName

        public java.lang.String getDisplayName()
        Description copied from interface: DataType
        Gets the name for referring to this data type.
        Specified by:
        getDisplayName in interface DataType
        Returns:
        generic name for this Data Type (i.e.: Word)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isDeleted

        public boolean isDeleted()
        Description copied from interface: DataType
        Returns true if this data type has been deleted and is no longer valid
        Specified by:
        isDeleted in interface DataType
        Returns:
        true if this data type has been deleted and is no longer valid.
        See Also:
        DataType.isDeleted()
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        See Also:
        ChangeListener.stateChanged(javax.swing.event.ChangeEvent)
      • getDataTypeManager

        public DataTypeManager getDataTypeManager()
        Description copied from interface: DataType
        Returns the DataTypeManager that is associated with this dataType. This association should not be used to indicate whether this DataType has been resolved, but is intended to indicate whether the appropriate DataOrganization is being used.
        Specified by:
        getDataTypeManager in interface DataType
        See Also:
        DataType.getDataTypeManager()
      • getPathName

        public java.lang.String getPathName()
        Description copied from interface: DataType
        Returns the full category path name that includes this dataType's name. If the category is null, then this just returns the dataType's name.
        Specified by:
        getPathName in interface DataType
        See Also:
        DataType.getPathName()
      • getAlignment

        public int getAlignment()
        Description copied from interface: DataType
        Gets the alignment to be used when aligning this data type within another data type.
        Specified by:
        getAlignment in interface DataType
        Returns:
        this data type's alignment.
      • getParents

        public DataType[] getParents()
        Specified by:
        getParents in interface DataType
        Returns:
        an array of parents of this data type
      • notifySizeChanged

        protected void notifySizeChanged()
        Notify any parent data types that my size has changed.
      • notifyNameChanged

        protected void notifyNameChanged​(java.lang.String oldName)
        Notify any parents that my name has changed.
        Parameters:
        oldName -
      • notifyDeleted

        protected void notifyDeleted()
        Notify any parents that I am deleted.
      • notifyReplaced

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

        public java.lang.String getDefaultLabelPrefix()
        Description copied from interface: DataType
        Returns the appropriate string to use as the default label prefix in the absence of any data.
        Specified by:
        getDefaultLabelPrefix in interface DataType
        Returns:
        the default label prefix or null if none specified.
      • getDefaultAbbreviatedLabelPrefix

        public java.lang.String getDefaultAbbreviatedLabelPrefix()
        Description copied from interface: DataType
        Returns the prefix to use for this datatype when an abbreviated prefix is desired. For example, some data types will built a large default label, at which is is more desirable to have a shortened prefix.
        Specified by:
        getDefaultAbbreviatedLabelPrefix in interface DataType
        Returns:
        the prefix to use for this datatype when an abbreviated prefix is desired. May return null.
      • getDefaultLabelPrefix

        public java.lang.String getDefaultLabelPrefix​(MemBuffer buf,
                                                      Settings settings,
                                                      int len,
                                                      DataTypeDisplayOptions options)
        Description copied from interface: DataType
        Returns the appropriate string to use as the default label prefix.
        Specified by:
        getDefaultLabelPrefix in interface DataType
        Parameters:
        buf - memory buffer containing the bytes.
        settings - the Settings object
        options - options for how to format the default label prefix.
        Returns:
        the default label prefix or null if none specified.
      • getDefaultOffcutLabelPrefix

        public java.lang.String getDefaultOffcutLabelPrefix​(MemBuffer buf,
                                                            Settings settings,
                                                            int len,
                                                            DataTypeDisplayOptions options,
                                                            int offcutLength)
        Description copied from interface: DataType
        Returns the appropriate string to use as the default label prefix, taking into account the fact that there exists a reference to the data that references offcutLength bytes into this type
        Specified by:
        getDefaultOffcutLabelPrefix in interface DataType
        Parameters:
        buf - memory buffer containing the bytes.
        settings - the Settings object
        options - options for how to format the default label prefix.
        Returns:
        the default label prefix.
      • getLastChangeTime

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

        public long getLastChangeTimeInSourceArchive()
        Description copied from interface: DataType
        Get the timestamp corresponding to the last time this type was sync'd within its source archive
        Specified by:
        getLastChangeTimeInSourceArchive in interface DataType
        Returns:
        timestamp of last sync with source archive
      • getSourceArchive

        public SourceArchive getSourceArchive()
        Description copied from interface: DataType
        Get the source archive where this type originated
        Specified by:
        getSourceArchive in interface DataType
        Returns:
        source archive object
      • setSourceArchive

        public void setSourceArchive​(SourceArchive archive)
        Description copied from interface: DataType
        Set the source archive where this type originated
        Specified by:
        setSourceArchive in interface DataType
        Parameters:
        archive - source archive object
      • getUniversalID

        public UniversalID getUniversalID()
        Description copied from interface: DataType
        Get the universal ID for this data type. This value is intended to be a unique identifier across all programs and archives. The same ID indicates that two data types 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
        Returns:
        data type 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
        Parameters:
        dataType - the dataType that contains the internals to upgrade to.
      • 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
        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
        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
        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