1 package com4j; 2 3 /** 4 * TODO: General purpose wrapper for COM SAFEARRAY. 5 * 6 * <p> 7 * This class is provided for rare circumstances where the Java code 8 * needs to control SAFEARRAY more precisely. 9 * 10 * <p> 11 * Users are encouraged to use plain Java arrays 12 * as much as possible. For example, the following Java method: 13 * <pre> 14 * void foo( short[] args ); 15 * </pre> 16 * would be bridged to the following COM method: 17 * <pre> 18 * HRESULT foo( [in] SAFEARRAY(short)* args ); 19 * </pre> 20 * 21 * <p> 22 * This works for the most of the cases, and is much easier to use. 23 * 24 * @author Kohsuke Kawaguchi (kk@kohsuke.org) 25 */ 26 public final class SafeArray { 27 /** 28 * Pointer to the allocated SAFEARRAY. 29 */ 30 private int ptr; 31 32 public SafeArray( Variant.Type type, Bound[] bounds ) { 33 } 34 35 /** 36 * Bound of an array index. 37 */ 38 public static final class Bound { 39 public int lbound; 40 public int ubound; 41 } 42 43 public native Object get( int... indices ); 44 public native void set( int... indices ); 45 } 46