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

io.substrait.expression.WindowBound Maven / Gradle / Ivy

Go to download

Create a well-defined, cross-language specification for data compute operations

There is a newer version: 0.46.1
Show newest version
package io.substrait.expression;

import org.immutables.value.Value;

@Value.Enclosing
public interface WindowBound {

  interface WindowBoundVisitor {
    R visit(Preceding preceding);

    R visit(Following following);

    R visit(CurrentRow currentRow);

    R visit(Unbounded unbounded);
  }

   R accept(WindowBoundVisitor visitor);

  CurrentRow CURRENT_ROW = ImmutableWindowBound.CurrentRow.builder().build();
  Unbounded UNBOUNDED = ImmutableWindowBound.Unbounded.builder().build();

  @Value.Immutable
  abstract class Preceding implements WindowBound {
    public abstract long offset();

    public static Preceding of(long offset) {
      return ImmutableWindowBound.Preceding.builder().offset(offset).build();
    }

    @Override
    public  R accept(WindowBoundVisitor visitor) {
      return visitor.visit(this);
    }
  }

  @Value.Immutable
  abstract class Following implements WindowBound {
    public abstract long offset();

    public static Following of(long offset) {
      return ImmutableWindowBound.Following.builder().offset(offset).build();
    }

    @Override
    public  R accept(WindowBoundVisitor visitor) {
      return visitor.visit(this);
    }
  }

  @Value.Immutable
  abstract class CurrentRow implements WindowBound {
    @Override
    public  R accept(WindowBoundVisitor visitor) {
      return visitor.visit(this);
    }
  }

  @Value.Immutable
  abstract class Unbounded implements WindowBound {
    @Override
    public  R accept(WindowBoundVisitor visitor) {
      return visitor.visit(this);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy