congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JIArray
Code IndexAdd Tabnine to your IDE (free)

How to use
JIArray
in
org.jinterop.dcom.core

Best Java code snippets using org.jinterop.dcom.core.JIArray (Showing top 20 results out of 315)

origin: org.jinterop/j-interop

public void getTCharArray()
  throws JIException, InterruptedException, UnknownHostException {
  System.gc();
  JICallBuilder callObject = new JICallBuilder( true);
  callObject.setOpnum(6);
  Object results[];
  callObject.addOutParamAsObject(new JIArray(Byte.class, new int[]{50},1,false), JIFlags.FLAG_NULL);
  results = comObject.call(callObject);
  JIArray arrayOfResults = (JIArray)results[0];
  Byte[] arrayOfBytes = (Byte[]) arrayOfResults.getArrayInstance();
  int length = 50;
  for (int i = 0; i < length; i++) {
   System.out.println(arrayOfBytes[i].byteValue());
  }
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

int getSizeOfAllElementsInBytes ()
{
  //		int length = numElementsInAllDimensions * JIMarshalUnMarshalHelper.getLengthInBytes(clazz,((Object[])memberArray)[0],JIFlags.FLAG_NULL);
  //this means that decode has created this array, and we need to compute the size to stay consistent.
  if ( this.sizeOfNestedArrayInBytes == -1 )
  {
    this.sizeOfNestedArrayInBytes = computeLengthArray ( this.memberArray );
  }
  return this.sizeOfNestedArrayInBytes;
}
origin: org.kohsuke.jinterop/j-interop

if (o instanceof JIArray)
  if (((JIArray)o).isConformant() || ((JIArray)o).isVarying())
    ((JIArray)o).setConformant(false);
    maxCountTemp = ((JIArray)o).getConformantMaxCounts();
    ((JIArray)o).setMaxCountAndUpperBounds(listOfMaxCounts2.subList(j,((Integer)listOfDimensions.get(j)).intValue()));
    j++;
if (o instanceof JIArray)
  if (((JIArray)o).isConformant() || ((JIArray)o).isVarying())
    ((JIArray)o).setConformant(((JIArray)o).isConformant());
    ((JIArray)o).setMaxCountAndUpperBounds(maxCountTemp);
origin: org.jinterop/j-interop

switch(array.getDimensions())
    Object[] obj = (Object [])array.getArrayInstance();
    newArrayObj = obj;
    c = obj.getClass().getComponentType();
    Object[][] obj2 = (Object [][])array.getArrayInstance();
    int secondDim = ((Object[])subArray).length;
    int k = 0;
    newArrayObj = (Object[])Array.newInstance(subArray.getClass().getComponentType(), array.getNumElementsInAllDimensions());
    for (int i = 0; i < secondDim;i++)
array2 = new JIArray(newArrayObj,true); //should always be conformant since this is part of a safe array.
  safeArray.addMember(new Short((short)array.getDimensions()));//dim
  int elementSize = -1;
  short flags = JIVariant.FADF_HAVEVARTYPE;
  int upperBounds[] = array.getUpperBounds();
  JIStruct[] arrayOfSafeArrayBounds = new JIStruct[array.getDimensions()];
  for (int i = 0; i < array.getDimensions();i++)
  JIArray arrayOfSafeArrayBounds2 = new JIArray(arrayOfSafeArrayBounds,true);
  safeArray.addMember(new Integer(array2.getNumElementsInAllDimensions()));//size in safearrayunion
  JIPointer ptr2RealArray = new JIPointer(array2);
  safeArray.addMember(ptr2RealArray);
origin: stackoverflow.com

 access.addItem(item0, new DataCallback() {
  @Override
  public void changed(Item item0, ItemState state) {

    //where items[] is the item created using group.addItem("item"+index) in the constructor
    JIArray jiArray = items[1].read(true).getValue().getObjectAsArray(); 
    Object[] arrayObj = (Object[]) jiArray.getArrayInstance();

    // arrayObj contains the value (or values) of the item 

    for (Object v : arrayObj) {

    }
  }
});
origin: org.jinterop/j-interop

/** Helper method for creating an array of <code>VARIANT</code>s , IDL signature <code>[in, out] SAFEARRAY(VARIANT) *p</code> 
 * OR <code>[in,out] VARIANT *pArray</code>. The return value can directly be used in an <code>IJIDispatch</code> call.
 * 
 * @return
 */
public static JIVariant VARIANTARRAY()
{
  return new JIVariant(new JIArray(new JIVariant[]{JIVariant.EMPTY()}, true),true);
}
 
origin: org.kohsuke.jinterop/j-interop

if (((JIArray)member).isConformant() || ((JIArray)member).isVarying())
  listOfMaxCounts.addAll(((JIArray)member).getConformantMaxCounts());
  listOfDimensions.add(new Integer(((JIArray)member).getDimensions()));
origin: org.kohsuke.jinterop/j-interop

((JIArray)value).encode(ndr,((JIArray)value).getArrayInstance(),defferedPointers,FLAG);
origin: org.kohsuke.jinterop/j-interop

if(c.equals(JIArray.class))
  return ((JIArray)obj).decode(ndr,((JIArray)obj).getArrayClass(),((JIArray)obj).getDimensions(),defferedPointers,FLAG,additionalData);
origin: org.openscada.jinterop/org.openscada.jinterop.core

static int getLengthInBytes ( Class c, final Object obj, final int FLAG )
{
  if ( obj != null && obj.getClass ().equals ( JIArray.class ) )
  {
    return ( (JIArray)obj ).getSizeOfAllElementsInBytes ();
  }
  else
  {
    if ( ( c != IJIComObject.class || c != IJIDispatch.class ) && obj instanceof IJIComObject )
    {
      c = IJIComObject.class;
    }
    if ( (SerializerDeserializer)mapOfSerializers.get ( c ) == null )
    {
      throw new IllegalStateException ( MessageFormat.format ( JISystem.getLocalizedMessage ( JIErrorCodes.JI_UTIL_SERDESER_NOT_FOUND ), new String[] { c.toString () } ) );
    }
    return ( (SerializerDeserializer)mapOfSerializers.get ( c ) ).getLengthInBytes ( obj, FLAG );
  }
}
origin: org.kohsuke.jinterop/j-interop

/** Removes the member from the specified index. <br>
 *
 * @param index
 */
public void removeMember(int index)
{
  Object member = listOfMembers.remove(index);
  if (member instanceof JIArray)
  {
    //we need to remove it's max count values also.
    listOfMaxCounts.removeAll(((JIArray)member).getConformantMaxCounts());
  }
  else
  if (member instanceof JIStruct && ((JIStruct)member).arrayAdded)
  {
    //we need to remove it's max count values also.
    listOfMaxCounts.removeAll(((JIStruct)member).getArrayMaxCounts());
  }
  if (listOfMaxCounts.size() == 0)
  {
    arrayAdded = false;
  }
}
origin: org.jinterop/j-interop

encode(ndr,Array.get(array,i),defferedPointers,FLAG);
origin: org.kohsuke.jinterop/j-interop

switch(array.getDimensions())
    Object[] obj = (Object [])array.getArrayInstance();
    newArrayObj = obj;
    c = obj.getClass().getComponentType();
    Object[][] obj2 = (Object [][])array.getArrayInstance();
    int secondDim = ((Object[])subArray).length;
    int k = 0;
    newArrayObj = (Object[])Array.newInstance(subArray.getClass().getComponentType(), array.getNumElementsInAllDimensions());
    for (int i = 0; i < secondDim;i++)
array2 = new JIArray(newArrayObj,true); //should always be conformant since this is part of a safe array.
  safeArray.addMember(new Short((short)array.getDimensions()));//dim
  int elementSize = -1;
  short flags = JIVariant.FADF_HAVEVARTYPE;
  int upperBounds[] = array.getUpperBounds();
  JIStruct[] arrayOfSafeArrayBounds = new JIStruct[array.getDimensions()];
  for (int i = 0; i < array.getDimensions();i++)
  JIArray arrayOfSafeArrayBounds2 = new JIArray(arrayOfSafeArrayBounds,true);
  safeArray.addMember(new Integer(array2.getNumElementsInAllDimensions()));//size in safearrayunion
  JIPointer ptr2RealArray = new JIPointer(array2);
  safeArray.addMember(ptr2RealArray);
origin: org.kohsuke.jinterop/j-interop

public void UpdateMe(JIUnsignedShort size, JIArray array)
{
 append("C:\\Test\\callback_j.log", "SampleTestServerCallback::UpdateMe entered with array size=" + size + "\n");
 System.out.println("SampleTestServerCallback::UpdateMe entered with array size=" + size + "\n");
 JIStruct[] structArray = (JIStruct[]) array.getArrayInstance();
 for (int i = 0; i < size.getValue().intValue(); i++) {
  append("C:\\Test\\callback_j.log", "Member 0= " + structArray[i].getMember(0).toString() +"\n");
  System.out.println("Array elt=" + i+ ",Member 0= " + structArray[i].getMember(0).toString() + "\n");
 }
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

/**
 * Helper method for creating an array of <code>VARIANT</code>s , IDL
 * signature <code>[in, out] SAFEARRAY(VARIANT) *p</code> OR
 * <code>[in,out] VARIANT *pArray</code>. The return value can directly be
 * used in an <code>IJIDispatch</code> call.
 * 
 * @return
 */
public static JIVariant VARIANTARRAY ()
{
  return new JIVariant ( new JIArray ( new JIVariant[] { JIVariant.EMPTY () }, true ), true );
}
origin: org.jinterop/j-interop

if (((JIArray)member).isConformant() || ((JIArray)member).isVarying())
  listOfMaxCounts.addAll(((JIArray)member).getConformantMaxCounts());
  listOfDimensions.add(new Integer(((JIArray)member).getDimensions()));
origin: org.jinterop/j-interop

((JIArray)value).encode(ndr,((JIArray)value).getArrayInstance(),defferedPointers,FLAG);
origin: org.jinterop/j-interop

if(c.equals(JIArray.class))
  return ((JIArray)obj).decode(ndr,((JIArray)obj).getArrayClass(),((JIArray)obj).getDimensions(),defferedPointers,FLAG,additionalData);
origin: org.kohsuke.jinterop/j-interop

static int getLengthInBytes(Class c,Object obj, int FLAG)
{
  if(obj != null && obj.getClass().equals(JIArray.class))
  {
    return ((JIArray)obj).getSizeOfAllElementsInBytes();
  }
  else
  {
    if ((c != IJIComObject.class || c != IJIDispatch.class) && obj instanceof IJIComObject)
    {
      c = IJIComObject.class;
    }
    if (((SerializerDeserializer)mapOfSerializers.get(c)) == null)
    {
      throw new IllegalStateException(MessageFormat.format(JISystem.getLocalizedMessage(JIErrorCodes.JI_UTIL_SERDESER_NOT_FOUND),new String[]{c.toString()}));
    }
    return ((SerializerDeserializer)mapOfSerializers.get(c)).getLengthInBytes(obj,FLAG);
  }
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

/**
 * Removes the member from the specified index. <br>
 * 
 * @param index
 */
public void removeMember ( final int index )
{
  final Object member = this.listOfMembers.remove ( index );
  if ( member instanceof JIArray )
  {
    //we need to remove it's max count values also.
    this.listOfMaxCounts.removeAll ( ( (JIArray)member ).getConformantMaxCounts () );
  }
  else if ( member instanceof JIStruct && ( (JIStruct)member ).arrayAdded )
  {
    //we need to remove it's max count values also.
    this.listOfMaxCounts.removeAll ( ( (JIStruct)member ).getArrayMaxCounts () );
  }
  if ( this.listOfMaxCounts.size () == 0 )
  {
    this.arrayAdded = false;
  }
}
org.jinterop.dcom.coreJIArray

Javadoc

Represents a C++ array which can display both conformant and standard behaviors. Since this class forms a wrapper on the actual array, the developer is expected to provide complete and final arrays (of Objects) to this class. Modifying the wrapped array afterwards will have unexpected results.

Please refer to MSExcel examples for more details on how to use this class.

Note: Wrapped Arrays can be at most two dimensional in nature. Above that is not supported by the library.

Most used methods

  • getArrayInstance
    Returns the nested Array.
  • <init>
    Refer to #JIArray(Object,int[],int,boolean) for details.
  • computeLengthArray
  • decode
  • encode
  • getArrayClass
    Class of the nested Array.
  • getConformantMaxCounts
  • getDimensions
    Returns the dimensions of the Array.
  • getNumElementsInAllDimensions
  • getSizeOfAllElementsInBytes
  • getUpperBounds
    Array of integers depicting highest index for each dimension.
  • init
  • getUpperBounds,
  • init,
  • init2,
  • isConformant,
  • isVarying,
  • recurseDecode,
  • reverseArrayForDispatch,
  • setConformant,
  • setMaxCountAndUpperBounds,
  • updateClazz

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now