Class FeatureList

  • All Implemented Interfaces:
    java.lang.Iterable<ReferenceNode>

    @Beta
    public class FeatureList
    extends java.lang.Object
    implements java.lang.Iterable<ReferenceNode>
    Encapsulates the production rule 'featureList()' int the RankingExpressionParser.
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      FeatureList​(java.io.File file)
      Creates a new feature list by reading the content of a file.
      FeatureList​(java.io.Reader reader)
      Creates a new feature list by consuming from a reader object.
      FeatureList​(java.lang.String list)
      Creates a new feature list by parsing a string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      ReferenceNode get​(int i)
      Returns the feature at the given index.
      int hashCode()  
      java.util.Iterator<ReferenceNode> iterator()  
      int size()
      Returns the number of features in this list.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • FeatureList

        public FeatureList​(java.io.Reader reader)
                    throws ParseException
        Creates a new feature list by consuming from a reader object.
        Parameters:
        reader - The reader that contains the string to parse.
        Throws:
        ParseException - Thrown if the string could not be parsed.
      • FeatureList

        public FeatureList​(java.lang.String list)
                    throws ParseException
        Creates a new feature list by parsing a string.
        Parameters:
        list - The string to parse.
        Throws:
        ParseException - Thrown if the string could not be parsed.
      • FeatureList

        public FeatureList​(java.io.File file)
                    throws ParseException,
                           java.io.FileNotFoundException
        Creates a new feature list by reading the content of a file.
        Parameters:
        file - The file whose content to parse.
        Throws:
        ParseException - Thrown if the string could not be parsed.
        java.io.FileNotFoundException - Thrown if the file specified could not be found.
    • Method Detail

      • size

        public int size()
        Returns the number of features in this list.
        Returns:
        The size.
      • get

        public ReferenceNode get​(int i)
        Returns the feature at the given index.
        Parameters:
        i - the index of the feature to return.
        Returns:
        the feature at the given index.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • iterator

        public java.util.Iterator<ReferenceNode> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<ReferenceNode>