forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-35480: [MATLAB] Add abstract MATLAB base class called `arrow…
….array.Array` (apache#35491) ### Rationale for this change It will be helpful for sharing the implementation of common functionality if there is an abstract base class from which the MATLAB `arrow.array.[Type]Array` classes can inherit. ### What changes are included in this PR? 1. Added abstract base class `arrow.array.Array` 2. Changed `arrow.array.Float64Array` to inherit from `arrow.array.Array` 3. Added `Length` property on `arrow.array.Array` ### Are these changes tested? 1. Added a test point for the `Length` property in `tFloat64Array.m`. 2. Qualified locally on macOS and linux. ### Are there any user-facing changes? Yes, there is now a `Length` property on `arrow.array.Float64Array` ### Future Directions We will continue to build out the concrete Array subclasses. * Closes: apache#35480 Lead-authored-by: Sarah Gilmore <sgilmore@mathworks.com> Co-authored-by: Kevin Gurney <kgurney@mathworks.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
- Loading branch information
Showing
5 changed files
with
79 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
classdef (Abstract) Array < matlab.mixin.CustomDisplay & ... | ||
matlab.mixin.Scalar | ||
% arrow.array.Array | ||
|
||
% Licensed to the Apache Software Foundation (ASF) under one or more | ||
% contributor license agreements. See the NOTICE file distributed with | ||
% this work for additional information regarding copyright ownership. | ||
% The ASF licenses this file to you 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. | ||
|
||
|
||
properties (Access=protected) | ||
Proxy | ||
end | ||
|
||
properties (Dependent) | ||
Length | ||
end | ||
|
||
methods | ||
function obj = Array(varargin) | ||
obj.Proxy = libmexclass.proxy.Proxy(varargin{:}); | ||
end | ||
|
||
function numElements = get.Length(obj) | ||
numElements = obj.Proxy.Length(); | ||
end | ||
end | ||
|
||
methods (Access = private) | ||
function str = ToString(obj) | ||
str = obj.Proxy.ToString(); | ||
end | ||
end | ||
|
||
methods (Access=protected) | ||
function displayScalarObject(obj) | ||
disp(obj.ToString()); | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters