All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dylon.liblevenshtein.levenshtein.factory.PositionTransitionFactory Maven / Gradle / Ivy

The newest version!
// Generated by delombok at Sat Apr 30 14:43:05 PDT 2016
package com.github.dylon.liblevenshtein.levenshtein.factory;

import java.io.Serializable;
import com.github.dylon.liblevenshtein.levenshtein.IPositionTransitionFunction;
import com.github.dylon.liblevenshtein.levenshtein.MergeAndSplitPositionTransitionFunction;
import com.github.dylon.liblevenshtein.levenshtein.StandardPositionTransitionFunction;
import com.github.dylon.liblevenshtein.levenshtein.TranspositionPositionTransitionFunction;

/**
 * Builds position-transition functions for Levenshtein states.
 * @author Dylon Edwards
 * @since 2.1.0
 */
public abstract class PositionTransitionFactory implements IPositionTransitionFactory, Serializable {
  private static final long serialVersionUID = 1L;
  /**
   * Builds and recycles Levenshtein states.
   */
  protected IStateFactory stateFactory;
  /**
   * Builds and recycles Levenshtein positions.
   */
  protected IPositionFactory positionFactory;


  /**
   * Builds position-transition functions for standard, Levenshtein states.
   * @author Dylon Edwards
   * @since 2.1.0
   */
  public static class ForStandardPositions extends PositionTransitionFactory {
    private static final long serialVersionUID = 1L;

    /**
     * {@inheritDoc}
     */
    @Override
    public IPositionTransitionFunction build() {
      return new StandardPositionTransitionFunction().stateFactory(stateFactory).positionFactory(positionFactory);
    }
  }


  /**
   * Builds position-transition functions for transposition, Levenshtein states.
   * @author Dylon Edwards
   * @since 2.1.0
   */
  public static class ForTranspositionPositions extends PositionTransitionFactory {
    private static final long serialVersionUID = 1L;

    /**
     * {@inheritDoc}
     */
    @Override
    public IPositionTransitionFunction build() {
      return new TranspositionPositionTransitionFunction().stateFactory(stateFactory).positionFactory(positionFactory);
    }
  }


  /**
   * Builds position-transition functions for merge-and-split, Levenshtein states.
   * @author Dylon Edwards
   * @since 2.1.0
   */
  public static class ForMergeAndSplitPositions extends PositionTransitionFactory {
    private static final long serialVersionUID = 1L;

    /**
     * {@inheritDoc}
     */
    @Override
    public IPositionTransitionFunction build() {
      return new MergeAndSplitPositionTransitionFunction().stateFactory(stateFactory).positionFactory(positionFactory);
    }
  }

  @java.lang.SuppressWarnings("all")
  @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
  @javax.annotation.Generated("lombok")
  public PositionTransitionFactory() {
  }

  /**
   * Builds and recycles Levenshtein states.
   * @param stateFactory Builds and recycles Levenshtein states.
   * @return This {@link PositionTransitionFactory} for fluency.
   */
  @java.lang.SuppressWarnings("all")
  @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
  @javax.annotation.Generated("lombok")
  public PositionTransitionFactory stateFactory(final IStateFactory stateFactory) {
    this.stateFactory = stateFactory;
    return this;
  }

  /**
   * Builds and recycles Levenshtein positions.
   * @param positionFactory Builds and recycles Levenshtein positions.
   * @return This {@link PositionTransitionFactory} for fluency.
   */
  @java.lang.SuppressWarnings("all")
  @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
  @javax.annotation.Generated("lombok")
  public PositionTransitionFactory positionFactory(final IPositionFactory positionFactory) {
    this.positionFactory = positionFactory;
    return this;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy