collect objects

There are lists where I can add, collect objects? In java, it is an ArrayList.

You can add anything you want to it.

var someCollection: collection ArrayCollection = new ArrayCollection();

someCollection.addItem (myPaperVisionObject);

works perfectly.

Tags: Flex

Similar Questions

  • Type of custom with the attribute of the collection object

    Hello

    I am a beginner in PL/SQL, although I have a lot of experience in MSSQL.  I try to get a stored procedure to return a type of complex object in .NET code that runs it.  This object contains 3 standard attributes and a varchar2 data collection (12).  I've seen several examples of creating tables that have a complex data type, but none on what I want to do. I tried several variations on what follows, without success so far:

    CREATE OR REPLACE TYPE BoxNumberTable AS TABLE OF THE VARCHAR2 (12);

    create or replace TYPE GETBOXNUMBER_RESULT AS OBJECT

    (/ * TODO enter statements attribute and the method here * /)

    Success of char (1),

    BoxNumber VARCHAR2 (12),

    ErrorMessage, VARCHAR2 (4000).

    DuplicateBoxNumbers BoxNumberTable

    );

    Keep syntax errors. Any help would be greatly appreciated.

    Thank you

    David

    Example:

    SQL > set serverout on
    SQL > ed
    A written file afiedt.buf

    1 create or replace FUNCTION GETBOXNUMBER return (currentlocation varchar2) is GETBOXNUMBER_RESULT
    2. PRAGMA AUTONOMOUS_TRANSACTION; -WHY USE IT?  IT IS RARELY NECESSARY, AND USUALLY ONLY FOR THE CONTROL/MONITORING
    3 BoxNum_Result GETBOXNUMBER_RESULT: = new GETBOXNUMBER_RESULT (null, null, null, null);
    4 Begin
    5. SELECT deptno
    In BULK 6 GATHER IN BoxNum_Result.DuplicateBoxNumbers
    7 FROM emp;
    8 return BoxNum_Result;
    9 * end;
    SQL > /.

    The function is created.

    SQL > ed
    A written file afiedt.buf

    1 declare
    2 BoxNum_Result GETBOXNUMBER_RESULT;
    3. start
    4 BoxNum_Result: = GETBOXNUMBER ('DUMMY');
    5 because I in 1... BoxNum_Result.DuplicateBoxNumbers.Count
    6 loop
    7 dbms_output.put_line (' value: ' |) BoxNum_Result.DuplicateBoxNumbers (i));
    8 end of loop;
    9 * end;
    SQL > /.
    Value: 20
    Value: 30
    Value: 30
    Value: 20
    Value: 30
    Value: 30
    Value: 10
    Value: 20
    Value: 10
    Value: 30
    Value: 20
    Value: 30
    Value: 20
    Value: 10

    PL/SQL procedure successfully completed.

    Although in bulk, collection of data in collections in memory is not usually a good idea as PGA memory is expensive, and you would not do that just to process the data and re - write to the database.

    What are you actually trying to achieve in the end?

  • use of collection (object type)

    Hi, I need the logic to insert records in the collection variable
    Could you please give me the tip to complete the section comments
    CREATE OR REPLACE TYPE Type_Rt IS OBJECT
        (Rt_Type      VARCHAR2(2000),
         cdtRt       VARCHAR2(2000),
         lqdtRt    VARCHAR2(2000),
         Olk              VARCHAR2(2000),
         cdtwh       VARCHAR2(2000) )
    
    CREATE OR REPLACE TYPE Rt_Type_Var IS TABLE OF Type_Rt;
    
    CREATE OR REPLACE PROCEDURE PROC_Rt (Cp_Id  VARCHAR2,
                                             St_Id    VARCHAR2,
                                             cdt_Rt   VARCHAR2,
                                             liq_Rt      VARCHAR2,
                                             Olk      VARCHAR2,
                                             cdt_Wh VARCHAR2 ,
                                             O_rat_arry OUT Rt_Type_Var  -- is this the correct approach
                                             ) 
    IS
    DECLARE
      v_typ_rt_List            Rt_Type_Var;   -- is this correct declaration
    BEGIN
      IF (Cp_Id ='N/A' AND St_Id ='N' AND cdt_Rt ='AA' 
          AND liq_Rt ='A' AND Olk ='Sle'  ) THEN
         /*insert into the object type with
         Rt_Type = STSRT
         cdtRt = AI
         lqdtRt =BB
         Olk =  BLE
         cdtwh = DV */
            
      END IF;
      IF (Cp_Id ='A' AND St_Id ='Y' AND cdt_Rt ='AB' 
          AND liq_Rt ='B' AND Olk ='Sle'  ) THEN
         /* insert into the object type
          Rt_Type = STLG
         cdtRt = BR
         lqdtRt =CR
         Olk =  WE
         cdtwh = PD*/
      END IF;
      IF (Cp_Id ='B' AND St_Id ='Y' AND cdt_Rt ='BB' 
          AND liq_Rt ='B' AND Olk ='Sle'  ) THEN
         /* insert into the object type
          Rt_Type = STSRT
         cdtRt = CR
         lqdtRt =LF
         Olk =  ER
         cdtwh = QA */
      END IF;
    
    END;
    After performing the procedure how can I call the procedure with grouping variable

    Thank you

    Published by: Smile on 13 April 2012 16:22

    There are more mistakes than letters in your code. In any case, here's example how to add the element to the collection:

    SQL> DECLARE
      2    v_typ_rt_List            Rt_Type_Var := Rt_Type_Var();
      3  BEGIN
      4       v_typ_rt_List.extend;
      5       v_typ_rt_List(1) := Type_Rt('N/A','N' ,'AA','A','Sle');
      6  END;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Cannot collect objects

    I have a number of objects which together form an image by their grouping, sort of like a mosaic of color. It's a bit difficult to describe, and I would fix an image if I could, but when I try to upload a png or jpg image in this post I get the error message "this type of image is forbidden." And Yes, they are lower than the maximum file size allowed.

    Anyway, imagine a grid of small squares, a bit like the tiles, with a little space between them. I am trying to unite, then use "divide objects below" to close with an object that is made from the space between them. In other words, I try to "reverse" the forms in a sort of diagram of the space between them.

    However, when I select all the and click on 'join' in the pathfinder they get just put in a group, and because this isn't something I can't use 'divide objects below' to an object made from the space between the tiles.

    Make a compound path.

  • BENEFITS AND REAL COLLECTION OBJECT

    Hi, well someone can give the real reason behind the existence of the Collections in Oracle.
    Because all the things we can do through database tables/views/procedures, etc..

    Please, help me to understand and give me an idea where the use of the collections become important.

    Thanks in advance.

    Al * wrote:
    Please can someone give the real reason behind the existence of the Collections in Oracle.

    Two basic reasons.

    The tables are and have been, a standard data since the dawn of programming structure. Languages such as Cobol used (and is still supported) tables. It's a very useful no scalar data structure. It would be a mistake for a more modern language no longer support arrays and collections. (if you want to understand all the benefits, then consult a guide that explains the structures of basic data for writing structured programs, how multidimensional arrays can be used and so on)

    The OCI (Oracle Call Interface) is since long support liaison and extraction of matrix table to optimize the performance of the server by reducing the number of call client-server round-trip flights. It is natural for PL/SQL to also support this feature of the OIC in order to reduce the number of switches context between engines SQL and PL/SQL.

  • Comparison of two collection objects

    Hi all

    I need to compare 2 lists of e-mail addresses and eliminate common e-mail found in both lists.

    Issues, it is each list contains more than 300,000 e-mail addresses. Is it possible to store values of this size in collectibles (for example, 'Set')?
    What is the best way to do this?

    Thanks in advance!

    user3578038 wrote:
    Issues, it is each list contains more than 300,000 e-mail addresses. Is it possible to store values of this size in collectibles (for example, 'Set')?

    If you have the memory, of course.

    What is the best way to do this?

    I do it with the standard unix commands, concatenate lists and sort / uniq on it.

    You are a spammer (or a spammer aspiring) or why do you 300 000 email addresses?

  • Add the action to the node root of the collection of objects in vcenter Internet client sdk

    Hello


    I mentioned the plugin sample of chassis-user interface of the web client to vCenter SDK 5.1.


    I want to add actions such as 'create a chassis' to the root of the Collection object, and not on the subject "chassis" itself.

    My code is the same as that provided in the samples (chassis-ui plugin).


    Then, I use mainly vsphere.core.inventoryList.ObjectCollectionTemplate.So using the plugin, I'm able to get stocks on each of the created frame object. But if there is no object created, stocks are not considered in the "Object" of the collection of the Node.So root tab I want actions on the root node, on the object.

    Help, please.



    Thank you very much.

    Global actions as you request are not supported in 5.1, but this problem is fixed in the next 5.5 SDK.

    If you need your plugin to work with the Web Client 5.1 you must put your global action according to another, for example to create objects.

  • How to read the objects and collections dynamically?

    Hello
    I want to read database/collection objects dynamically. Please advice!
    Here is an example

    Create the user as an object type (name varchar2 (100), number (3)) of the age
    /

    create a family of fonts as a user table
    /

    I want to do something like this

    DECLARE
    user of the var;
    BEGIN
    ...
    ...
    SELECT "family (1)" INTO var FROM DUAL;
    ...
    ...
    END;
    /

    Thank you

    As I suggested, you can define your own method of "diff" for the object. You haven't told us exactly what form you would like to work to take. I'll define a (pretty useless) function which will just create a string that tells you how to modify the data of an object to match the data in another. Obviously, you would like a more useful output. Potentially, rather than a member function, you can choose a procedure Member who emits DML is required for the underlying table is necessary.

    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE TYPE location_typ AS
      2  OBJECT
      3  (
      4    building_no NUMBER,
      5    city        VARCHAR2(40),
      6    MEMBER FUNCTION diff(
      7                l location_typ)
      8    RETURN VARCHAR2
      9  )
     10* ;
    SQL> /
    
    Type created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE TYPE BODY location_typ
      2  AS
      3    MEMBER FUNCTION diff(
      4      l location_typ)
      5    RETURN VARCHAR2
      6    IS
      7      l_diff_str varchar2(4000);
      8    BEGIN
      9      IF building_no != l.building_no THEN
     10        l_diff_str := 'Building_no needs to change from ' || building_no ||
     11                         ' to ' || l.building_no;
     12      END IF;
     13      IF city != l.city THEN
     14        l_diff_str := l_diff_str ||
     15                        'City needs to change from ' || city ||
     16                          ' to ' || l.city;
     17      END IF;
     18      RETURN l_diff_str;
     19    END;
     20* END;
     21  /
    
    Type body created.
    
    SQL> DECLARE
      2    loc location_typ;
      3    secloc location_typ;
      4    a NUMBER;
      5  BEGIN
      6    loc    :=NEW location_typ(300, 'San Francisco');
      7    secloc :=NEW location_typ(200, 'Redwood Shores');
      8    dbms_output.put_line( loc.diff( secloc ) );
      9  END;
     10  /
    Building_no needs to change from 300 to 200City needs to change from San
    Francisco to Redwood Shores
    
    PL/SQL procedure successfully completed.
    

    Justin

    Published by: Justin Cave on 9 April 2012 14:12

  • Collections of Vector and Hashtable obsolete?

    Vector and Hashtable are supposed to be the collection synchronized as part of th e java collection objects. I have a few questions about those two.

    In the early days of my development career, I learned that 'Vectors' & 'hashing' SHOULD be used when programming of applications that those that can be accessed simultaneously by multiple users. We use EJB components and we always use vectors and hash tables when returning collections of objects of EJB methods, inside business methods and inside servlets. Most of my elders advised me not to use all the other collections, leaving a chance to provoke conflict and interference of information. I hesitated to accept this, but I just did what they asked, because I didn't want to take this responsibility.

    But now I see that Vector and Hashtable are supposed to be obsolete collections and should probably not be used in new development. So now, I have a question about these.

    1. why they were ranked as the ancients?
    2. What are the alternatives we have to use instead?
    3. should I risk by using other collection objects in an application simultaneously accessible? (information jam, unexpected manipulations on information, etc.).

    Thank you!
    + [To the admins of the forum (to remove one of them if necessary) (: I posted the same section of simultaneity as well)] +.

    Knightbeat wrote:
    Vector and Hashtable are supposed to be the collection synchronized as part of th e java collection objects. I have a few questions about those two.

    In the early days of my development career, I learned that "vectors" & "hash tables" SHOULD be used when programming applications that those that can be accessed simultaneously by multiple users.

    It is false and has always been.

    Most of my elders advised me not to use all the other collections, leaving a chance to provoke conflict and interference of information.

    WTF is 'interference information '? And what specific conflicts they claim will lead to and how?

    The Collections Framework is out with Java 1.2 in 1998. Its classes are unsynchronized by default, but there are methods to provide a synchronized version of each of them. Your elders don't know what they are talking about.

    But now I see that vector and Hashtable are supposed to be obsolete collections and probably should not be used in the development of new.

    Functionally they still work very well. The reason for preferring the ArrayList and HashMap is that these classes were created as part of Collections from the beginning. Vector and Hashtable was modernized in it. Most people use the most recent classes, and I would personally never use the old categories, unless I had to for reasons of backward compatibility. They still work perfectly well.

  • mutable/immutable object

    I have the collection object Freservation in ArrayCollection.those are link to call custom combobox txtRefNo and _acDataProvider is the dataprovider property name._nSelectedIndex is the name of the SelectedIndex property.

    My problem is when I change the freservation object, he is considering this value in the ArrayCollection also(original object) collection. I need not do so. I have ant to avoid it.

    Any ideas?

    It is this average object is mutable? If yes how can I convert to immovable object.

    < valueObjects:Freservation id = "freservation" / > ""

    protected function onSelectReservation(event:Event):void
    {

    freservation = new Freservation();
    freservation = txtRefNo._acDataProvider.getItemAt (txtRefNo._nSelectedIndex) like Freservation;

    }

    It's like the normal drop-down list box

    protected function onSelectReservation(event:Event):void
    {

    freservation = new Freservation();
    freservation = txtRefNo.dataProvider.getItemAt (txtRefNo.selectedIndex) like Freservation;

    }

    It's a little difficult to understand what you are after, but if I understand correctly you must copy your Freservation objects deep in your ArrayCollection collection

    Take a look at mx.utils.ObjectUtil.copy

  • Collection ArrayCollection in flex and ArrayList in java




    Salvation of this world don't
    Here I am with my problem with the hope someone can solve it
    I am totally new to flex and I work only for 3 days in flex. and I learned a little more.
    I want to get the values of database that is received from java to flex datagrid object by using the data provider.
    I did quite well in my opinion. But I could not produce the result in the data grid. Since I am very new. I don't know what is happening.

    my code is here, please help me.

    My mxml file: Myadmin.mxml

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "vertical" >
    < mx:RemoteObject id = "ber" destination = "dock" showBusyCursor = "true" fault = "faultHandler (event)" > "
    < name mx:method = "getBerth" result = "resultHandler (event)" / >
    < / mx:RemoteObject >

    < mx:Panel id = 'Top' title = "MaBase" width = "100%" height = "40%" enabled = "true" >
    < mx:TextArea id = "sql" width = "100%" height="100%"/ >

    < mx:Button label = "Execute" click = "handleSend ()" / >

    < / mx:Panel >

    < mx:Panel id = "bottomPanel" title = "Results" width = "100%" height = "60%" enabled = "true" >
    < mx:DataGrid id = "dg" dataProvider = "{result}" width = "100 percent" height="100%"/ >


    < / mx:Panel >
    < mx:Label id = "resultLabel" text = "Onumae puriyale ulgathulae" / >

    < mx:Script >
    <! [CDATA]

    Mx.rpc.events import. *;
    Import mx.collections. *;
    Mx.controls import. *;
    Import mx.utils.ObjectUtil;




    caching empty ArrayCollection collection so that we don't continue to create
    new

    private var emptyResults:ArrayCollection = new ArrayCollection();

    [Bindable]
    public var result: ArrayCollection collection = emptyResults;







    private void resultHandler(event:ResultEvent):void
    {
    Alert.Show ("event.result table of results", ObjectUtil.toString (event.result as ArrayCollection collection));
    result = ArrayCollection (event.result);
    var myCursor:IViewCursor=result.createCursor();
    var oldLength:int = result.length;

    Alert.Show (oldLength.ToString ());




    }

    private void faultHandler(event:FaultEvent):void
    {
    Alert.Show (event.fault.faultString, "Error");
    }

    private function handleSend (): void
    {


    ber.getBerth ();


    }




    []] >
    < / mx:Script >


    < / mx:Application >

    My java object: Berth.java


    package samples.sqladmin;
    import java.sql. *;
    Import Java.util;
    import java. IO;

    public class Berth

    {
    Public Shared Sub main (String args []) throws exceptions
    {
    List ArrayList = getBerth();
    System.out.println ("the list is =" + list);
    }

    public static ArrayList getBerth () throws Exception {}
    Connection con = null;
    Statement st = null;
    ResultSet rs = null;
    ResultSetMetaData rsmd = null;
    List ArrayList = new ArrayList();
    HashMap line = null;
    try {}
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch (ClassNotFoundException nctf) {}
    System.out.println (CNFE.getMessage ());
    }
    try {}
    con = DriverManager.getConnection ("jdbc:odbc:Jurong", "","");
    St = con.createStatement ();
    String sql = "select * berth;
    RS = ST. ExecuteQuery (SQL);
    rsmd = rs.getMetaData ();
    int colCount = rsmd.getColumnCount ();
    While (RS. Next {}
    line = new HashMap();
    for (int i = 1; i < = colCount; i ++) {}
    Row.put (rsmd. GetColumnName (i), rs.getString (i));
    }
    List.Add (Row);
    }

    }
    {} catch (SQLException sqle)
    System.out.println ("enna da yogans eeeeee...");
    System.out.println (sqle.getMessage ());
    }

    If (con! = null)
    con. Close;
    If (st! = null)
    St.Close ();
    back list;

    }

    }

    my remote-config file is:

    < destination id = "dock" >
    Properties of <>
    samples.sqladmin.Berth < source > < / source >
    < / properties >
    < / destination >

    I got the table in flex collection object, but it gives the values received in java

    Please help me.
    Thanks in advance
    yogans.

    Hi my dear friends

    I'm sorry to put you in trouble. I got the result. The problem is
    not with the code. its with my system. The problem is that I have configured
    same name for datesource for system and user DSN DSN name. After that I deleted
    a user DSN data source. I got it working.

    Thank you very much william, thank you much Nelson for your spontaneous response

    Thank you
    Yogans

  • How do choices about Collection types

    I am trying to recover data using its giving collection objects
    ORA-01427: einreihig subquery returns more than one line, but if I use slider nested its working fine.


    (Patient) CREATE TABLE
    number of patid
    fname varchar2 (25).
    name varchar2 (25)
    );


    INSERT INTO patient
    (
    patid, fname lastname
    )
    VALUES (1, 'Pat1_FirstName', 'Pat1_Lastname');

    INSERT INTO patient
    (
    patid, fname lastname
    )
    VALUES (2, 'Pat2_FirstName', 'Pat2_Lastname');


    CREATE TABLE patient_add)
    number of patid
    address1 varchar2 (50).
    address2 varchar2 (50).
    State varchar2 (2),
    zip of varchar2 (5)
    );



    INSERT INTO patient_add
    (
    Address1, Address2, State, patid, zip
    )
    VALUES (1, 'first Add1', 'Add2', 'NJ', ' 08817');

    INSERT INTO patient_add
    (
    Address1, Address2, State, patid, zip
    )
    VALUES (1, 'second Add1', 'Add2', 'CT', ' 04461');



    SELECT a.*, cursor (SELECT b.patid, b.address1, b.address2, b.state, zip
    OF patient_add b
    WHERE a.patid = b.patid
    )
    address
    OF THE patient;

    PATID FNAME LASTNAME ADDRESS
    1 Pat1_FirstName Pat1_Lastname (CURSOR)
    2 Pat2_FirstName Pat2_Lastname (CURSOR)

    Its working fine

    CREATE TYPE pat_obj
    AS
    OBJECT (patid number, varchar2 fname (25), name varchar2 (25))


    CREATE TYPE pat_add_obj
    AS
    OBJECT)
    number of patid
    address1 varchar2 (50).
    address2 varchar2 (50).
    State varchar2 (2),
    zip of varchar2 (5)
    )


    CREATE or REPLACE TYPE pat_add_col IS TABLE OF THE pat_add_obj


    CREATE TYPE pat_det_obj AS OBJECT (pat pat_obj, pat_add_list pat_add_col)


    CREATE or REPLACE TYPE pat_det_obj_col IS TABLE OF THE pat_det_obj


    SELECT pat_det_obj_col (pat_det_obj (pat_obj (patid, fname, lastname),
    (SELECT pat_add_col (pat_add_obj (b.patid,
    b.Address1,
    b.address2,
    b.State,
    zip
    ))
    OF patient_add b
    WHERE a.patid = b.patid)
    )
    )
    PATIENT one

    -ORA-01427: einreihig subquery returns multiple rows

    Anyway, is that we can make selection with PL/SQL

    Thank you
    Alen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Try

    select pat_det_obj_col (
              pat_det_obj (
                 pat_obj (patid, fname, lastname),
                 cast (
                    multiset (
                       select b.patid, b.address1, b.address2, b.state, zip
                         from patient_add b
                        where a.patid = b.patid) as pat_add_col)))
      from patient a
    
  • Problem with BULK collect and variable of Table type

    Hi all
    I defined a record type and then set an index - by table of this record type and in bulk has collected the data as shown in the code below. All this was done in an anonymous block.

    Then when I tried to set the record as an object type and not the above activities type, I got the below error:

    ORA-06550: line 34, column 6:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 31, column 4:
    PL/SQL: SQL statement ignored

    Could you help me get the result of the first scenario with record type defined as an object?
    /* Formatted on 2009/08/03 17:01 (Formatter Plus v4.8.8) */
    DECLARE
       TYPE obj_attrib IS TABLE OF num_char_object_1
          INDEX BY PLS_INTEGER;
    
       obj_var   obj_attrib;
    
       TYPE num_char_record IS RECORD (
          char_attrib   VARCHAR2 (100),
          num_attrib    NUMBER
       );
    
       TYPE rec_attrib IS TABLE OF num_char_record
          INDEX BY PLS_INTEGER;
    
       rec_var   rec_attrib;
    BEGIN
       SELECT first_name,
              employee_id
       BULK COLLECT INTO rec_var
         FROM employees
        WHERE ROWNUM <= 10;
    
       FOR iloop IN rec_var.FIRST .. rec_var.LAST
       LOOP
          DBMS_OUTPUT.put_line (
             'Loop.' || iloop || rec_var (iloop).char_attrib || '###'
             || rec_var (iloop).num_attrib
          );
       END LOOP;
    
       SELECT first_name,
              employee_id
       BULK COLLECT INTO obj_var
         FROM employees
        WHERE ROWNUM <= 10;
    END;
    Here's the code for num_char_object_1
    CREATE OR REPLACE TYPE NUM_CHAR_OBJECt_1 IS OBJECT (
       char_attrib   VARCHAR2 (100),
       num_attrib    NUMBER
    );

    Welcome to the forum!

    You should be collecting objects in bulk, something like

    SELECT NUM_CHAR_OBJECt_1  (first_name,
              employee_id)
       BULK COLLECT INTO obj_var
         FROM emp
        WHERE ROWNUM <= 10;
    
  • How do I solve the NonPersistableObjectException

    I have a method that is simple, written in the form:

    Public Shared Sub set (long uniqueId, String value) {}
    Store = PersistentStore.getPersistentObject (uniqueId);
    synchronized (store) {}
    store.setContents (value);
    Store.Commit ();
    }
    }

    This method works very well for the first time, but the second time, it will fail with NonPersistableObjectException.

    Point to be noted is that same unique identification number, I'm updating with the same value.

    You have created an object that extends the string that you store?  If so, you will need to implement Persistable in this object.

    Your own object is also a good idea.  But there is a problem with persistent objects when you upgrade the.  Say, you create an object as follows:

    class MyPersistentObject extends Persistable {}

    String _string1 = null;

    String _string2 = null;

    ....

    String getString1() {}

    Return _string1;

    }

    ...

    }

    Now for V2, you want to add another string, so you must

    class MyPersistentObject extends Persistable {}

    String _string1 = null;

    String _string2 = null;

    String _string3 = null;

    ....

    String getString3() {}

    Return _string3;

    }

    ...

    }

    Now because you have changed the structure of this persistent object, you actually have the persistent class on the incompatible device with your upgrade.  To install, users will have to delete the old application, lose the stored data.

    However if you did to begin with:

    class myPersistedObject extends IntHashTable implements Persistable {}

    ...

    String getString1() {}

    Return this.get (1);

    }

    ....

    }

    Then to add another channel, you simply add the get method:

    class myPersistedObject extends IntHashTable implements Persistable {}

    ...

    String getString3() {}

    Return this.get (3);

    }

    ....

    }

    The structure does not change and it is compatible.

    The above code is NOT correct, I hope you get the idea.

    Then create your own class, but extends a Collection object and you get the flexibility and scalability.

    Hope it makes sense.

  • EventListener (s)

    If I use

    stage.removeChild (MonIdentificateur)

    MonIdentificateur = null;

    which will remove all eventListeners attached to this asset?

    I have attached through the main.as class or class of assets eventListeners real itself.

    When I remove this asset would I go through and remove every 1 by 1 of the Auditor in the same way, they were added?

    stage.removeEventListener (event. Event, eventIdentifier);

    myIdentifier.removeEventListener (event. Event, eventIdentifier); <-this will work if the event listener is added in the Class.as and not in the Main.as im coding class in?

    Sorry if it's confusing, im fairly new to all this

    In practice, any class that contains a call to the method addEventListener() on a target must have a removeEventListener() call in the same class. Call removeEventListener() in another class file, should be what another class related to both the target of the event (MonIdentificateur) listener and the callback function (eventIdentifier), otherwise she would get an error.

    When you remove event listeners, just make sure that this happens before calling 'MonIdentificateur = null;'.

    Simply remove an object a pile of display display does not remove its event listeners, and could prevent the garbage collected object because event listeners could potentially be perpetuating the object. According to the AS3 documentation, if you set useWeakReference to true it would allow it to be garbage collected, but it is always advisable to remove all event listeners that you add.

    I'd rather have a shutdown() method (or destroy() or dispose()) that cleans an object I am wanting to get rid completely of who manages all the removal of event listeners and setting variables to null values.

