Class FieldInfos

java.lang.Object
org.apache.lucene.index.FieldInfos
All Implemented Interfaces:
Iterable<FieldInfo>

public class FieldInfos extends Object implements Iterable<FieldInfo>
Collection of FieldInfos (accessible by number or by name).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new FieldInfos from an array of FieldInfo objects
  • Method Summary

    Modifier and Type
    Method
    Description
    fieldInfo(int fieldNumber)
    Return the fieldinfo object referenced by the fieldNumber.
    fieldInfo(String fieldName)
    Return the fieldinfo object referenced by the field name
    boolean
    Returns true if any fields have DocValues
    boolean
    Returns true if any fields have freqs
    boolean
    Returns true if any fields have norms
    boolean
    Returns true if any fields have offsets
    boolean
    Returns true if any fields have payloads
    boolean
    Returns true if any fields have positions
    boolean
    Returns true if any fields have vectors
    Returns an iterator over all the fieldinfo objects present, ordered by ascending field number
    int
    Returns the number of fields

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • FieldInfos

      public FieldInfos(FieldInfo[] infos)
      Constructs a new FieldInfos from an array of FieldInfo objects
  • Method Details

    • hasFreq

      public boolean hasFreq()
      Returns true if any fields have freqs
    • hasProx

      public boolean hasProx()
      Returns true if any fields have positions
    • hasPayloads

      public boolean hasPayloads()
      Returns true if any fields have payloads
    • hasOffsets

      public boolean hasOffsets()
      Returns true if any fields have offsets
    • hasVectors

      public boolean hasVectors()
      Returns true if any fields have vectors
    • hasNorms

      public boolean hasNorms()
      Returns true if any fields have norms
    • hasDocValues

      public boolean hasDocValues()
      Returns true if any fields have DocValues
    • size

      public int size()
      Returns the number of fields
    • iterator

      public Iterator<FieldInfo> iterator()
      Returns an iterator over all the fieldinfo objects present, ordered by ascending field number
      Specified by:
      iterator in interface Iterable<FieldInfo>
    • fieldInfo

      public FieldInfo fieldInfo(String fieldName)
      Return the fieldinfo object referenced by the field name
      Returns:
      the FieldInfo object or null when the given fieldName doesn't exist.
    • fieldInfo

      public FieldInfo fieldInfo(int fieldNumber)
      Return the fieldinfo object referenced by the fieldNumber.
      Parameters:
      fieldNumber - field's number. if this is negative, this method always returns null.
      Returns:
      the FieldInfo object or null when the given fieldNumber doesn't exist.