2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org
.apache
.arrow
.vector
;
20 import org
.apache
.arrow
.memory
.BufferAllocator
;
21 import org
.apache
.arrow
.memory
.util
.ArrowBufPointer
;
22 import org
.apache
.arrow
.memory
.util
.hash
.ArrowBufHasher
;
23 import org
.apache
.arrow
.vector
.types
.pojo
.Field
;
24 import org
.apache
.arrow
.vector
.types
.pojo
.FieldType
;
25 import org
.apache
.arrow
.vector
.util
.CallBack
;
26 import org
.apache
.arrow
.vector
.util
.TransferPair
;
29 * A zero length vector of any type.
31 public final class ZeroVector
extends NullVector
{
32 public static final ZeroVector INSTANCE
= new ZeroVector();
35 * Instantiate a ZeroVector.
37 * @param name name of the vector
39 public ZeroVector(String name
) {
44 * Instantiate a ZeroVector.
46 * @param name name of the vector
47 * @param fieldType type of Field materialized by this vector.
49 public ZeroVector(String name
, FieldType fieldType
) {
50 super(name
, fieldType
);
54 * Instantiate a ZeroVector.
56 * @param field field materialized by this vector.
58 public ZeroVector(Field field
) {
67 public int getValueCount() {
72 public void setValueCount(int valueCount
) {
76 public int getNullCount() {
81 public boolean isNull(int index
) {
82 throw new IndexOutOfBoundsException();
86 public int hashCode(int index
) {
91 public int hashCode(int index
, ArrowBufHasher hasher
) {
92 return ArrowBufPointer
.NULL_HASH_CODE
;
96 public int getValueCapacity() {
101 public TransferPair
getTransferPair(BufferAllocator allocator
) {
106 public TransferPair
getTransferPair(String ref
, BufferAllocator allocator
) {
111 public TransferPair
getTransferPair(String ref
, BufferAllocator allocator
, CallBack callBack
) {
116 public TransferPair
makeTransferPair(ValueVector target
) {
120 private final TransferPair defaultPair
= new TransferPair() {
122 public void transfer() {
126 public void splitAndTransfer(int startIndex
, int length
) {
130 public ValueVector
getTo() {
131 return ZeroVector
.this;
135 public void copyValueSafe(int from
, int to
) {