Elements of Vector

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

shubham
i made this logic, i havent compiled or checked the code so forgive any typos or syntax errors
Vector nameV=new Vector();
Vector valueV=new Vector();
Vector descV=new Vector();
int addTo=0;
for (int i=0;i<resultSet.size();i++){
if(resultSet.elementAt(i).toString().equals("NAME_FORMAT_TYPE")){
     addTo=1;
     continue;
     if(resultSet.elementAt(i).toString().equals("VALUE_FORMAT_TYPE")){
          addTo=2;
          continue;
     if(resultSet.elementAt(i).toString().equals("DESCRIPTION_FORMAT_TYPE")){
          addTo=3;
          continue;
     switch (addTo) {
     case 1:
          nameV.addElement(resultSet.elementAt(i));
          break;
     case 2:
          valueV.addElement(resultSet.elementAt(i));
          break;          
     case 3:
          descV.addElement(resultSet.elementAt(i));
          break;
Another way to do the same wud be ...
int i1=resultSet.indexOf("NAME_FORMAT_TYPE");
int i2=resultSet.indexOf("VALUE_FORMAT_TYPE");
int i3=resultSet.indexOf("DESCRIPTION_FORMAT_TYPE");
int i=0;
for(i=1;i<i2;i++)
     nameV.addElement(resultSet.elementAt(i));
for(i=i2+1;i<i3;i++)
     valueV.addElement(resultSet.elementAt(i));
for(i=i3+1;i<resultSet.size();i++)
     descV.addElement(resultSet.elementAt(i));
i hope i understood your problem correctly hope u can compile and check the outcome
best wishes & regds

Similar Messages

  • Removing element from vector

    I am trying to remove an element from a Vector and using the ff code:
    Vector abc = getVector();
    int index = 0;
    abc.removeElementAt(index);
    The element is not being removed, when i go back to check the number
    of elements in the vector, it is still the same.
    Please give me any ideas to make this work.

    Try this,
    Vector abc = getVector();
    int index = 0;
    System.out.println("Size before : "+abc.size());
    abc.remove(index);
    System.out.println("Size after : "+abc.size());
    What is the o/p?
    Sudha

  • Preserve element in vector

    I am working on a small application in which a array keeps a list of character names. This list is used a parameter creating a drop down menu in a "JComboBox".
    i my primary class (the one creating the different parts of the app) i create a Vecter that contains ManuCharacters.
    The application function is, so the user can type in some names of some characters, that will be contained in this list, and so that they can modify this list be removing "ManuCharcters" again. In a textarea they should then be able to type in a manuscript and whenever the name of the character appears, words should be added to that character. So basically be able to count words for the different characters in a manuscript.
    private Vector<ManuCharacter> charList = new Vector<ManuCharacter>();heres how the Vector is created...
    private JComboBox CharacterList;
    public somePanel(Vector<ManuCharacter> charList)
    CharacterList = new JComboBox(charList);and heres how it is send to the JCombobox.
    My question is now, is it possible to preserve the element in the vector at index 0, so that it cannot be deleted from the Vector? either by declaring it final or in some way?? The task is to make a ManuCharacter that will be at that exact element constantly, and that will get a count for words that the program cannot connect to a character.
    My best solution is to use exception handling, some if statements and stuff, but if anyone knew a trick like "finalise" or other simple solution it would make it much easier.
    If you need any more info to clarify my question, please let me know.

    One solution is to extend Vector class so that first element is unremovable/unchangable (or changable only if null/not set) etc.
    class Vec<E> extends java.util.Vector<E> {
         public E remove(int index) {
              return index!=0 ? super.remove(index) : null;
    And than use this new Vec class instead.

  • Randomising order of elements in vectors

    hi
    i have a vector containing vectors containing Doubles (nightmare, i know!). Just wondering if there's an easy way of randomising the order or the elements in the main vector.
    thanks,
    al

    This can be improved.
    public class ARandouPermutation{
    public static void main(String[] args) throws Exception{
    java.util.Vector vec = new java.util.Vector();
    for(int i=0;i<64;i++){// 64 is an example
        vec.add(new Double(i*1.0));
    Object[] tmp0 = vec.toArray();
    int originalSize = vec.size();// obtaining the original size of the Vector
    vec.clear();  // setting to size zero
    Object[] tmp1 = new Object[originalSize];
    int[] indexarr = randPermute(originalSize);// this method is defined below
    for(int j=0;j<indexarr.length;j++){
        tmp1[j] = tmp0[indexarr[j]];
    tmp0=null;
    arr=null;
    for(int j=0;j<originalSize;j++){// this can be replaced by java.util.Arrays.asList(Object[])
      vec.add(tmp1[j]);
      System.out.println(((Double)vec.get(j)).toString());//test output
    public static int[] randPermute(int L){// length L of the array returned is passed as an argument
       if(L<0) throw new IllegalArgumentException();
       int[] arr = new int[L];
       java.util.Random rand = new java.util.Random();
       for(int j=0;j<L;j++) arr[j]=j;
       int tmp, index=0;
    Label:   while(index<L){
           tmp = rand.nextInt(L);
           for(int j=0;j<index;j++) {
                if(tmp==arr[j]) continue Label;
            arr[index]=tmp;
            index++;
       return arr;
    }

  • Comparing elements in vector..

    hi ,
    how to compare elements in 2 vectors(diff size)
    pls help
    arvin

    thks for your help,
    for(int i=0;i<=v.size();i++)
    if(v.elementAt(i).equals(v2.elementAt(i))
    }when i did like this iam getting error
    arvin

  • Extraction elements from vector

       Hi everybody, 
     Can anybody help with this problem, pls  Im a begginer with labview  I would like solve a problem: There is  matrix (2048x1 elements) and I would draw it point by point in wafeform chart, I have already tried everything,  but I have  allways drawn the whole vector.
     Sorry for so stupid question......
       best regards
    thx  tomas

    Not stupid, but it is resolved.
    http://forums.ni.com/t5/LabVIEW/Graph-an-Array-but​-not-every-row-of-it/td-p/1188601
    Mahu

  • Problems with inserting elements into vectors

    Hi,
    I have a problem with the setElementAt() method for vectors.
    I want to initialise a vector that is same size as a previous vector declared in my program and insert float 0.0 in all the positions.
    The code below is a for loop to do just this where count is the size of the previous vector.
    for(int i=0;i<count; i++)
                   vLargest.setElementAt(zero,i);
              }i have declared zero as a float
    float zero = 0.0f;
    the error that i'm getting is that it that the vector cannot be applied to a float.
    Can anybody tell me what i'm doing wrong?
    Thanks

    Yes you need to store Objects in your Vector not primitives.
    float is not an Object it is a primitive. But Float is an object.

  • Add element to vector

    class Helloworld{
    public static void main(String args[]){
    B t1 = new B();
    B t2 = new B();
    B t3 = new B();
    t1.start();
    t2.start();
    t3.start();
    class A extends Thread{
         static Vector v;
         v = new Vector(0,1);
    public void packMes(int d, int[] sData, int so, int[] dData, int doa, int size){
             Message m = new Message(d, sData, so, dData, doa, size)   //Message is a data class
             addMessage(m);
         public static synchronized void addMessage(Message pm){
              v.addElement(pm);
    class B extends A{
           int[] intArray1 = {1,2,3,4};
           int[] intArray2 = {11,12,13,14};
      public void run(){      
      if (id==0) {     // let id be the name of the current thread i.e "0" means thread-0
         packMes(3, intArray1, 0, intArray2, 0, 4);
         System.out.println("I'm thread "+id+" size: " + v.capacity());
         Message test = (Message) v.elementAt(0);
    }I tried to repeat running the program several times. The capacity of the vector in thread-0 is 1 all the time. Unfortunately sometimes it says
    I'm thread 0 size: 1
    java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
    at java.util.v.elementAt(Unknown Source)
    at helloWorld.run(B.java:21)
    [i]
    Please help. Thanks in advance.

    here the exact code.
    type
    java Helloworld 4 B
    after compiled.
    The same problem still exists although it doesn't happen all the time.
    import java.io.*;
    import java.util.*;
    public class Helloworld{
         static int processor;          // total number of processors
         static String fileName;
         static int counter;          // counter for processors
    public static void main(String args[]){
           // interface with users
                    processor = Integer.parseInt(args[0]);  
                    fileName = args[1];      
         try{     
               Class c = Class.forName(fileName);                
                   Thread procs[] = new Thread[processor];             // declare an array for threads
                   for (int i=0; i<processor; i++){     
                        System.out.println(i);       // create threads           
              procs[i] = (Thread) c.newInstance();  
                   procs.start();                     
         } catch (ClassCastException ex)
              { System.out.println("The file you provided is not a thread"); }
    catch (ClassNotFoundException ex)
              { System.out.println("That class doesn't exist");  }
         catch (Exception ex)
              { System.out.println("File error!");             }
    class A extends Thread{     
         static Vector v;
         public void createVector(){
              v = new Vector(0,1);
         public void packMes(int desId, int[] sourData, int sourOffset, int[] destData, int destOffset, int size) {
                   Message m = new Message(desId, sourData, sourOffset, destData, destOffset, size);
                   addMessage(m);
         public int id(){          
              String procsName = getName();
              int procsID=Integer.parseInt(procsName.substring(7));
              return procsID;
         public static void addMessage(Message pm){
              v.addElement(pm);
    class B extends A{
         int[] intArray1 = {1,2,3,4};
         int[] intArray2 = {11,12,13,14};
         public void run(){      
              createVector();
              if (id()==0) {     
                   packMes(3, intArray1, 0, intArray2, 0, 4);
                   System.out.println("I'm thread "+id()+" size: " + v.size());
                   Message test = (Message) v.elementAt(0);           
    class Message {
         int destID;
         int size;
         public Message(int destID, long[] sourData, int sourOffset, long[] destData, int destOffset, int size) {
              this.destID = destID;
                   long[] sData = sourData;
                   int sOffset = sourOffset;
                   long[] dData = destData;
                   int dOffset = destOffset;
                   this.size = size;               
         public Message(int destID, int[] sourData, int sourOffset, int[] destData, int destOffset, int size) {
              this.destID = destID;
                   int[] sData = sourData;
                   int sOffset = sourOffset;
                   int[] dData = destData;
                   int dOffset = destOffset;
                   this.size = size;               

  • Why content of a vector element changes when new element added

    in my program, i instantiate 2 Vector objects. one is TV(temporary vector), the other one is V. they all get instances of Class vElement as elements to them(of course, casted to Object first).
    Class vElement only cantains an int n, an int[] array.
    i create a text file: input.txt
    in this text file, there are 2 rows of content:
    1 2 3 1001
    4 5 6 1002
    at the beginning when the program runs, each row of input.txt will be read into a respective instance of vElement, that is, e.g. n = 1001, array = {1, 2, 3}.
    and then the 2 instances would be casted as Objects and added to V as elements
    then TV starts to get a new vElement from some methods generats 7 8 9 1003
    after that, V will add TV's newly-got element as its 3rd element.
    what is dramatical is that, the array of V's 1st element { {1, 2, 3} 1001 } will change to be the same as its 2nd one{{4, 5, 7} 1001 } after the 3rd element added to V from TV, yet, 1001 will not change to be 1102.
    this problem has challenged and tortured me for quite some days. who can help to conquer it?
    thanks a lot more!!

    I had the same problem. I believe this is because Vector stores references of everything it is added into it. My problem was solved by creating a new array everytime I had to add an element to Vector.
    Instead of:
    My_vector.addElement(My_array)
    I did:
    String[ ] Prov_array = new String[My_array.length];
    System.arraycopy(My_array,0,Prov_array, 0,My_array.length);
    My_vector.addElement(Prov_array);
    Might not be the best solution but it solved the problem.

  • JSTL, retrieving total number of elements of a Vector

    I have a class "Customer" which has a member "orders" which is a Vector. I have an instance of this class "Customer" stored as a session attribute named "customer". In a JSP, how do i <c:set a variable to the total number of elements of Vector "orders"?

    If you have a JSP2.0 container (ie Tomcat 5) you should use JSTL1.1
    With a JSP1.2 Container (eg Tomcat 4, and practically every other mainstream container) use JSTL1.0
    The easiest way to tell which one you are using is to look at the URI for the taglib
    Note that the taglib URIs changed between JSTL1.0 and JSTL1.1
    1.0 = http://java.sun.com/jstl/core
    1.1 = http://java.sun.com/jsp/jstl/core
    Make sure you are using the right URI when importing the taglib.
    Cheers,
    evnafets

  • Comparing Vector Elements

    I am trying to compare the elements in two Vectors. The vectors may be of unequal size and are not sorted in any order. I need to determine the values of elements that exist in both Vectors and add them to a third. To do this I am starting a for loop that will take each element of the first vector and, using a second for loop that takes each element of the second Vector, compare them with an if statement. If they are equal, the value from the first Vector is added to the new Vector.
    The problem is that although I have two values in each Vector that I know are equal, nothing gets added to the new Vector.
    The code is:
    //=====================================================
    for (int j =0 ; j < v1.size();j++){ //Loop for each element in Vector v1
    for (int k = 0; k < v2.size(); k++){//Loop for each element in Vector v2
    if (v1.get(j)== v2.get(k)){
    System.out.println(v1.get(j));
    System.out.println(v2.get(k));
    vres.add(v1.get(j).toString());}//Add elements that match to Vector vres
    Any help is appreciated

    Hi,
    by using the == operator your doing a memory location comparison, which will only be true if the same instance of an object is added to v1 and v2. If two different instances of a perticular object are the same then use .equals
    For example
    Integer one = new Integer(1);
    Integer onep = new Integer(1);
    if (one == onep )
       // not the same
    if (one.equals(onep))
       // the same
    }I hope this addresses your problem,
    Carlo

  • What is vector? plz help

    what is vector?
    what does it do?
    how do i use?

    Vector is a storage class similar to an array, but it will automatically grow in size if/when you need it to.
    Use Vector when you don't know how many objects you need to store in advance.
    It's very easy to use... follow the API. The simplest approach is to add elements using Vector.add(Object) and get them with Vector.get(int index). Remember that get() always returns Object, so you'll have to cast it to the type you are expecting.

  • I need help an urgent help in vectors

    I am comparing the elements of one vector with everyother element of another vector.If a match is found I need to remove the element from the second vector and should obtain the remaining elements of the second vector.Could u please help in this!
    ie)
    Vector v1=new Vector();
    Vector v2=new Vector();
    v1.addElement("apple");
    v1.addElement("grapes");
    v1.addElement("mango");
    v1.addElement("orange");
    v1.addElement("pineapple");
    v1.addElement("banana");
    v2.addElement("cherry");
    v2.addElement("berry");
    v2.addElement("papaya");
    v2.addElement("mango")
    v2.addElement("apple");
    here in this example , if i compare the vectors (v1,v2), the elements in v2(mango and apple) are contained in v1 also.so i need to remove the elements from vector v2 which are common and need to fetch the remaining elements in the v2 vector.so the resulting v2 vector should contain only 'cherry','berry','papaya',and i need to display the content of v2 vector after the removal of similar elements .could u please help me how to do this!!!!!.

    Much easier way, use Vector.removeAll(Collection c).
    As class Vector is an instance of interface Collection, you can pass in a vector.
    i.e.
    import java.util.*;
    public class tester
         public static void main(String[] args)
              tester.refineList();
         public static void refineList()
              Vector v1=new Vector();
              Vector v2=new Vector();
              v1.addElement("apple");
              v1.addElement("grapes");
              v1.addElement("mango");
              v1.addElement("orange");
              v1.addElement("pineapple");
              v1.addElement("banana");
              v2.addElement("cherry");
              v2.addElement("berry");
              v2.addElement("papaya");
              v2.addElement("mango");
              v2.addElement("apple");
              v2.removeAll(v1);
              for(int a = 0; a < v2.size(); a++)
                   System.out.println(v2.elementAt(a).toString());
    }Hope this helps
    D

  • How to add byte[] to Vector/ArryList

    Hi
    my intention is like add the byte[] to Vector/ArryList .. and each element in byte array will be appper as vector elements.
    i mean Each byte[i] element will be as i th element in vector/ArryList
    byte [] b=myString.getBytes();
    Vector v=new Vector();
    v.add(b); // add each element of byte array to vector.....
    Wat i have to do?
    plz give me solution

    And see it my first code
    import java.io.*;
    import java.util.Scanner;
    //import herong.CipherDES;
    class Test
         private byte[] theKey;
         private byte[] theMsg;
            private StringBuffer DecMesg;
         private StringBuffer PlainMesg;     
         private StringBuffer s1;     
         private StringBuffer s2;
         public Test()
                   theKey = null;
                      theMsg = null;
         public void initialize(String str1,String str2)
                   s1=new StringBuffer(str1);
                   s2=new StringBuffer(str2);
                   while((s1.length()%8)!=0)
                             s1.append(" ");
                   if(s1.length()<s2.length())
                             while(s2.length()%8!=0)
                                       s2.append(" ");     
                   else
                             while(s2.length()<s1.length())
                                       if(s2.length()%s1.length()<8)
                                            s2.append(str2);
                                       else
                                            s2.append(" ");                              
         public String encryptDES(String str1,String str2)
                   DecMesg=new StringBuffer();
                   try
                   initialize(str1,str2);
                   for(int i=0;i<s1.length();i=i+8)
                             String Mesg=s1.substring(i,i+8);
                             String Key=s2.substring(i,i+8);
                             theMsg = Mesg.getBytes();
                             theKey = Key.getBytes();
                                 byte[][] subKeys = CipherDES.getSubkeys(theKey);
                             byte[] theCph = CipherDES.cipher(theMsg,subKeys,"encrypt");//cipherDESis a method in my class
                              String Cipher = new String(theCph);                    
                             DecMesg=DecMesg.append(Cipher);
                   catch(Exception e)
                   e.printStackTrace();
              return DecMesg.toString();
         public String decryptDES(String str1,String str2)
                   PlainMesg=new StringBuffer();
                   initialize(str1,str2);
                   try
                   for(int i=0;i<s1.length();i=i+8)
                             String Mesg=s1.substring(i,i+8);
                             String Key=s2.substring(i,i+8);
                             theMsg = Mesg.getBytes();
                             theKey = Key.getBytes();
                                 byte[][] subKeys = CipherDES.getSubkeys(theKey);
                             byte[] thePlain = CipherDES.cipher(theMsg,subKeys,"decrypt");
                              String Plain = new String(thePlain);
                             PlainMesg=PlainMesg.append(Plain);
                   catch(Exception e)
                   e.printStackTrace();
              return PlainMesg.toString();
    class kk
          public static void main(String[] a)
                    Test obj=new Test();     
              String s1="chinturao";          
              String s2="bavaanil";
              String s3="Hello  to all from krish and from idnia how r u i am fine";
              String encMesg=obj.encryptDES(s3,s1);          
              String decMesg=obj.decryptDES(encMesg,s1);
              System.out.println(decMesg);
    }wheni execute it it gives worng out put like below
    Hello  to all from krish and fro.}§&#9794;I&#9794;¶&#8805;how r u i am fineso i think its the problem with srings when Mesg are ciphers so i wish to make use if bytes.

  • Using Vector in Java script

    I got this vector class from some website for implementation of vector in java script
    function Vector(inc) {
         if (inc == 0) {
              inc = 100;
         /* Properties */
         this.data = new Array(inc);
         this.increment = inc;
         this.size = 0;
         /* Methods */
         this.getCapacity = getCapacity;
         this.getSize = getSize;
         this.isEmpty = isEmpty;
         this.getLastElement = getLastElement;
         this.getFirstElement = getFirstElement;
         this.getElementAt = getElementAt;
         this.addElement = addElement;
         this.insertElementAt = insertElementAt;
         this.removeElementAt = removeElementAt;
         this.removeAllElements = removeAllElements;
         this.indexOf = indexOf;
         this.contains = contains
         this.resize = resize;
         this.toString = toString;
         this.sort = sort;
         this.trimToSize = trimToSize;
         this.clone = clone;
         this.overwriteElementAt;
    // getCapacity() -- returns the number of elements the vector can hold
    function getCapacity() {
         return this.data.length;
    // getSize() -- returns the current size of the vector
    function getSize() {
         return this.size;
    // isEmpty() -- checks to see if the Vector has any elements
    function isEmpty() {
         return this.getSize() == 0;
    // getLastElement() -- returns the last element
    function getLastElement() {
         if (this.data[this.getSize() - 1] != null) {
              return this.data[this.getSize() - 1];
    // getFirstElement() -- returns the first element
    function getFirstElement() {
         if (this.data[0] != null) {
              return this.data[0];
    // getElementAt() -- returns an element at a specified index
    function getElementAt(i) {
         try {
              return this.data;
         catch (e) {
              return "Exception " + e + " occured when accessing " + i;     
    // addElement() -- adds a element at the end of the Vector
    function addElement(obj) {
         if(this.getSize() == this.data.length) {
              this.resize();
         this.data[this.size++] = obj;
    // insertElementAt() -- inserts an element at a given position
    function insertElementAt(obj, index) {
         try {
              if (this.size == this.capacity) {
                   this.resize();
              for (var i=this.getSize(); i > index; i--) {
                   this.data[i] = this.data[i-1];
              this.data[index] = obj;
              this.size++;
         catch (e) {
              return "Invalid index " + i;
    // removeElementAt() -- removes an element at a specific index
    function removeElementAt(index) {
         try {
              var element = this.data[index];
              for(var i=index; i<(this.getSize()-1); i++) {
                   this.data[i] = this.data[i+1];
              this.data[getSize()-1] = null;
              this.size--;
              return element;
         catch(e) {
              return "Invalid index " + index;
    // removeAllElements() -- removes all elements in the Vector
    function removeAllElements() {
         this.size = 0;
         for (var i=0; i<this.data.length; i++) {
              this.data[i] = null;
    // indexOf() -- returns the index of a searched element
    function indexOf(obj) {
         for (var i=0; i<this.getSize(); i++) {
              if (this.data[i] == obj) {
                   return i;
         return -1;
    // contains() -- returns true if the element is in the Vector, otherwise false
    function contains(obj) {
         for (var i=0; i<this.getSize(); i++) {
              if (this.data[i] == obj) {
                   return true;
         return false;
    // resize() -- increases the size of the Vector
    function resize() {
         newData = new Array(this.data.length + this.increment);
         for     (var i=0; i< this.data.length; i++) {
              newData[i] = this.data[i];
         this.data = newData;
    // trimToSize() -- trims the vector down to it's size
    function trimToSize() {
         var temp = new Array(this.getSize());
         for (var i = 0; i < this.getSize(); i++) {
              temp[i] = this.data[i];
         this.size = temp.length - 1;
         this.data = temp;
    // sort() - sorts the collection based on a field name - f
    function sort(f) {
         var i, j;
         var currentValue;
         var currentObj;
         var compareObj;
         var compareValue;
         for(i=1; i<this.getSize();i++) {
              currentObj = this.data[i];
              currentValue = currentObj[f];
              j= i-1;
              compareObj = this.data[j];
              compareValue = compareObj[f];
              while(j >=0 && compareValue > currentValue) {
                   this.data[j+1] = this.data[j];
                   j--;
                   if (j >=0) {
                        compareObj = this.data[j];
                        compareValue = compareObj[f];
              this.data[j+1] = currentObj;
    // clone() -- copies the contents of a Vector to another Vector returning the new Vector.
    function clone() {
         var newVector = new Vector(this.size);
         for (var i=0; i<this.size; i++) {
              newVector.addElement(this.data[i]);
         return newVector;
    // toString() -- returns a string rep. of the Vector
    function toString() {
         var str = "Vector Object properties:\n" +
         "Increment: " + this.increment + "\n" +
         "Size: " + this.size + "\n" +
         "Elements:\n";
         for (var i=0; i<getSize(); i++) {
              for (var prop in this.data[i]) {
                   var obj = this.data[i];
                   str += "\tObject." + prop + " = " + obj[prop] + "\n";
         return str;     
    // overwriteElementAt() - overwrites the element with an object at the specific index.
    function overwriteElementAt(obj, index) {
         this.data[index] = obj;
    Now I have written this code .This code is written using API'sfunction getOptions(ctx)
    var options="";
    var subroles = ctx.getAdminRole().getAttributeMultiValue("CUSTOM10");
    var v = new Vector(subroles);
    options = v.getElementAt(0);
    Now suppose the function getAttributeMultivalue is returning RoleA,RoleB
    Now i want RoleA to be stored in getElementAt(0) and RoleB in getElementAt(1)
    But with the above code i am getting RoleA,RoleB in getElementAt(0)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    abhishek20 wrote:
    well the question is also about Vector class of JavaNo it is not you doofus. It is about JavaScript. Your question has fuck all to do with Java.
    so I thought to post it here.That was a mistake.
    any ways if you don't know java script or anything about vector class then you should not reply.I know about JavaScript.
    I know about Vectors.
    I will not tell you anything about JavaScript here.
    I wouldn't tell you anything useful anyway because I have taken a personal dislike to you.
    >
    No need to make me understand what is the purpose of this forum.Really? Because you don't seem to get it. At all.
    next time take care before you reply.Next time engage your tiny pea brain in some sort of logical thought before posting.

Maybe you are looking for

  • Java.security.InvalidKeyException: Unsupported key type: SunPKCS11-MyPKCS11

    I am having a very strange issue with my CAC card. I wrote a small Java program to login into ProjectForge.mil webservice ICollabNetSoap m_sfSoap = (ICollabNetSoap) ClientSoapStubFactory.getSoapStub(ICollabNetSoap.class, "https://project.forge.mil/")

  • Idoc Tables for Message segments

    Dear Experts, I was find SAP table for Idoc Message Type for WPUBON for report of Sales Auditor Plz help Regards, Richa Grover

  • Setting up a portfolio page

    I'm pretty new to dreamweaver, but have been viewing tutorials and working on my new website for a couple of weeks now and have a somewhat general question. As an illustrator, I want to have a portolio section in my website that displays about 24 sam

  • ITunes burning error-4261

    in the past, burning cds has been sucessfull. but recently i have been getting an error code, 4261 and i cant burn cds please help! thanks -Kyle

  • Newline characters data( either chr(10) or chr(13))

    I have 2 columns in a table and these columns have newline characters data( either chr(10) or chr(13)). Now I need to fetch data so that all the records which have new line character( either chr(10) or chr(13) ) in any of these 2 columns should be re