Copy vector elements to array

if i create a vector called aList,
and it had 2 elements "peter" and "june"
and i create a new array >>String[] name = new String[5];
how to use this method
copyInto(Object[] anArray)
Copies the components of this vector into the specified array.
to copy the 2 elements in aList vector to my name[1]?

if i create a vector called aList,
and it had 2 elements "peter" and "june"
and i create a new array >>String[] name = new
String[5];
how to use this method
copyInto(Object[] anArray)
Copies the components of this vector into
ctor into the specified array.
to copy the 2 elements in aList vector to my name[1]?A confusing question: you want to put two Vector elements into one array element? Can't put ten pounds of @%^@%^@^ in a five pound bag, can you?
If you really want two Vector elements to be stored in one array element you'll have to combine them in some way. String concatenation will do.
If you mean you'd like to copy all the Vector elements into the array, you'll have to do something like this:
Vector aList = new Vector();
// add some elements to aList
int numNames = aList.size();
String [] names = new String[numNames];
for (int i = 0; i < numNames; ++i)
   names[i] = (String)aList.get(i);MOD

Similar Messages

  • If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    >my indesign file is a web file
    Pardon?
    Or do you mean that, when you created a new document, you choose Web as intent maybe?

  • Vector elements

    Hi,
    I have got an vector called resultSet which contains String objects as elements.
    eg.
    NAME_FORMAT_TYPE
    BON_PERF_REL
    CER_FIGURE
    CER_PERF
    CER_QUOTE
    CUR_PERF
    CUR_QUOTE
    VALUE_FORMAT_TYPE
    +T2PC
    T2
    +T2C
    T2
    +T4C
    T4
    T2P
    T2P
    DESCRIPTION_FORMAT_TYPE
    Format: �#.##0,00% Colored
    Format: -#.##0,00
    Format: �#.##0,00 Colored
    Format: -#.##0,00
    Format: �#.##0,0000 Colored
    Format: -#.##0,0000
    Format: -#.##0,00%
    Now I want to put all the elements after NAME_FORMAT_TYPE to be put in a Vector called name and like wise all the elements after VALUE_FORMAT_TYPE
    to be put in a vector called value and so on.
    How can I do it ?
    Thanks

    Here is a simple way. You can cycle through with an iterator or more simply by using a for loop. To avoid casting you could copy into a String Array first.
    The process
    1. create two vectors for the two sets
    2. create two booleans to turn on each set.
    3. cycle through the elements in the vector and compare each element to the dsired headers
    a. if it is the first header - turn on the first set
    b if it is the second - turn on the second set and turn off the first
    c. if it is neither, check which set is on. If the first set is on, add the element to the first set, if the second set is on, add to the second set.
    Some changes
    If you want the elements in the second set to also be added to the first, don't turn off the first when the second header is found.
    If you want the headers to be added to the sets too, then change the check in 'c.' to always go.
    For more sets, add more Vector/boolean pairs and checks like the patern above.

  • Remove element from array

    hi
    if i have an array
    eg
    int[] array = {4,2,1,2,1};
    how to i remove the index 2 from it and create a new array?
    thanks

    You can't remove the element--an array's size is fixed at creation.
    If you want a new array, create a new one that's one element smaller, then use System.arrayCopy to copy the elements you want to keep.

  • Copy NIVector to double array

    Hi,
    is there an easy way to copy data from an CNIReal64Vector to a double array?
    I tried to use the STL copy algorithm, but the tricky thing is that I have to copy the last element myself. Ugly...
    The method gets a pointer to an array : double* autoSpectrum1[]
    CNiReal64Vector niAutoSpectrum;
    MathError errorNI = CNiMath::AutoPowerSpectrum(timeDataVector, niAutoSpectrum, df, dt);
    size = niAutoSpectrum.GetSize();
    *autoSpectrum1 = new double[size];
    std::copy(&niAutoSpectrum[0], &niAutoSpectrum[size-1], &(*autoSpectrum1)[0]);
    (*autoSpectrum1)[size-1] = niAutoSpectrum[size-1];
    Any idea?
    Thanks
     Mario

    Hi Mario,
    Here your "double* autoSpectrum1[]" is a table of pointer.
    When you have, you can do is to do a "For Loop" and copy the element of the table pointed from your "autoSpectrum1" table and save it in a 2D table...
    I think that is the best way to do that...
    Regards...
    Matthieu

  • Can't download my purchased copy of Elements 12

    I purchased Photoshop Elements 12 on Dec 23, 2013. Adobe later offered an update to version 12.1.  I installed the update.
    I just bought a new computer running Windows 7, and I would like to download and install the Photoshop Elements that I had purchased.
    According to the Help in Photoshop Elements 12, I had to uninstall Photoshop Elements 12 on my old computer.  I did this.  During the uninstall a check box is supposed to appear that says something like "Deactivate product".  No such checkbox appeared during the uninstall.
    I have signed in to my account on the Adobe website several times.  It lists my purchased copy of Elements 12 but will not allow me to download it to my new computer.
    Not only will Adobe not allow phone tech support for Elements 12 owners, but they won't allow me to computer chat with support.
    Is there any way to contact Adobe support?
    How can I download and install my purchased copy of Photoshop Elements 12 onto my new computer?

    Deactivate is for PSE11 and earlier. In PSE12 you use the Help> Sign Out menu. There should be nothing to stop you downloading the software as many times as you want, maybe it is a problem with the servers. Instead of downloading from your 'My Adobe A/c' download the trial instead - it is identical.
    http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements&loc=en
    PSE12 allows you to install on as many computers as you have -  even dozens or hundreds. but only two can ever be signed in and activated at any one time.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • My husband has bought me an iMac which has no disc drive, how do I install my copy of Elements 12?

    My husband has bought me an iMac which has no disc drive, how do I install my copy of Elements 12, thanks

    Hi,
    I know nothing about Mac's at all but you should be able to download the trial version from the web then activate with your product key.
    Flano

  • PC crashed. Attempted to install NEW copy of Elements 10 that I had in reserve. Always get ERROR MESSAGE 400 when trying to open the program. Please advise how I get around this error.

    My PC crashed. I rebuilt it from scratch and tried to install my unopened copy of Elements 10. I get error message 400 when trying to open the program. Windows 8.1 64bit

    if that's a network connection error, Sign in, activation, or connection errors | CC, CS6, CS5.5

  • Trying to register my copy of Elements 13, the program won't let me enter the code.

    I purchased a copy of Elements 13 from amazon.ca and, when I try to activate the program, I get to the place where I'm to enter the code but the page won't let me enter the code.
    The code includes letters and numbers but the page only allows me to enter the numbers.
    What do I do?

    I dug all over the surfaces I could find and nothing... finally, I decided to cut the tapes at the bottom of the retail box... just a 'what the heck... this is stupid' kind of move and................. there it was on the bottom/hold the discs in place rectangle thing...
    Whoever thought of something like that?

  • Merging elements of array

    Hi,
    I am new to programming.
    I have a sensor that sends a data stream through a serial port. I have collect all that data in a 1D unsigned byte array. Now, lets say my 1-D array is [12][45][65][12]...... where each "[ ]"  is a element of the array. Now to make sense of this data what i need to do is merge two elements the array and multipy it by 2/(2^15). i.e. My converted data should by [1245]*2/(2^15). Basically 2 bytes together makes sense. I can do a simple add of each element. Also the other problem is,data from the sensor is a stored as the 1-D array  of unsigned byte. However, the converted data is supposed to be signed 16-bit integer.
    Please give any suggestions on how to go about doing this.
    Siddhant Shah

    Another option is "decimate&Join". (Here it is easy to change the byte order if needed).
    Message Edited by altenbach on 12-15-2008 06:28 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    8bitTo16BitByteOrder.png ‏5 KB

  • How to save jpeg as a copy in Elements 13

    Used to be able to save a Jpeg as a copy in Elements 9, but in 13 the tick box is inactive?

    Which operating system are you using?
    If you flatten the image (Layer>Flatten) before doing File>Save As>Jpeg, then checking Save as Copy can be checked and that should add copy to the file name.
    You can undo the Flatten after saving if you want to continue to work on the image.

  • The prefix mx for element mx:Array is not bound

    Hi All
    I have a component:
    <?xml version="1.0" encoding="utf-8"?>
      <mx:Array id="arr">
        <mx:Object label="Flex"
          thumbnailImage="http:/someURL"
          fullImage="http://someURL" />
      </mx:Array>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
    </mx:Canvas>
    This gives me an error
    The prefix "mx" for element "mx:Array" is not bound
    I need a root element here, but I cannot use mx:Canvas, what would be the best choice?
    cheers
    Luca

    Hi Luca,
    Try to put the Array inside your canvas rather than outside ...
    <?xml version="1.0" encoding="utf-8"?
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Array id="arr">
        <mx:Object label="Flex"
          thumbnailImage="http:/someURL"
          fullImage="http://someURL" />
      </mx:Array>
    </mx:Canvas>
    Why  you dont want to use mx:Canvas as root tag of your component.. ?? However which ever component you use try to put the <mx:Array/> inside your root tag of your component, otherwise you will be thrown the same error as mentioned. The error occurs as the the compiler doesn't recognize the namespace mx for the array since you declared it outside the root tag of your component.
    Thanks,
    Bhasker

  • How copy part of the array buffer from ColorFrame

    I want copy part of the color frame When I receive it.
    Is there way to do that without copy all the byte array first? (+ example)
    (Question similar to Kinect 1,
    but for kinect 2)

    if you access the raw data you can set offsets based not he width/height of the color frame(y*width+x). The c++ and managed api provide that as a function of the frame. These api's are used in some of the samples so review the code if you are
    unsure of the api use:
    c++ AccessRawUnderlyingBuffer
    https://msdn.microsoft.com/en-us/library/microsoft.kinect.kinect.icolorframe.accessrawunderlyingbuffer.aspx
    .Net c# - LockRawImageBuffer
    https://msdn.microsoft.com/en-us/library/windowspreview.kinect.colorframe.lockrawimagebuffer.aspx
    Carmine Sirignano - MSFT

  • Copying/Duplicating elements is very slow in Edge Reflow

    Hi,
    When copying/duplicating elements in Edge Reflow that have quite a few nested areas it becomes very slow (sometimes taking 5-10 minutes!) I've tried it on a few machines in case it was a hardware issue but it seems sluggish on everything I try. Does anyone else have this issue and is it a software bug?
    Cheers,
    Rob.

    Hi Vic,
    Thanks for your response.
    Copying and pasting a single div is fine but as soon as there are multiple nested divs it rapidly becomes very slow to copy and paste (especially if there is quite a lot on the page). Quite often we are finding that we are having to force quit Reflow because it just hangs for 10 minutes or more. Areas such as headers that are quite complex and have a lot of nested divs we are therefore forced to manually copy bit by bit.
    Many thanks,
    Rob.

  • My copy of elements 12 has camera raw version 8.0 and I need 8.1 to open my camera's files.  What can I do?

    My copy of elements 12 has version 8.0 of camera raw and I need version 8.1 in order to open my camera's files.  What can I do?

    I think there were two shipped versions of PSE12, one with ACR8.0 and the other with ACR8.1 - possibly country specific.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

Maybe you are looking for