Class ParameterizedArgument

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.StringBuilder generate​(java.lang.StringBuilder sb)
      Appends the current argument to the StringBuffer sb.
      java.lang.String getArgument()
      Returns current argument.
      protected abstract void initializeNbParameters​(int nbParameters)
      Initialize the number of parameters to read for this argument.
      protected void initializeNbTokens​(int nbTokens)
      Initialize the number of tokens.
      protected abstract void newParameter​(int id, int startKey, int stopKey, int startValue, int stopValue)
      Reads a new parameter.
      protected void newToken​(int id, int start, int stop)
      Adds a new token to the array of tokens.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PARAMETER_SEP

        public static final char PARAMETER_SEP
        Separator for the parameters: ';'.
        See Also:
        Constant Field Values
      • TOKEN_SEP

        public static final char TOKEN_SEP
        Separator for the tokens: '='.
        See Also:
        Constant Field Values
      • argument

        @Nullable
        protected java.lang.String argument
        Current argument.
    • Constructor Detail

      • ParameterizedArgument

        public ParameterizedArgument()
        Creates a new instance of ParameterizedArgument with the default separator character of semicolon (";").
    • Method Detail

      • generate

        public java.lang.StringBuilder generate​(java.lang.StringBuilder sb)
        Appends the current argument to the StringBuffer sb.
        Specified by:
        generate in class CharacterSeparatedList
        Parameters:
        sb - the StringBuffer to append the argument
        Returns:
        the StringBuffer with the appended argument.
      • getArgument

        @Nullable
        public java.lang.String getArgument()
        Returns current argument.
        Returns:
        current argument
      • initializeNbParameters

        protected abstract void initializeNbParameters​(int nbParameters)
        Initialize the number of parameters to read for this argument. Subclasses should override this abstract method.
        Parameters:
        nbParameters - the number of parameters
      • initializeNbTokens

        protected void initializeNbTokens​(int nbTokens)
        Initialize the number of tokens.
        Specified by:
        initializeNbTokens in class CharacterSeparatedList
        Parameters:
        nbTokens - the number of tokens this instance can handle.
      • newParameter

        protected abstract void newParameter​(int id,
                                             int startKey,
                                             int stopKey,
                                             int startValue,
                                             int stopValue)
        Reads a new parameter. A key-value pair is parsed from the current string argument. The key part will be a substring from index startKey to index stopKey. The value part will be the substring from index startValue to index stopValue.
        Parameters:
        id - id for this parameter
        startKey - the start index of searching the key substring in current argument
        stopKey - the stop index of searching the key substring in current argument
        startValue - start index of searching the value substring in current argument
        stopValue - stop index of searching the value substring in current argument
        See Also:
        ContentType.newParameter(int, int, int, int, int), QualityArgument.newParameter(int, int, int, int, int)
      • newToken

        protected void newToken​(int id,
                                int start,
                                int stop)
        Adds a new token to the array of tokens. The search will begin from the index start to the index stop.
        Specified by:
        newToken in class CharacterSeparatedList
        Parameters:
        id - the ID of the token
        start - start index of parameter search in the current string
        stop - end index of parameter search in the current string