Storing an array of objects?

Right... I need my table to store a series of product ID's, quantities, and serial numbers. At the moment, I'm using a column for each time, and using a StringTokenizer to retrieve them from strings such as "3;4;2;5". However, I'd like to store all 3 values in one column, so that I can store effectively an array of objects in one column field. Is this in any way possible?
Thanks
Stu

Sorry, perhaps I wasn't clear enough.
The table I am using is designed so that each row
tracks a single technical services job (I'm writing
this for a computer repair/maintenance firm). As such,
I need to track what hardware items are used/sold with
a tech services job.
At the moment I have three columns:
ProductID ProductSerial
ProductQuantity
1;2;3;4; 111;222;333;444;
5;6;7;8
The above three columns & values contain data for 4
separate sales within the job:
ProductID 1, serial 111, quantity 5
ProductID 2, serial 222, quantity 6
ProductID 3, serial 333, quantity 7
ProductID 4, serial 444, quantity 8
To generate the info for the first sale, I take the
first token of all 3 columns, and so on, and then map
them to a two-dimensional array that will look as
follows:
(assume they're all strings for now)
String[][] sales = new String[][]
new String[] { "1", "111", "5" },
new String[] { "2", "222", "6"}
}; This works as I want. However, I suspect there's a way
to condense all three of my current columns into one
column... one that I can't myself fathom, and would
greatly appreciate help for.
-fuzzy- how could I redesign the database to implement
such a thing?
All help appreciated
Stuas pointed out the design is terrible.
here is a proper design that will make your life much easier...
Table - Sale
id- Primary Key
Table - SaleItem
saleid - Foriegn Key from Sale - also part of Primary Key
productid - other part of primary key
productserial
productquantiy
so your data would look like this in these tables...
Sale
id
1
SaleItem
saleid productid productserial productquantity
1 1 111 5
1 2 222 6
1 3 333 7
1 4 444 8
as a side note i think productid is probably a spurious field.. using are using it i think as unique id... wouldn't the serial numbers be unique? I would use just them if they are...
anyway hope this helps.

