Class UPParser

  • All Implemented Interfaces:
    UPParserConstants

    public class UPParser
    extends java.lang.Object
    implements UPParserConstants
    Update Parser for reading updates for dynamic Preference Aggregation Please note: update file syntax changed from (index, operation, amount, element) e.g. (1, WEAKEN, 2, a) to (index, operation(amount), element) e.g. (1, -2, a) where -(/+) is equal to WEAKEN(/STRENGTHEN) and 2 is the amount
    • Field Detail

      • token

        public Token token
        Current token.
      • jj_nt

        public Token jj_nt
        Next token.
    • Constructor Detail

      • UPParser

        public UPParser()
      • UPParser

        public UPParser​(java.io.InputStream stream)
        Constructor with InputStream.
      • UPParser

        public UPParser​(java.io.InputStream stream,
                        java.lang.String encoding)
        Constructor with InputStream and supplied encoding
      • UPParser

        public UPParser​(java.io.Reader stream)
        Constructor.
    • Method Detail

      • parse

        public static java.util.ArrayList<Update<java.lang.String>> parse​(java.lang.String updatefile)
                                                                   throws ParseException,
                                                                          java.io.FileNotFoundException
        Throws:
        ParseException
        java.io.FileNotFoundException
      • getUpdate

        public final java.util.ArrayList<Update<java.lang.String>> getUpdate()
                                                                      throws ParseException,
                                                                             java.io.FileNotFoundException
        Throws:
        ParseException
        java.io.FileNotFoundException
      • ReInit

        public void ReInit​(java.io.InputStream stream)
        Reinitialise.
      • ReInit

        public void ReInit​(java.io.InputStream stream,
                           java.lang.String encoding)
        Reinitialise.
      • ReInit

        public void ReInit​(java.io.Reader stream)
        Reinitialise.
      • getNextToken

        public final Token getNextToken()
        Get the next Token.
      • getToken

        public final Token getToken​(int index)
        Get the specific Token.
      • generateParseException

        public ParseException generateParseException()
        Generate ParseException.
      • enable_tracing

        public final void enable_tracing()
        Enable tracing.
      • disable_tracing

        public final void disable_tracing()
        Disable tracing.