Class TokenEffigy

    • Constructor Detail

      • TokenEffigy

        public TokenEffigy​(Workspace workspace)
        Create a new effigy in the specified workspace with an empty string for its name.
        Parameters:
        workspace - The workspace for this effigy.
    • Method Detail

      • append

        public void append​(Token token)
                    throws IllegalActionException
        Append the specified token to the token array associated with this effigy.
        Parameters:
        token - The token to append.
        Throws:
        IllegalActionException - If the token is not acceptable.
      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        If the argument is the uri parameter, then read the specified URL and parse the data contained in it.
        Overrides:
        attributeChanged in class Effigy
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the URL cannot be read or if the data is malformed.
      • clear

        public void clear()
        Clear the token array associated with this effigy.
      • getTokens

        public java.util.ArrayList getTokens()
        Return an array of the tokens in the file.
        Returns:
        An array of tokens in the file.
        See Also:
        setTokens(List)
      • read

        public void read​(java.net.URL input)
                  throws java.io.IOException
        Read the specified URL and parse the data.
        Parameters:
        input - The URL to read.
        Throws:
        java.io.IOException - If an error occurs while reading the URL or parsing the data.
      • writeFile

        public void writeFile​(java.io.File file)
                       throws java.io.IOException
        Write the current data of this effigy to the specified file. This is done by producing one line per token using its toString() method.
        Overrides:
        writeFile in class Effigy
        Parameters:
        file - The file to write to, or null to write to standard out.
        Throws:
        java.io.IOException - If the write fails.