Similar Messages

  • Passing an array of objects to stored procedure(oracle)

    I have to pass an array of objects to a pl/sql stored proc.
    Its prototype is,
    proc_orderins(ordernum varchar2(14), ct newTask)
    where newTask is an array of objects:
    type task as object ( name varchar2(20),odd varchar2(8),sdd varchar2(8));
    create or replace type newTask as VARRAY(25) OF Task;
    will the following work from the java code :
    public class CriticalTask
    String name,odd,sdd;
    public CrticalTask(String name,String odd,String sdd)
    this.name=name;
    this.odd=odd;
    this.sdd=sdd;
    Object [] ctasks =new Object[7];
    for(i=0;i<7;i++)
    Object=new CrtitcalTask("x","x","x");
    String query="{call proc_orderins(?,?)}";
    CallableStatement cstmt=con.prepareCall(query);
    cstmt.setInt(123);
    cstmt.setObject(ctasks);
    cstmt.execute();
    will the above code work, when I am passing an array?

    Use code tags when you post code.
    I am rather certain that the code you posted will not work.
    Technically you should be able to use the java.sql.Array interface.
    The newest Oracle drivers might support that (you would have to investigate how to use it.)
    It is however possible that it isn't supported. If not then you will have to use one of the Oracle specific classes that is documented in the Oracle jdbc documentation.

  • How to pass a array of object to oracle procedure using callable

    Hi,
    I am calling a oracle stored procedure using callable statement which has IN and OUT parameter of same type.
    IN and OUT are array of objects. (ie) IN parameter as Array of Objects and OUT parameter as Array of Objects
    here are the steps i have done as advised from oracle forum. correct me if i am in wrong direction
    ORACLE types and Stored Procedure
    CREATE OR REPLACE
    TYPE APPS.DEPARTMENT_TYPE AS OBJECT (
    DNO NUMBER (10),
    NAME VARCHAR2 (50),
    LOCATION VARCHAR2 (50)
    CREATE OR REPLACE
    TYPE APPS.DEPT_ARRAY AS TABLE OF department_type;
    CREATE OR REPLACE package body APPS.insert_object
    IS
    PROCEDURE insert_object_prc (d IN dept_array, d2 OUT dept_array)
    IS
    BEGIN
    d2 := dept_array ();
    FOR j IN 1 .. d.COUNT
    LOOP
    d2.EXTEND;
    d2 (j) := department_type (d (j).dno, d (j).name, d(j).location);
    END LOOP;
    END insert_object_prc;
    END insert_object;
    JAVA CODE
    Value Object
    package com.custom.vo;
    public class Dep {
    public int empNo;
    public String depName;
    public String location;
    public int getEmpNo() {
    return empNo;
    public void setEmpNo(int empNo) {
    this.empNo = empNo;
    public String getDepName() {
    return depName;
    public void setDepName(String depName) {
    this.depName = depName;
    public String getLocation() {
    return location;
    public void setLocation(String location) {
    this.location = location;
    to call stored procedure
    package com.custom.callable;
    import com.custom.vo.Dep;
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleTypes;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    import oracle.sql.Datum;
    import oracle.sql.STRUCT;
    import oracle.sql.StructDescriptor;
    public class CallableArrayTryOut {
    private static OracleDataSource odcDataSource = null;
    public static void main(String[] args) {
    OracleCallableStatement callStatement = null;
    OracleConnection connection = null;
    try {
    odcDataSource = new OracleDataSource();
    odcDataSource
    .setURL("......");
    odcDataSource.setUser("....");
    odcDataSource.setPassword("....");
    connection = (OracleConnection) odcDataSource.getConnection();
    } catch (Exception e) {
    System.out.println("DB connection Exception");
    e.printStackTrace();
    Dep[] dep = new Dep[2];
    dep[0] = new Dep();
    dep[0].setEmpNo(100);
    dep[0].setDepName("aaa");
    dep[0].setLocation("xxx");
    dep[1] = new Dep();
    dep[1].setEmpNo(200);
    dep[1].setDepName("bbb");
    dep[1].setLocation("yyy");
    try {
    StructDescriptor structDescriptor = new StructDescriptor(
    "APPS.DEPARTMENT_TYPE", connection);
    STRUCT priceStruct = new STRUCT(structDescriptor, connection, dep);
    STRUCT[] priceArray = { priceStruct };
    ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor(
    "APPS.DEPT_ARRAY", connection);
    ARRAY array = new ARRAY(arrayDescriptor, connection, priceArray);
    callStatement = (OracleCallableStatement) connection
    .prepareCall("{call insert_object.insert_object_prc(?,?)}");
    ((OracleCallableStatement) callStatement).setArray(1, array);
    callStatement.registerOutParameter(2, OracleTypes.ARRAY,
    "APPS.DEPT_ARRAY");
    callStatement.execute();
    ARRAY outArray = callStatement.getARRAY(2);
    Datum[] datum = outArray.getOracleArray();
    for (int i = 0; i < datum.length; i++) {
    oracle.sql.STRUCT os = (oracle.sql.STRUCT) datum[0];
    Object[] a = os.getAttributes();
    for (int j = 0; j < a.length; j++) {
    System.out.print("Java Data Type :"
    + a[j].getClass().getName() + "Value :" + a[j]
    + "\n");
    connection.commit();
    callStatement.close();
    } catch (Exception e) {
    System.out.println("Mapping Error");
    e.printStackTrace();
    THE ERROR
    Mapping Errorjava.sql.SQLException: Inconsistent java and sql object types
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
    at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:823)
    at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1735)
    at oracle.sql.STRUCT.<init>(STRUCT.java:136)
    at com.custom.callable.CallableArrayTryOut.main(CallableArrayTryOut.java:48)

    You posted this question in the wrong forum section. There is one dedicated to Java that was more appropriate.
    Anyway here is a link that describes what you should do.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/oraarr.htm#i1049179
    Bye Alessandro

  • Calling a Procedure which has Array of Objects as arguments (from BPEL)

    Hi,
    I wanted to pass multiple records as arguments to a stored procedure from BPEL.
    We created stored procedure which takes array of Objects as arguments. I invoked it from BPEL. It was successfully compiled and deployed.
    At runtime it is throwing following error.
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="code">
    <code>17072</code>
    </part>
    <part name="summary">
    <summary>Error binding the value of a parameter. An error occurred when binding the value of parameter ARG in the SCOTT.TESTPACK.TESTPROC API. Cause: java.sql.SQLException: Inserted value too large for column: "sadfsafsad" Check to ensure that the parameter is a valid IN or IN/OUT parameter of the API. Contact oracle support if error is not fixable.</summary>
    </part>
    <part name="detail">
    <detail>Inserted value too large for column: "sadfsafsad"</detail>
    </part>
    </bindingFault>

    I think you from Sierra Atlantic and you using Beta 3. There was a bug in Beta 3 in using arrays, which got fixed in post Beta3. You got to wait till next release.

  • Check this out: making a copy of an array of objects

    I have an array of objects called Figs of type Figure and I am making a copy of this array called OriginalFigs so later when Figs change, I can use the original values stored in OriginalFigs.
    But I found out that when values in Figs change, values in OriginalFigs also change.
    I tried to store values in Vector too but even in Vector values are changing.
    seems like they both are storing reference to Figs and when Figs change , they(Vector and OriginalFigs) chnage too.
    Is there any way to come around this problem?
    if u know then plz share with me..........

    Hi,
    how do you copy them - if you use the method from Object(? was it there, never use this), you will get a shallow copy - that is a new object with the same references in it - not a new object with new objects of the figures in it.
    How about providing a methode in your figure-objects which can do a total copy? - This must be easy as so you know how to construct such an object efficiently.
    Another way to hold a copy is to write the figures out to a stream temporarily - all objects are serializable and so they can be stored to a stream - but your figures should not have references to other parts of the program in it, because the serialisation-process tries to serialize all references the object has, that is to be serialized. If there is for exampe a link to the main JFrame in it, the serialisation process tries to store your hole program to the stream and this may be impossible - I hat this with parts of a JTree that refuse to be stored to a stream.
    Hope, this will help
    greetings Marsian

  • Creating an array of objects of a class known ONLY at RUNTIME

    I have a method in a class which expects an array of objects of particular type (say A) as its only argument. I 'invoke' this method using reflection. I have the instances of the class A stored in a Vector. When I do 'toArray' on this vector, what I get back is an array of Objects and not an array of objects of A. I assign this array to the zeroth element of another Object array and pass that array as a second argument to the 'invoke' method. Of course, it throws an Exception saying - argument types mismatch. Because I am sending an array of Objects to a method expecting an array of objects of A. My problem is I don't know A until runtime. So I have to handle whatever I am getting back after doing 'toArray' on a vector as a Generic Object. I know there's another version of 'toArray' in the Vector class. But it's API documentation didn't help a lot.
    Can anybody please help me solve this problem? Any sort of hints/code snippet would be of great help.
    Does the above description makes any sense? If not, please let me know. I would try to illustrate it with a code sample.
    Thanks a lot in advance.

    Sorry, for the small typo. It is -
    clazz[] arr = (clazz [])java.lang.reflect.Array.newInstance(clazz, n);
    instead
    Thanks for the reply. I could do this. But I am
    getting a handle to the method to be 'invoke'd by
    looking at the types of the parameters its
    expecting(getParameterTypes). So I can't change it to
    accept an array of Generic Objects.
    I looked at the java.lang.reflect.Array class to do
    this. This is what I am trying to do-
    String variableName is an input coming into my
    program.
    n is the size of the array I'm trying to create.
    Class clazz = Class.forName(variableName);
    clazz[] arr = (clazz
    [])java.lang.reflect.newInstance(clazz, n);
    According to Reflection API, it should work, right?
    But compiler yells at me saying 'class clazz not
    found'.
    Any suggestions/hints/help?
    Thanks, again.

  • Formatted .data file, reading in and creating an array of objects from data

    Hi there, I have written a text file with the following format;
    List of random personal data: length 100
    1 : Atg : Age 27 : Income 70000
    2 : Dho : Age 57 : Income 110000
    3 : Lid : Age 40 : Income 460000
    4 : Wgeecnce : Age 43 : Income 370000
    and so on.
    These three pieces of data, Name,Age and Income were all generated randomly to be stored in an array of objects of class Person.
    Now what I must do is , read in this very file and re-create the array of objects that they were initially written from.
    I'm totally lost on how to go about doing this, I have only been learning java for the last month so anyone that can lend me a hand, that would be superb!
    Cheers!

    Looking at you other thread, you are able to create the code needed - so what's the problem?
    Here's an (not the only) approach:
    Create an array of the necessary length to hold the 3 variables, or, if you don't know the length of the file, create a class to contain the data. Then create an ArrayList to hold an instance of the class..
    Use the Scanner class to read and parse the file contents into the appropriate variables.
    Add each variable to either the array, or to an instance of the class and add that instance to the arraylist.

  • Sorting an array of objects by an attribute

    I'm pretty new to java so don't laugh if you think my question is real easy!
    I have an array of objects and I want to sort them according to an integer value stored in each object. Any help would be very much appreciated.
    Thanks for looking!!

    Perhaps an example would help:
    public class Person {
      private String name;
      private int age;
      public void setName(String name) { this.name = name; }
      public void setAge(int age) { this.age = age; }
      public String getName() { return name; }
      public int getAge() { return age; }
    =====
    public class PersonAgeSorter implements Comparable {
      public int compare(Object o1, Object o2) {
        Person p1 = (Person) o1;
        Person p2 = (Person) o2;
        Integer i1 = new Integer(p1.getAge());
        Integer i2 = new Integer(p2.getAge());
        return i1.compareTo(i2);
    =====
    public class PersonNameSorter implements Comparable {
      public int compare(Object o1, Object o2) {
        Person p1 = (Person) o1;
        Person p2 = (Person) o2;
        String s1 = p1.getName();
        String s2 = p2.getName();
        return s1.compareTo(s2);
    =====
    import java.util.Arrays;
    public class SortExample {
      public static void main(String [] args) {
      Person p1 = new Person();
      Person p2 = new Person();
      p1.setName("Tom");
      p1.setAge(22);
      p2.setName("Nancy");
      p2.setAge(33);
      Person [] people = new Person[2];
      people[0] = p1;
      people[1] = p2;
      Arrays.sort(people, new PersonAgeSorter());
      Arrays.sort(people, new PersonNameSorter());
    }

  • Oracle ADF Mobile getting array of objects from webservice

    hi,
    i am trying to fetch a certain number of records using a webservice call and then storing in the SQLLite DB in the mobile.
    i understand i can create a data control using the webservice > then?
    my webservice returns an array of objects.
    how can i do that?
    regards,
    ad

    It's fairly easy.
    What I have done is created a WebService Controller (plain java class) which calls the methods (from the WS) programmaticly.
    Example :
    public class WSController {
        private final String WSDataControllerName = "ThisIsTheNameOfMyWebserviceDataControl";
        private List pnames ,ptypes ,params;
        public WSController() {
            super();
        public List getAllActioncodesFromWS()
           //start - WS empty params
            pnames = new ArrayList();
            params = new ArrayList();
            ptypes = new ArrayList();
            pnames.add("findCriteria");
            params.add(null);
            ptypes.add(Object.class);
            pnames.add("findControl");
            params.add(null);
            ptypes.add(Object.class);
            //end - WS empty params
            List actionCodes = new ArrayList();
            try
                GenericType result = (GenericType)AdfmfJavaUtilities.invokeDataControlMethod(WSDataControllerName, null, "findActioncodesView1",pnames, params, ptypes);
                if(result!=null)
                    for (int i = 0; i < result.getAttributeCount(); i++)
                        GenericType row = (GenericType)result.getAttribute(i);
                        Actioncode wd = (Actioncode)GenericTypeBeanSerializationHelper.fromGenericType(Actioncode.class, row);
                        actionCodes.add(wd);
            catch (AdfInvocationException e)
                e.getMessage();
            catch (Exception e)
                e.getMessage();
         return actionCodes;
        }I also defined a Pojo named Actioncode :
    Note that the attribute names are completly the same as the VO from the web service.
    public class Actioncode {
        String Actioncode,Descript1;
        public Actioncode() {
            super();
        public Actioncode(String Actioncode, String Descript1) {
            super();
            this.Actioncode = Actioncode;
            this.Descript1 = Descript1;
        public void setActioncode(String Actioncode) {
            this.Actioncode = Actioncode;
        public String getActioncode() {
            return Actioncode;
        public void setDescript1(String Descript1) {
            this.Descript1 = Descript1;
        public String getDescript1() {
            return Descript1;
    }Since the WS method returns a GenericType, you can 'convert' that object to an POJO.
    Read more about it here :
    http://adf4beginners.blogspot.be/2013/01/adf-mobile-how-to-iterate-over-all-rows.html
    I know the blog post is about iterating over rows in an iterator, but it's just to illustrate how you can work with the GenericType

  • Reading arrays of objects

    I am new to OCI programming, but have read the manuals on reading objects, but can not figure out how to do what I want to do from that documentation. I am using oracle 9.2.0.7
    I have a package that produces a bunch of data. Currently this data is stored as records in local variables. From my understanding OCI can not read oracle records
    so that I will need to change package to use either varrary or associative arrays. I do not want to place this data into a actual oracle table because the data only has meaning at time package procedure is run and then is out of date for any other purposes. I Only want to read the data that is created in sql packages so that my C program can do other work with that data. It will change data into an XML format that Internet Application will use.
    This is where I am stuck, it is implied that OCI should be able to read these created arrays of objects, but all examples are reading oracle tables that have objects in them. So I would like either an example or some suggestions on how to get started on doing this. So far I have created and oracle object type that has my fields in it. Since I do not know how many records I will be creating when I
    run this package I think I should put data in an associative array.

    Hi
    Yes, you'll need to publish the data somehow. One way to do it is to place the data into a PL/SQL collection; then select from that.
    There's a write up of some examples at http://www.dbasupport.com/oracle/ora9i/cast.shtml
    HTH
    regards Nigel

  • Storing an array permanently

    Hi,
    Is there a way of storing an array permanently, so that it stays saved somewhere in a file or something? I need to create an application that stores this array and reads the values from it, without having to re-create the array everytime I run the application.
    Thanks for any help.

    Serialization is flakey (can have many problems when JDK or class is updated), wasteful of space, and IMO should be the implementation of last resort.
    Here's a code snippet of what I would do:
    public void saveArray(Object[] array, File f) throws IOException {
      PrintWriter writer = new PrintWriter(new FileWriter(file));
      for (int i = 0; i < array.length; i++)
         writer.println(array.toString);
    writer.close();

  • Storing an array into the database using jdbc

    Hi,
    i�ve got a problem storing an array into a database. I want to store objects consisting of several attributes. One of these attributes is an array containing several int values. I don�t know exactly what is the best way to store these objects into a database. I have created two tables connected by a one to many relationship of which one stores the array values and the other table stores the object containing the array. Is that ok or should I use another way. It�s the first time I�m trying to store objects containing arrays into a database so I�m very uncertain in which way this should be done.
    Thanks in advance for any tips

    1. You should use blob or longvarbianry type colum to stor that array.
    2. All object in that array should be Serializable.
    3. Constuct a PreparedStatement object
    4. Convert array to byte[] object
    ByteArrayOutputStream baos=null;
    ObjectOutputStream objectOutputStream=null;
    baos = new ByteArrayOutputStream(bufferSize);
    objectOutputStream = new ObjectOutputStream(baos);
    objectOutputStream.writeObject(array);
    objectOutputStream.flush();
    baos.flush();
    byte[] value=baos.toByteArray();
    5. Now you can use PreparedStatement.setBytes function to insert byte[] value.

  • Accessing data in an array of objects..

    I've created the classes
    public class Box
    int width;
    int height;
    int depth;
         public Box(int a, int b, int c)
         width = a;
         height = b;
         depth = c;
         public void getWidth()
         System.out.println(width);
         public void getHeight()
         System.out.println(height);
         public void getDepth()
         System.out.println(depth);
    }and this collection of boxes...
    public class Collecton
         int count = 0;
         Box[] BoxCollection;
         public Collection
         BoxCollection = new Box[50]
         public recbox(int a, int b, int c)
         BoxCollection[count] = new Box(a, b, c)
         count++
         public printBoxes()
         System.out.println("Box Number = " + count);
         System.out.print("Box Width: ");
         BoxCollection[count].getWidth();
         etc...
    }Now, I call this in the main code so that after each box is created, the specs of the box is printed back out onto the screen. The calling procedure works
    However, only the Box Number part seems to print... the width, height and depth all don't work.
    Am I accessing the data stored in the array of objects incorrectly?
    Please advise.
    Thanks

    a b and c come from user inputs via an input/output lib... and you are sure this user input works? Perhaps you're searching in the wrong place: Do a System.out.println(a + ", " + b + ", " + c) just after getting that user input (from console?) and check the values.
    Patrick

  • How Does On Reference An Array Of Objects?

    Howdy!
    Ive read through Flex 2's help and also through the wonderful
    book 'Developing Rich Clients With Flex' for topics relating to
    this question but very strangely with no luck (and I assume it's
    quite straight forward)! So hopefully you chaps can help...
    Now, to get a value from an object model is very straight
    forward -
    quote:
    <mx:Model id="MyModel">
    <Inbox>
    <Message>
    <Sender>[email protected]</sender>
    <Subject>Blah Blah</Subject>
    <Content>This is the content of the
    email!</Content>
    </Message>
    </Inbox>
    </mx:Model>
    To get the <Sender> value its a simple case of -
    quote:
    MyModel.Inbox.Message.Sender
    Because obviously 'Sender' is just an object. But when I have
    an array of objects like so -
    quote:
    <mx:Model id="MyModel">
    <Inbox>
    <Message>
    <Sender>[email protected]</sender>
    <Subject>Blah Blah</Subject>
    <Content>This is the content of the
    email!</Content>
    </Message>
    <Message>
    <Sender>[email protected]</sender>
    <Subject>Blah Blah</Subject>
    <Content>This is the content of the
    email!</Content>
    </Message>
    </Inbox>
    </mx:Model>
    How do I reference the individual 'Sender' objects?
    Any help would really perk up my day :-)
    Thanks

    Thank you kindly!
    Just one more question (i'd select a different forum but it's
    related to this)...
    How would I loop through e.g.
    MyModel.Inbox.Message.Sender[n], from within a dataProvidor for a
    repeator?
    I'm basically creating a UI which is based on template data
    stored in an external data model which is using nested loops -
    Data Model
    quote:
    <TemplatesConfigurator>
    <Template label="Elite II" table="tbl_Category" id="2"
    description="Elite II So Quote Template 00038_TMP_V9">
    <Category label="Heading - Base System Elite"
    table="tbl_CategorySub" id="1">
    <CategorySub label="Base System" table="tbl_CategorySub"
    id="4">
    <Parts1 label="08639" table="tbl_Template"
    id="1"></Parts1>
    </CategorySub>
    <CategorySub label="Elite II (included in base system)"
    table="tbl_CategorySub" id="5">
    <Parts1 label="05356" table="tbl_Template"
    id="2"></Parts1>
    <Parts1 label="03703" table="tbl_Template"
    id="3"></Parts1>
    <Parts1 label="05904" table="tbl_Template"
    id="4"></Parts1>
    <Parts1 label="06327" table="tbl_Template"
    id="5"></Parts1>
    <Parts1 label="06767" table="tbl_Template"
    id="6"></Parts1>
    </CategorySub>
    </Category>
    <Category label="Heading - Support Contracts &
    Warranty" table="tbl_CategorySub" id="28">
    <CategorySub label="Support Contract Options "
    table="tbl_CategorySub" id="29">
    </CategorySub>
    <CategorySub label="Warranty Options"
    table="tbl_CategorySub" id="30">
    </CategorySub>
    </Category>
    </Template>
    </TemplatesConfigurator>
    Repeaters
    quote:
    <mx:Repeater id="r1"
    dataProvider="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template}">
    <mx:Form height="100%" width="100%"
    horizontalScrollPolicy="off" paddingBottom="0" paddingLeft="0"
    paddingRight="0" paddingTop="0" backgroundColor="#ffffff"
    verticalScrollPolicy="auto">
    <mx:Label
    text="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.label}"
    fontWeight="bold" fontSize="13" paddingBottom="0"/>
    <mx:Text
    text="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.description}"
    fontSize="10"/>
    <mx:Repeater id="r2"
    dataProvider="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.Categor y}">
    <mx:Label id="SubHeadings" text="{r2.currentItem.label}"
    fontWeight="bold" fontSize="12"/>
    <mx:Repeater id="r3" dataProvider="{
    TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.Category[0].CategorySub}">
    <mx:Label text="{r3.currentItem.label}" fontWeight="bold"
    fontSize="10"/>
    </mx:Repeater>
    </mx:Repeater>
    </mx:Form>
    </mx:Repeater>

  • Searching through an array of objects

    Hi, I am currently working on an assignment where I have to create a class called Persons with data fields of Name(String),age(int),income(int).
    All the values including the string values for name and values for income and age are all randomly generated and are stored in an array of objects of class "Persons".
    The array size is user specified.
    What I must attempt to implement now is to make a search feature that lets the user search through the array of objects for a particular name.
    I'm having some bad luck trying to implement this feature.
    If anyone can help me, I would greatly appreciate that!
    Cheers.

    Hi, Thank you for the prompt reply.
    I do not yet know HOW to start this,I mean I know how to search for individual characters in an element of an array, but to search for whole strings I am quite unsure.
    public class Persons
        //data fields
        private String name;
        private int age;
        private int income;
        //Constructor for Class Persons
        public Person(String[] name,int[] age,int[] income)
              String[] tempName = name;
              int[] tempAge = age;
              int[] itempIncome = income;
        //Instance method for returning some basic values about personal data
        public void toString(Persons ofChoice)
            System.out.println("Persons Data");
            System.out.println("Name: " + ofIntrest.name);
            System.out.println("Age: " + ofIntrest.age);
            System.out.println("Income: $" + ofIntrest.income);
    }This is my Persons class code, but I am quite stumped how to search for whole strings at the time being.

Maybe you are looking for

  • Unable to upload only modified files to FTP site

    Everytime I upload to FTP host, I select "Only modified files", but all files are updated instead. What's the problem? Thanks, Greg

  • Disappearing Application Windows?

    Hi, I am running mac os x 10.5.5 on a 3.06 24inch imac with 4gb ram. recently I have a worsening issue with application windows disappearing. It seems to happen with all applications intermittently & i cant pin down why it is happening. I do use spac

  • Dialog Boxes pop up behind other windows :(

    Once in a while an application wants my attention. It would then throw up a dialog box and start bouncing in the Dock. So far so good. Unfortunately, if the application's window is positioned behind something else, the dialog box pops up in front of

  • Creating Tables with a Script

    I am trying to create tables using a script, but it seems like consecutive statments in the script will not execute --- can anyone tell me what syntax I need to use? Here is my script - I am using SQL-Plus: CREATE TABLE regions ( region_id NUMBER CON

  • Older mac can't upgrade/buy newest version pages

    late 2009 iMac running yosemite 10.10 gets this error message when attempting to upgrade Pages to the latest version thru the Mac App Store. "Can't upgrade as this app was purchased by a different user, or was cancelled previously.  " This is a new u