Class DXFXrecord

  • All Implemented Interfaces:
    DXFObject

    public class DXFXrecord
    extends DXFDatabaseObject
    Class representing Xrecord for use in OBJECTS table. Xrecords contain arbitrary strings not tied to geometric objects for things like document title, author, etc. Each string is assigned to a user-selected group code from 1 - 369 (except 5 and 105).
    Author:
    jsevy
    • Constructor Summary

      Constructors 
      Constructor Description
      DXFXrecord()
      Create an Xrecord object with no associated attributes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAttribute​(int groupCode)
      Get the String associated with the supplied group code, or null if no string is associated.
      void setAttribute​(int groupCode, java.lang.String attributeValue)
      Associate the String with the supplied group code in this Xrecord, replacing any that may already be there.
      java.lang.String toDXFString()
      Implementation of DXFObject interface method; creates DXF text representing the object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DXFXrecord

        public DXFXrecord()
        Create an Xrecord object with no associated attributes.
    • Method Detail

      • getAttribute

        public java.lang.String getAttribute​(int groupCode)
        Get the String associated with the supplied group code, or null if no string is associated.
        Parameters:
        groupCode - Group code value for desired attribute.
        Returns:
        String associated with supplied group code, or null if none associated
      • setAttribute

        public void setAttribute​(int groupCode,
                                 java.lang.String attributeValue)
        Associate the String with the supplied group code in this Xrecord, replacing any that may already be there. From the DXF standard, any value from 1 - 369 may be used, except 5 and 105; note that no error is issued if one of these restricted values is supplied, but the resulting DXF file will not be compliant with the standard and may cause issues when opened with a standard-compliant viewer.
        Parameters:
        groupCode - Group code value to be associated with supplied string, from 1 to 369 excepting 5 and 105
        attributeValue - String to associate with supplied group code
      • toDXFString

        public java.lang.String toDXFString()
        Implementation of DXFObject interface method; creates DXF text representing the object.
        Specified by:
        toDXFString in interface DXFObject
        Overrides:
        toDXFString in class DXFDatabaseObject