Class ArcheTextRoot


  • public class ArcheTextRoot
    extends Object
    The root of an ArcheText Hierarchy. This is an object that contains other objects.
    Author:
    Matthew Tropiano
    • Constructor Detail

      • ArcheTextRoot

        public ArcheTextRoot()
        Creates a new root.
    • Method Detail

      • get

        public ArcheTextObject get​(String type)
        Gets a default object by type.
        Parameters:
        type - object type.
        Returns:
        the corresponding object, or null if no default.
      • get

        public ArcheTextObject get​(String type,
                                   String name)
        Gets an object by type and name. Empty name is default.
        Parameters:
        type - object type.
        name - object name.
        Returns:
        the corresponding object, or null if not found.
      • getTypes

        public String[] getTypes()
        Returns:
        all types that this root contains.
      • getAllByType

        public ArcheTextObject[] getAllByType​(String type)
        Returns all ArcheTextObjects of a particular type.
        Parameters:
        type - the type name.
        Returns:
        all of the relevant objects found as an array. Never null.
      • exportByType

        public <T> T[] exportByType​(String type,
                                    Class<T> outputType)
        Returns all ArcheTextObjects of a particular type exported as POJOs.
        Type Parameters:
        T - the return type.
        Parameters:
        type - the type name.
        outputType - the output class type.
        Returns:
        all of the relevant objects found as an array. Never null.
      • add

        public void add​(ArcheTextObject object)
        Adds an object.
        Parameters:
        object - the object to add.
      • remove

        public boolean remove​(ArcheTextObject object)
        Removes an ArcheText object from this root.
        Parameters:
        object - the object to remove.
        Returns:
        true if removed, false if not.