Class NexusFile


  • public class NexusFile
    extends Object
    Represents Nexus files.
    Since:
    1.6
    Author:
    Richard Holland, Tobias Thierer, Jim Balhoff
    • Method Detail

      • addObject

        public void addObject​(NexusObject object)
        Appends an object to the end of the file.
        Parameters:
        object - the NexusObject to append.
      • insertObject

        public void insertObject​(NexusObject object,
                                 int pos)
        Inserts an object at the given position.
        Parameters:
        object - the NexusObject to insert.
        pos - the position (0-indexed) to add it at.
      • removeObject

        public void removeObject​(NexusObject object)
        Removes an object from the file.
        Parameters:
        object - the NexusObject to remove.
      • containsObject

        public boolean containsObject​(NexusObject object)
        Checks to see if we contain an object.
        Parameters:
        object - the NexusObject to check.
        Returns:
        true if we contain it.
      • objectIterator

        public Iterator objectIterator()
        Iterate over all objects in the file in order.
        Returns:
        an iterator of NexusObjects.
      • commentIterator

        public Iterator commentIterator()
        Iterate over all comments in the file in order.
        Returns:
        an iterator of NexusComments.
      • blockIterator

        public Iterator blockIterator()
        Iterate over all blocks in the file in order.
        Returns:
        an iterator of NexusBlocks.