Array of strings to vector

Hi,
I have an array of strings like:
private String myStrArr[];
myStrArr = new String[256];
I have to get rid of hard coded size.
Is it ok to use vector instead , or is there another way to get rid of hard coded size.
If we can use vector instead , is there a solution similar for booleans??
I also have an array of booleans:
private boolean myBoolArr[];
myBoolArr = new boolean[256]

You can wrap the primitive booleans you have in the Boolean class via
myList.add(new Boolean(primitiveBooleanValue));Even better, to save space, use the already existing Boolean values instead of creating new ones. If you are using Java 1.4, you can:
myList.add(Boolean.valueOf(primitiveBooleanValue));Otherwise you can do one of these:
myList.add( primitiveBooleanValue ? Boolean.TRUE : Boolean.FALSE );

Similar Messages

  • Problem in converting vector to array of strings

    hi
    i am having a vector which in turn contains hashtable as elements
    Vector v=new Vector()
    Hashtable ht=new Hashtable();
    v.add(ht.add("key1",value1))
    v.add(ht.add("key2",value2))
    v.add(ht.add("key3",value3))
    v.add(ht.add("key4",value4))now i am trying to conver this vector in to a array of string like
    String[] str=(String[])v.toArray(new String[v.size()]);but i am getting java.lang.ArrayStoreExceptioncan anybody help me plz
    Thanks

    Hi,
    The api for public Object[] toArray(Object[] a) says
    Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array.
    ArrayStoreException will be thrown if the runtime type of a is not a supertype of the runtime type of every element in this Vector.
    The runtime type of the elements of the vector is Hashtable.
    Because String is not a supertype of Hashtable the ArrayStoreException is thrown.

  • Cast Object Array to String Array.

    When I try to cast an object array to string array an exception is thrown. How do I go about doing it?
    Vector temp = new Vector();
    Object[] array = temp.toArray();
    String[] nonterms;                              
    nonterms = (String[])array;
    Thanks,
    Ally

    Try this
    import java.util.Vector;
    public class Test
         public static void main(String args[]) throws Exception
              Vector v = new Vector();
              v.add("a");
              v.add("b");
              v.add("c");
              Object[] terms = v.toArray();
              for(int i = 0; i < terms.length; i++)
                   System.out.println((String)terms);
    Raghu

  • Array of String. Can some one please respond?

    In Java,Strings are considered as objects of type String.Even String constants are considered
    as String objects.Right?
    So if I define an array of string as:
    public class ArrayString
    public static void main(String args[])
    String str[] = {"one", "two", "three"};
    Isn't this the same as saying that we are defining an array of objects , as strings are basically
    objects.
    So why this diffirentiation between array of Strings and array of objects?
    Please can any one respond.

    A String is an Object. It extends from java.lang.Object.
    What is the difference between an array of Strings and an array of Objects? If you declare an array
    Object[] myObjectArray = {"Hello", "World"};
    and an array
    String[] myStringArray = {"Hello", "World");
    the main difference is that you can stick any object into the first array and it would be legal. An attempt to put anything but a String into the second would result in an error.
    So why not use ONLY object arrays, you ask? Well if you had a method that got passed an array of objects, how would you know what you have? You wouldn't know what methods you could call, what variables were stored. However, if you received a Vector[], you'd know you could call methods included in the Vector class.

  • Array of String Arrays

    How do I make an array of String Arrays, not knowing how big the array will be
    or how big any of the arrays it contains will be at the time I create it?

    The size of an array is not dynamic, i.e. if you use an array, you must know its size at the time you create it.
    Use one of the collection classes (like java.util.Vector or one of the implementation classes of java.util.List).
    regards
    Jesper

  • How to cast an array object to array of string

    * Can someone please tell me why SECTION 3 causes a cast
    * exception?
    * What I am really trying to do is put Strings into a vector and
    * return them as an array of String with a line like:
    *     return (String[])myVector.toArray();
    * How to do this?
    * Thank You!
    public class CastArrayTest
         public static void main(String args[]){
              //SECTION 1: This works
              String[] fruits = {"apple", "banana"};
              Object[] objs = (Object[])fruits;
              String[] foods = (String[])objs;
              for (int i = 0 ; i < foods.length ; i++){
                   System.out.println(foods);
              //SECTION 2: this works too
              Object anObj = new Object();
              String aString = "ok";
              anObj = aString;
              String anotherString = (String)anObj;
              System.out.println("word for single obj is " + anotherString);
              //SECTION 3: this causes cast exception at line
              // String[] strings = (String[])stuff
              Object[] stuff = new Object[2];
              String a = "try";
              String b = "this";
              stuff[0] = a;
              stuff[1] = b;
              String[] strings = (String[])stuff;
              for (int x = 0 ; x < strings.length ; x++){
                   String s = strings[x];
                   System.out.println("the string is " + strings[x]);

    I understand all replies so far, but from my
    understanding, objects are passed by reference No, they're not. Rather, object references are passed by value.
    Object obj = new Object();
    String a = "pass me by reference";
    Object anotherObj = (Object)a; // this explicit cast is not necessary
    String anotherString = (String)anotherObj; // this cast works because the object in question is a String
    There's no passing in that code, so I'm not sure where that even came from. However, that works because it's all legal casting.
    works as I think it should, and does, and futhermore
    String[] cast to Obj[] cast to String[] works also...Because the object you're casting actually is a String[].
    so why not if Obj[] to String[] Because String[] is not a subclass of Object[]. That's just how the language is specified.
    futhermore if they are
    all string...Again, this has no bearing on the type of the array object.
    I saw hot to cast array to String[] and wondered if
    this is real cast or calls the toString method...It's a real cast.
    but most importantly, does this mean if I have a
    vector of Strings and want to get them as an array of
    strings, I have to loop through the Obj[] (or vector)
    and cast each to (String)...just to get them as an
    array of String[]....No, zparticle's code can do that.

  • Get numerical values from 2D array of string

    Hello! 
    I start by saying that I have a base knowledge of LabView. I'm using LabView 2011. I'm doing some communications test via Can-Bus protocol. As you can see in pictures of the block diagram and of the front panel that I've attached I'm using "Transmit Receive same Port" LabView example. It works very good but I would need to insert the 8 data bytes that I receive from the server in 8 different numerical variables so that I could use them to make some operations. How can I get numerical values from the 2D array of string that I attached? 
    Every example that you can provide is important! 
    Thank you very much! 
    Attachments:
    1.jpg ‏69 KB
    2.jpg ‏149 KB

    Hi martiflix,
    ehm: to unbundle data from a cluster I would use the function Unbundle(ByName)…
    When you are new to LabVIEW you should take all the FREE online resources offered by NI on their website!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How do I write an array of strings to a single Excel row?

    I'd like to write test data, as an array of strings, to an Excel file. Attached is my attempt to modify one of the Labview 6.1 example files. This modified example will write the data to the correct row, which is determined by serial # of the UUT, but to a new sheet for each unit. I'd like to do the same thing, but to just one sheet. This sheet's data would then be saved after 50 rows of collected test data.
    Thank you in advance,
    Tim Denson
    Attachments:
    Write Table To XL.vi ‏58 KB

    Sorry I didn't get back to faster on this. I've been out of town working and just really haven't had time.
    Yes,
    The Report Generation toolkit would make this very easy. If you have it, I'd suggest using it.
    The image shown below shows the five VIs from the toolkit that I've used to write to Excel.
    What this loop does is receive a string through a Queue, either open a
    template or open todays file, convert the tab delimited string to an
    array, write the array to the next line of the Excel file, Save (with
    todays date stamp if opened from the tempate) and close it. It's a good
    idea to always save and close teh file after each write if it's not
    being continuously written to. In this case, a new line will be written
    only once a minute or so. This lessens the chance of losing data if the
    machine locks up for some reason. Opening and closing does take time
    and can slow down a loop that needs to run at a certain rate. This loop
    actually runs in a background process and several other processes send
    data to it through the queue to be written. The queue can buffer
    several data streams if needed so you won't lose data if it's busy and
    you don't have to worry about two processes accessing the Excel sheet
    at the same time.
    Ed
    Message Edited by Ed Dickens on 02-18-2006 11:12 AM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    RGTK Array to Excel.gif ‏14 KB

  • I need to sort an array of strings based on the number in each string.

    Basically, I have a directory of files that all have the same name but each with a different number on the end.
    example: image 1.jpg, image 2.jpg, etc.
    When I use the List Directory function that returns an array of strings containing the file names in the directory, they don't come out in a 1, 2, 3, order like they appear in the directory. It sorts them character by character so that they come out like: 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22 etc.
    Is there a simple way of sorting this array of strings with the file names (as above) so that they are in numerical order?

    It's a while since this thread was started, but I am sure others will have use for this so here goes:
    The in-built array sort function sorts the strings the same way DOS and Windows do. Microsoft has fixed this in the Explorer that comes with XP, however the rest of the OS(s) still sorts the old way.
    The attached "AlphaLogical String Array Sort" VIs will sort strings arrays the same way as the new XP Explorer. There are three different implementations of the sorting, one based on the Insertion sort algorithm, a Quick Sort based on recursive calls (the most elegant way, but unfortunately LabVIEW has too much overhead when doing recursive calls so this is actually a very slow alternative) and finally the fastest; a stack based Quick Sort. There is also a test VI that will show you how the different implementations perform.
    I had not used recursive calls in LV much until I made the attached quick sort and was a bit disappointed by the fact that it is so slow, but it's a good learning example...The ability to do recursive calls this way was introduced in LV7 I believe...There is an example here on the zone that shows how you can calulate a factorial by using recursive calls, however - unlike for the quick sort (normally) - recursive calls are actually not the optimal solution for that calculation.
    Message Edited by Mads on 09-13-2005 02:30 AM
    MTO
    Attachments:
    AlphaLogical Sorting.zip ‏142 KB

  • [CS3][JS] How to turn negative number in array into string

    Hello,
    I have a script that compares the array of the geometric bounds of all text frames to the margins for a document (all pages having the same margins). Any frames that do not match the margins are flagged.
    In order to compare the array of text frame geometric bounds to two arrays of margins (because they are facing pages), I have to convert the numbers to strings.
    My problem is that in the following snippet of code that creates the two margin arrays, the negative of the variables become numbers again. This would not be too difficult to solve except that all the numbers have to be 4 decimal points before converted to strings.
    Thanks,
    Tom
    var myDoc = app.activeDocument;
    var marginY1 = myDoc.pages.item(0).marginPreferences.top.toFixed(4);
    var marginX1 = myDoc.pages.item(0).marginPreferences.left.toFixed(4);
    var marginY2 = (myDoc.documentPreferences.pageHeight - myDoc.pages.item(0).marginPreferences.bottom).toFixed(4);
    var marginX2 = (myDoc.documentPreferences.pageWidth - myDoc.pages.item(0).marginPreferences.right).toFixed(4);
    var marginsRHand = [marginY1, marginX1, marginY2, marginX2];
    var marginsLHand = [marginY1, -marginX2, marginY2, -marginX1];

    Well, I think I have solved it. But I don't know why this solves it.
    I would think that in the above script all the variables would be numbers and not strings. But the data browser says they are strings.
    The solution is:
    var marginsLHand = [marginY1, Number(-marginX2).toFixed(4), marginY2, Number(-marginX1).toFixed(4)]
    If someone can explain why now all variables in the arrays are strings and not numbers, I'll be happy.
    Tom

  • Mapping lookup up failure with input JavaBean with an array of strings

    To receive input data our Web service defines a JavaBean one element of which is
    an array of strings. When a test Java client calls the service method the call
    is completed successfully. When a Perl client calls the service method an exception
    is returned. If I understand BEA's Web service documentation, it isn't necessary
    to do development for the service specifically to enable correct processing of
    an array of strings.
    In our environment we are running WL 8.1 SP 1.
    Please review the problem documentation and explain to me the cause of the exception
    and what I must do to prevent it.
    Thank you.
    The exception:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: weblogic.xml.schema.binding.DeserializationException: mapping
    lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema context=TypedSchemaContext{javaType=java.lang.String}
    (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>weblogic.xml.schema.binding.DeserializationException:
    mapping lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema
    context=TypedSchemaContext{javaType=java.lang.String}
         at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeUtils.java:461)
         at weblogic.xml.schema.binding.SoapArrayCodecBase.getComponentDeserializer(SoapArrayCodecBase.java:574)
         at weblogic.xml.schema.binding.SoapArrayCodecBase.deserialize(SoapArrayCodecBase.java:285)
         at weblogic.xml.schema.binding.BeanCodecBase.processElement(BeanCodecBase.java:183)
         at weblogic.xml.schema.binding.BeanCodecBase.processAllElements(BeanCodecBase.java:165)
         at weblogic.xml.schema.binding.BeanCodecBase.processElements(BeanCodecBase.java:145)
         at weblogic.xml.schema.binding.BeanCodecBase.deserialize(BeanCodecBase.java:108)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328)
         at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:384)
         at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:458)
         at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:78)
         at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
         at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:518)
         [more]
    The XML generated for the Perl client:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:namesp2="http://namespaces.soaplite.com/perl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:getWorkOrdersByFilters
    xmlns:namesp1="ncr.com"><gIMServiceRequest xsi:type="ns:GIMServiceRequest" xmlns:ns="java:com.ncr.gim.bean.service"><applicationID
    xsi:type="xsd:string">REVLOG</applicationID><nodeId xsi:type="xsd:string">00XH</nodeId><stopCodes
    xsi:type="namesp2:array" SOAP-ENC:arrayType="xsd:string[2]"><xsd:string xsi:type="xsd:string">06</xsd:string><xsd:string
    xsi:type="xsd:string">16</xsd:string></stopCodes></gIMServiceRequest></namesp1:getWorkOrdersByFilters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The XML generated for a test Java client:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getWorkOrdersByFilters
    xmlns:m="ncr.com"><gIMServiceRequest xmlns:n1="java:com.ncr.gim.bean.service"
    xsi:type="n1:GIMServiceRequest"><CSRCode xsi:type="xsd:string">987x00</CSRCode><applicationID
    xsi:type="xsd:string">GIM</applicationID><incidentNbr xsi:nil="true"/><nodeId
    xsi:type="xsd:string">00T5</nodeId><stopCodes soapenc:arrayType="xsd:string[3]"><xsd:string
    xsi:type="xsd:string">00</xsd:string><xsd:string xsi:type="xsd:string">01</xsd:string><xsd:string
    xsi:type="xsd:string">02</xsd:string></stopCodes></gIMServiceRequest></m:getWorkOrdersByFilters></env:Body></env:Envelope>
    The JavaBean:
    public class GIMServiceRequest implements Serializable {
         private String applicationID = GIMConstants.UNKNOWN_APPLICATION_ID;
         private String nodeId = null;
         private String incidentNbr = null;
         private String CSRCode = null;
         private String[] stopCodes = null;
         public void setStopCodes(String[] aStopCodes) {
              stopCodes = aStopCodes;
         public String[] getStopCodes() {
              return stopCodes;
         [more]
    The service build.xml file:
    <project name="GIMService" default="all" basedir=".">
         <target name="all" depends="ear"/>
    <target name="ear">
    <servicegen
    destEar="GIMService.ear"
    contextURI="GIMContext" >
    <service
         ejbJar="GIMServiceEJB.jar"
         targetNamespace="ncr.com"
                        serviceName="GIMService"
                        serviceURI="/GIM_URI"
                        generateTypes="True"
                        expandMethods="True"
                        style="rpc"
                        protocol="http" >
              <client
                   clientJarName="GIMService_client.jar"
                   packageName="com.ncr.gim.gimservice.client" >
              </client>
    </service>
    </servicegen>
    </target>
    </project>

    Hi Jeff,
    Looks like the Perl client is using an older (deprecated) schema
    namespace "http://www.w3.org/1999/XMLSchema" that is causing this
    failure.
    Hope this helps,
    Bruce
    Jeff Carey wrote:
    >
    To receive input data our Web service defines a JavaBean one element of which is
    an array of strings. When a test Java client calls the service method the call
    is completed successfully. When a Perl client calls the service method an exception
    is returned. If I understand BEA's Web service documentation, it isn't necessary
    to do development for the service specifically to enable correct processing of
    an array of strings.
    In our environment we are running WL 8.1 SP 1.
    Please review the problem documentation and explain to me the cause of the exception
    and what I must do to prevent it.
    Thank you.
    The exception:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: weblogic.xml.schema.binding.DeserializationException: mapping
    lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema context=TypedSchemaContext{javaType=java.lang.String}
    (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>weblogic.xml.schema.binding.DeserializationException:
    mapping lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema
    context=TypedSchemaContext{javaType=java.lang.String}
    at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeUtils.java:461)
    at weblogic.xml.schema.binding.SoapArrayCodecBase.getComponentDeserializer(SoapArrayCodecBase.java:574)
    at weblogic.xml.schema.binding.SoapArrayCodecBase.deserialize(SoapArrayCodecBase.java:285)
    at weblogic.xml.schema.binding.BeanCodecBase.processElement(BeanCodecBase.java:183)
    at weblogic.xml.schema.binding.BeanCodecBase.processAllElements(BeanCodecBase.java:165)
    at weblogic.xml.schema.binding.BeanCodecBase.processElements(BeanCodecBase.java:145)
    at weblogic.xml.schema.binding.BeanCodecBase.deserialize(BeanCodecBase.java:108)
    at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428)
    at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328)
    at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:384)
    at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:458)
    at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:78)
    at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
    at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:518)
    [more]
    The XML generated for the Perl client:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:namesp2="http://namespaces.soaplite.com/perl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:getWorkOrdersByFilters
    xmlns:namesp1="ncr.com"><gIMServiceRequest xsi:type="ns:GIMServiceRequest" xmlns:ns="java:com.ncr.gim.bean.service"><applicationID
    xsi:type="xsd:string">REVLOG</applicationID><nodeId xsi:type="xsd:string">00XH</nodeId><stopCodes
    xsi:type="namesp2:array" SOAP-ENC:arrayType="xsd:string[2]"><xsd:string xsi:type="xsd:string">06</xsd:string><xsd:string
    xsi:type="xsd:string">16</xsd:string></stopCodes></gIMServiceRequest></namesp1:getWorkOrdersByFilters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The XML generated for a test Java client:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getWorkOrdersByFilters
    xmlns:m="ncr.com"><gIMServiceRequest xmlns:n1="java:com.ncr.gim.bean.service"
    xsi:type="n1:GIMServiceRequest"><CSRCode xsi:type="xsd:string">987x00</CSRCode><applicationID
    xsi:type="xsd:string">GIM</applicationID><incidentNbr xsi:nil="true"/><nodeId
    xsi:type="xsd:string">00T5</nodeId><stopCodes soapenc:arrayType="xsd:string[3]"><xsd:string
    xsi:type="xsd:string">00</xsd:string><xsd:string xsi:type="xsd:string">01</xsd:string><xsd:string
    xsi:type="xsd:string">02</xsd:string></stopCodes></gIMServiceRequest></m:getWorkOrdersByFilters></env:Body></env:Envelope>
    The JavaBean:
    public class GIMServiceRequest implements Serializable {
    private String applicationID = GIMConstants.UNKNOWN_APPLICATION_ID;
    private String nodeId = null;
    private String incidentNbr = null;
    private String CSRCode = null;
    private String[] stopCodes = null;
    public void setStopCodes(String[] aStopCodes) {
    stopCodes = aStopCodes;
    public String[] getStopCodes() {
    return stopCodes;
    [more]
    The service build.xml file:
    <project name="GIMService" default="all" basedir=".">
    <target name="all" depends="ear"/>
    <target name="ear">
    <servicegen
    destEar="GIMService.ear"
    contextURI="GIMContext" >
    <service
    ejbJar="GIMServiceEJB.jar"
    targetNamespace="ncr.com"
    serviceName="GIMService"
    serviceURI="/GIM_URI"
    generateTypes="True"
    expandMethods="True"
    style="rpc"
    protocol="http" >
    <client
    clientJarName="GIMService_client.jar"
    packageName="com.ncr.gim.gimservice.client" >
    </client>
    </service>
    </servicegen>
    </target>
    </project>

  • Array of Strings?

    How can I make an array of strings?

    or, depending on what the heck you're talkingabout
    That's bad advice now that Java is in version 5.
    The standard loop is the for-each loop. If you don't
    use it you're going down in complexity which is a
    very bad thing according to the "premature
    optimization is evil" bunch. So use for-each if you
    don't want to be accused of "premature optimization"
    by jverd and yawmark and other prominent members of
    that bunch.Thanks for your advice. I use version 1.4.2. I did not intend to give bad advice. My post was targeted at someone who obviously did not understand "nuts and bolts" of java. It was not intended to be a lesson about "good design" or "real life applications" or "standard for loops in version 1.5". I gave an example that i feel is both adequate and appropriate for the target audience. It's intended purpose was to demonstrate very simple and basic concepts to someone who asked a seemingly simple and basic question that could possibly irritate a seasoned programmer like yourself. I have read your helpful posts in this thread and would welcome comments from yawmark and jverd also. I am sure they would be helpful to others who would read this thread in the future but their level of experience (along with Mr Warnerja) would perhaps be lost and uncomprehended by the OP. If in the context of the original question, you believe that my posts and simple examples are inappropriate, then would you kindly explain in terms that the OP can understand? Also explain (in this context) how my posts were wrong and meaningless.
    respectfully yours,
    Arbie

  • Array of strings strict type def not updating

    I have defined an Array of Strings (ctrl) as a strict type def. When I update this array (add another string to it) the values don't update where this control is used. Can someone please explain why this is occuring.

    Only the size of the array _shell_ is locked, not the size of the array data. The array shell is a window into the data of the array control. If you change the value of the index display you will change the indices visible inside the array shell.
    -Jim

  • "Using a CIN to Create an Array of Strings in LabVIEW" example crashes LV on Linux

    Tried to utilize this NI example: "Using a CIN to Create an Array of Strings in LabVIEW" (http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B4B282BE7EF907C8E034080020E74861&p_node=&p_source=External)
    Compiles OK with the makefile made by the LV's lvmkmf utility. Nevertheless when I try to run the VI (with the code loaded into the CIN, of course), LabVIEW 7.1.1 on a SUSE 9.3 Linux machine crashes:
    LabVIEW caught fatal signal
    7.1.1 - Received SIGSEGV
    Reason: address not mapped to object
    Attempt to reference address: 0x0
    Segmentation fault
    Any ideas? Did anybody try this on a Windows machine?

    H View Labs wrote:
    Tried to utilize this NI example: "Using a CIN to Create an Array of Strings in LabVIEW" (http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B4B282BE7EF907C8E034080020E74861&p_node=&p_source=External)
    Compiles OK with the makefile made by the LV's lvmkmf utility. Nevertheless when I try to run the VI (with the code loaded into the CIN, of course), LabVIEW 7.1.1 on a SUSE 9.3 Linux machine crashes:
    LabVIEW caught fatal signal
    7.1.1 - Received SIGSEGV
    Reason: address not mapped to object
    Attempt to reference address: 0x0
    Segmentation fault
    Any ideas? Did anybody try this on a Windows machine?
    This code is badly broken. In addition to resizing the actual handle to hold the number of string handles you also would need to create the string handles itself before attempting to write into them. NumericArrayResize is the fucntion to use as it will either resize an existing handle (if any) or create a new one if the value is uninitialized (NULL).
    /* resize strarr to hold handles to NUMSTRINGS strings */
    err = SetCINArraySize((UHandle)strarr, 0, NUMSTRINGS);
    if (err)
    goto out;
    /* perform this loop once for each element */
    /* of array of strings being created */
    for (i = 0; i < NUMSTRINGS;) {
    LStrHandle handle = (*strarr)->arg1[i];
    /* determine length of string that will be element of strarr */
    strsize = StrLen(str[i]);
    err = NumericArrayResize(uB, 1, &handle, strsize);
    if (err)
    goto out;
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /* moves strsize bytes from the address pointed to */
    /* by str[i] to the address pointed to by the data pointer in the handle */
    MoveBlock(str[i], LStrBuf(*handle), strsize);
    /* manually set size of string pointed to by *strarr */
    (*((*strarr)->arg1[i]))->cnt = strsize;
    /* manually set dimSize of strarr */
    (*strarr)->dimSize = ++i;
    return noErr;
    out:
    return err;
    Rolf KalbermatterMessage Edited by rolfk on 06-30-2005 03:15 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • H:dataTable value as array of Strings vs array of objects

    I'm trying to use a h:dataTable with an h:inputText as one of the columns. If my bean returns an array of Strings, then the h:dataTable can't update them. (I added a submit button that just updates the fields and returns to the current page.) If I use an array of objects, in this case a simple wrapper class, it works. Why is this?
    This won't work:
    public class EmailBean {
        private String[] m_emails;
        public String[] getEmails() {
            return m_emails;
        public void setEmails(String[] emails) {
            m_emails = emails;
    }But this will:
    public class EmailBean {
        private Email[] m_emails;
        public EmailBean() {
            m_emails = new Email[] {
                    new Email("[email protected]"),
                    new Email("[email protected]"),
                    new Email("[email protected]")
        public Email[] getEmails() {
            return m_emails;
        public void setEmails(Email[] emails) {
            m_emails = emails;
    }

    public class Email {
        private String email;
        public Email(String email) {
            this.email = email;
        public String getEmail() {
            return email;
        public void setEmail(String email) {
            this.email = email;
    }For the one that uses the Email class, I use this:
    <h:dataTable value="#{emailTestBean.emails}"
                                  var="email">
         <h:column>
              <f:facet name="header">
                   <h:outputText value="Email Address" />
              </f:facet>
              <h:inputText value="#{email.email}" />
         </h:column>
         <f:facet name="footer">
              <h:commandButton value="Submit" />
         </f:facet>
    </h:dataTable>Otherwise I don't need the extra ".email":
    <h:dataTable value="#{emailTestBean.emails}"
                                  var="email">
         <h:column>
              <f:facet name="header">
                   <h:outputText value="Email Address" />
              </f:facet>
              <h:inputText value="#{email}" />
         </h:column>
         <f:facet name="footer">
              <h:commandButton value="Submit" />
         </f:facet>
    </h:dataTable>

Maybe you are looking for

  • Best methods for bringing media to a different system

    I'm usually an Avid guy, and I am doing a FCP project that involved media that was digitized on a different system. I started a new project and imported the folder with the media and it came in just fine, but I now get an "Out of Memory" error after

  • SCVMM & DPM on same server. SQL error.

    Hi, I have install SCVMM & configured on server SCVMM1, Is it posible to install the DMP server also on same SCVMM1. I have assgin sufficient resources to server. While trying to install help me in SQL configuration as SQL is also on same server.  It

  • CONDENSE FORMAT CHARACTER MODE REPORT IN REPORT2.5

    I want to generate report in condense character format in Report v2.5. I want to print 230 character per line and need to condense it. I know I need to send ASCII character(15) to printer. I have tried printer code (before & After) option but it does

  • Smartform/Script Preview Appears ok Printing is Inverse(Upside Down)

    Hi Friends, We are having number of Objects on which Company Logo and other Graphics has been added. When I look at the Layout in Preview. It Appears OK. But when I take Printing It comes INVERSE (Upside Down) This issue has been obsered while taking

  • Alert ccx agent number of calls in queue

    Hi, Is there a way to send an alert or message to the agents IP phone, the number of calls in the queue? Can some one point me in the right direction.