Class Part


  • public class Part
    extends java.lang.Object
    The Part class encapsulates the entire IGES file.

    Modified by: Joseph A. Huwaldt

    Version:
    September 13, 2016
    Author:
    JDN, CHP 7/31/98; 406-592 to 406-38 per IGES 6.0, Version 1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String dir
      Directory of base file.
    • Constructor Summary

      Constructors 
      Constructor Description
      Part()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Entity> getEntities()
      Return list of entities.
      Entity getEntity​(int de)
      Return entity with specified DE number
      int getEntityCount()
      Return the entity count.
      java.lang.String getEntityHeader​(int i)
      Return a specific entity's header for the Entity List window.
      java.util.List<java.lang.String> getErrors()
      Get the list of error strings built up after checking the entities.
      GlobalSection getGlobalSection()
      Return the Global Section object.
      StartSection getStartSection()
      Return the Start Section object.
      void read​(java.io.RandomAccessFile in)
      Read in Part from input IGES file.
      java.lang.String toString()
      Return info on the whole part as a String.
      java.lang.String toString​(int i)
      Return a specific entity as a String.
      void write​(java.io.PrintWriter writer)
      Write this Part to an IGES file.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • dir

        public java.lang.String dir
        Directory of base file. Used for images and URL's.
    • Constructor Detail

      • Part

        public Part()
        Default constructor. This instantiates all of the sub-sections in the IGES file.
    • Method Detail

      • read

        public void read​(java.io.RandomAccessFile in)
                  throws java.io.IOException
        Read in Part from input IGES file. Reads in Directory Entries first, then Parameter Data, and then the list of entities is checked for correctness. To allow Parameter Data entries to not be in the same order as the Directory Entries, after the DE's are read in, the entity list is sorted by PD numbers. Then the Parameter Data is read in, and then the entity list is sorted by DE numbers again.
        Parameters:
        in - input file
        Throws:
        java.io.IOException - if there is any problem reading the IGES file.
      • write

        public void write​(java.io.PrintWriter writer)
                   throws java.io.IOException
        Write this Part to an IGES file.
        Parameters:
        writer - The PrintWriter to write the Part to.
        Throws:
        java.io.IOException - if there is any problem writing the section.
      • getErrors

        public java.util.List<java.lang.String> getErrors()
        Get the list of error strings built up after checking the entities.
        Returns:
        list of error strings
      • getEntityCount

        public int getEntityCount()
        Return the entity count.
        Returns:
        number of entities in part
      • getEntities

        public java.util.List<EntitygetEntities()
        Return list of entities.
        Returns:
        list of all entities in part
      • getEntity

        public Entity getEntity​(int de)
        Return entity with specified DE number
        Parameters:
        de - DE number of entity to be returned
        Returns:
        entity with specified DE number
      • getEntityHeader

        public java.lang.String getEntityHeader​(int i)
        Return a specific entity's header for the Entity List window.
        Parameters:
        i - index of entity in list (not DE number)
        Returns:
        String to be placed in Entity List window
      • toString

        public java.lang.String toString​(int i)
        Return a specific entity as a String. This is the Directory Entry and Parameter Data for the requested index.
        Parameters:
        i - index of entity in list (not DE number)
        Returns:
        string with entity's information
      • toString

        public java.lang.String toString()
        Return info on the whole part as a String. This includes the number of entities.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string containing info on whole part