// Generated by tmpl
// https://github.com/benbjohnson/tmpl
//
// DO NOT EDIT!
// Source: repeat.gen.go.tmpl

package array

import (
	"github.com/apache/arrow/go/arrow/memory"
)

func IntRepeat(v int64, isNull bool, n int, mem memory.Allocator) *Int {
	b := NewIntBuilder(mem)
	b.Resize(n)
	if isNull {
		for i := 0; i < n; i++ {
			b.AppendNull()
		}
	} else {
		for i := 0; i < n; i++ {
			b.Append(v)
		}
	}
	return b.NewIntArray()
}

func UintRepeat(v uint64, isNull bool, n int, mem memory.Allocator) *Uint {
	b := NewUintBuilder(mem)
	b.Resize(n)
	if isNull {
		for i := 0; i < n; i++ {
			b.AppendNull()
		}
	} else {
		for i := 0; i < n; i++ {
			b.Append(v)
		}
	}
	return b.NewUintArray()
}

func FloatRepeat(v float64, isNull bool, n int, mem memory.Allocator) *Float {
	b := NewFloatBuilder(mem)
	b.Resize(n)
	if isNull {
		for i := 0; i < n; i++ {
			b.AppendNull()
		}
	} else {
		for i := 0; i < n; i++ {
			b.Append(v)
		}
	}
	return b.NewFloatArray()
}

func BooleanRepeat(v bool, isNull bool, n int, mem memory.Allocator) *Boolean {
	b := NewBooleanBuilder(mem)
	b.Resize(n)
	if isNull {
		for i := 0; i < n; i++ {
			b.AppendNull()
		}
	} else {
		for i := 0; i < n; i++ {
			b.Append(v)
		}
	}
	return b.NewBooleanArray()
}
