com.ohrasys.cad.gds
Class GDSUnitsRecord

java.lang.Object
  extended by com.ohrasys.cad.gds.GDSRecord
      extended by com.ohrasys.cad.gds.GDSUnitsRecord

public class GDSUnitsRecord
extends GDSRecord

Represents a GDSII UNITS record.

Please see The GDSII techincal reference for a more complete discussion of the GDSII stream syntax.

Since:
1.5

Field Summary
 
Fields inherited from class com.ohrasys.cad.gds.GDSRecord
ANGLE, AREF, AREF_ELEM_TYPE, ATTRTABLE, BGNEXTN, BGNLIB, BGNSTR, BIT_ARRAY_TYPE, BORDER, BOUNDARY, BOUNDARY_ELEM_TYPE, BOX, BOX_ELEM_TYPE, BOXTYPE, COLROW, CONTACT, CONTACT_ELEM_TYPE, data, DATATYPE, dattype, DOUBLE_TYPE, ELFLAGS, ELKEY, ENDEL, ENDEXTN, ENDLIB, ENDMASKS, ENDSTR, FLOAT_TYPE, FONTS, FORMAT, GENERATIONS, HARDFENCE, HARDWIRE, HEADER, i18n, INT_TYPE, LAYER, length, LIBDIRSIZE, LIBNAME, LIBSECUR, LINKKEYS, LINKTYPE, MAG, MASK, MAX_REC_LEN, NO_DATA_TYPE, NODE, NODE_ELEM_TYPE, NODEPORT, NODETYPE, NULL, PATH, PATH_ELEM_TYPE, PATHPORT, PATHTYPE, PLEX, PRESENTATION, PROPATTR, PROPVALUE, rectype, REFLIBS, RESERVED, SHORT_TYPE, SNAME, SOFTFENCE, SOFTWIRE, SPACER_ERROR, SPACING, SREF, SREF_ELEM_TYPE, SRFNAME, STRANS, STRCLASS, STRING, STRING_TYPE, STRNAME, STRTYPE, STYPTABLE, TAPECODE, TAPENUM, TEXT, TEXT_ELEM_TYPE, TEXTNODE, TEXTTYPE, UINTEGER, UNITS, USERCONSTRAINT, USTRING, WIDTH, XY
 
Constructor Summary
GDSUnitsRecord(double uuperdbu, double metersperdbu)
          Creates a new GDSUnitsRecord object.
GDSUnitsRecord(GDSRecord rec)
          Creates a new GDSUnitsRecord object from an existing record.
GDSUnitsRecord(short length, byte rectype, byte dattype, byte[] data)
          Creates a new GDSUnitsRecord object.
 
Method Summary
 double getMetersperdbu()
          Returns the meters per database unit.
 double getUuperdbu()
          Returns the user units per database unit.
 void setMetersperdbu(double metersperdbu)
          Sets the meters per database unit.
 void setUuperdbu(double uuperdbu)
          Sets the user units per database units.
 java.lang.String toString()
          Returns a description of the record.
 
Methods inherited from class com.ohrasys.cad.gds.GDSRecord
getData, getDattype, getLength, getRectype, toBytes, validateBitarrayRec, validateDoubleRec, validateDoubleRec, validateDoubleRec, validateFloatRec, validateFloatRec, validateFloatRec, validateIntRec, validateIntRec, validateIntRec, validateNodataRec, validateShortRec, validateShortRec, validateShortRec, validateStringRec, validateStringRec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GDSUnitsRecord

public GDSUnitsRecord(GDSRecord rec)
               throws GDSRecordException
Creates a new GDSUnitsRecord object from an existing record.

Parameters:
rec - The base record.
Throws:
GDSRecordException - If the record is not a valid UNITS record.

GDSUnitsRecord

public GDSUnitsRecord(double uuperdbu,
                      double metersperdbu)
               throws GDSRecordException
Creates a new GDSUnitsRecord object.

Parameters:
uuperdbu - The number of user units per database unit.
metersperdbu - The number of meters per database unit.
Throws:
GDSRecordException - If the record is malformed.

GDSUnitsRecord

public GDSUnitsRecord(short length,
                      byte rectype,
                      byte dattype,
                      byte[] data)
               throws GDSRecordException
Creates a new GDSUnitsRecord object.

Parameters:
length - The record length.
rectype - The record type.
dattype - The data type.
data - The record data.
Throws:
GDSRecordException - If the record is malformed.
Method Detail

getMetersperdbu

public double getMetersperdbu()
Returns the meters per database unit.

Returns:
The meters per database unit.

getUuperdbu

public double getUuperdbu()
Returns the user units per database unit.

Returns:
The user units per database unit.

setMetersperdbu

public void setMetersperdbu(double metersperdbu)
Sets the meters per database unit.

Parameters:
metersperdbu - The meters per database unit.

setUuperdbu

public void setUuperdbu(double uuperdbu)
Sets the user units per database units.

Parameters:
uuperdbu - The user units per database units.

toString

public java.lang.String toString()
Returns a description of the record.

Overrides:
toString in class GDSRecord
Returns:
A string representation of the record.