/* * Copyright 2014-2015 the original author or authors * * Licensed under the Apache License, Version 2.0 (the “License”); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an “AS IS” BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.wplatform.ddal.result; import com.wplatform.ddal.value.Value; /** * The interface for rows stored in a table, and for partial rows stored in the * index. */ public interface SearchRow { /** * An empty array of SearchRow objects. */ SearchRow[] EMPTY_ARRAY = {}; /** * Get the column count. * * @return the column count */ int getColumnCount(); /** * Get the value for the column * * @param index the column number (starting with 0) * @return the value */ Value getValue(int index); /** * Set the value for given column * * @param index the column number (starting with 0) * @param v the new value */ void setValue(int index, Value v); /** * Set the position and version to match another row. * * @param old the other row. */ void setKeyAndVersion(SearchRow old); /** * Get the version of the row. * * @return the version */ int getVersion(); /** * Get the unique key of the row. * * @return the key */ long getKey(); /** * Set the unique key of the row. * * @param key the key */ void setKey(long key); /** * Get the estimated memory used for this row, in bytes. * * @return the memory */ int getMemory(); }