Class FeatureList

java.lang.Object
com.yahoo.searchlib.rankingexpression.FeatureList
All Implemented Interfaces:
Iterable<ReferenceNode>

public class FeatureList extends Object implements Iterable<ReferenceNode>
Encapsulates the production rule 'featureList()' in the RankingExpressionParser.
Author:
Simon Thoresen Hult
  • Constructor Details

    • FeatureList

      public FeatureList(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(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(File file) throws ParseException, 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.
      FileNotFoundException - Thrown if the file specified could not be found.
  • Method Details

    • 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 Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

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

      public Iterator<ReferenceNode> iterator()
      Specified by:
      iterator in interface Iterable<ReferenceNode>