Maybe you are looking for

  • 32AV933G: is it possible to access the image user mode play movies on USB

    Hello! Recently, I bought a 32AV933G, based on the features and was very surprised by the good image quality. My question: is it possible to access the image of the user mode when playing movies media player USB?I can't get the preset Standard, mild,

  • Portege R100 laptop computer does not start after a while without food

    Hello Well there is some time, I bought a beautiful used R100 - a laptop Toshiba in passing - but now, she has developed an annoying problem. Whenever it disconnect the laptop from the power supply for more than 2 hours about (don't know if this is n

  • Update failure code error 0x800B0 100

    This nVidia GeForce update keeps not everyday on automatic update of Windows.  How can I do work or, Alternatively, just stop keep presenting themselves again.

  • Rhapsody WMP + microSD use

    Beginner with several questions: I use Rhapsody-to-Go to synchronize my 4GB fuse and added a 4 GB microSD card. Can I use an adapter to plug the microSD directly to a computer and add songs to help drag / move, or it will mess up the timing of Rhapso

  • HP Pavilion dv6529em could not start

    The hp pavilion dv6529em was fully functional and load.  Laptop has been moved and the plug of the charger is removed unintentionally.  Laptop was turned off, charger off the power and then reconnected to the laptop.  Now, laptop is recycled during t