How to delete similar type of object present in vector

i am having a vectors which has many elements like
scratchA:MYRAMA:rama:t0001p1.qo@proc_0:H
scratchA:MYRAMA:rama:t0001p1.qo@proc_0:H
scratchB:MYRAMB:ramb:t0001p2.qo@proc_0:M
i want to delete all objects which have string value common like 1 and 2 above. for this i had written some thing like this
for(int k = 0;k < cycleEvents.size();k++){
if(Temp_count.equalsIgnoreCase((String)(((CacheCycleEvent)cycleEvents.get(k)).getVarModSegName()))){
cycleEvents.remove(k);
here temp_count consist of above string. the problem here is if i do remove(k), the string at k+1 will become k, so it will not be deleted sa value of k has been incremented.

Try running this example:
Vector v = new Vector();
v.add("a");
v.add("a");
v.add("b");
v.add("a");
System.out.println(v);
while(v.remove("a"));
System.out.println(v);edit:
But maybe I misunderstood you...Why do it the hard way?
Set unique = new HashSet(v);Kaj

Similar Messages

  • How to delete inspection type assigned in material on mass level

    Hi Team,
    How to delete inspection type assigned in material on mass level. This inspection type is assigned in material master with indicator set as"Task List", however we are using "material specification". This inspection type is assigned to material type using t-code QA08.
    I can deactivate this inspection type using QA08, but I want to delete this record from material master first. So that it would adopt my config. next time when I will assign again insp.type in QA08. I have set this indicator in config. of insp. type as default to "material specification".
    Pls suggest me solution to delete this insp. type record from material master.
    Thanks

    hi
    if Material speciiication and task lists are checked -- then no need to do anything,
    but only task list checked and u want to do based on mat.spec -- then you need to deactivate and reassign same inspection type using QA08.
    no other way, ensure ur stocks are not in QI
    thanks
    Sami

  • How to delete a portal system object?

    Hello,
    i've created a portal system object in the system landscape of the portal content with the template KM Windows System. Now i want to delete the created system object. How i can do this?
    Best regards,
    TomSd

    Hi,
       You only have 'Read' Permission for your system. In order to delete it,log in to the portal using as a superadministrator(the user who has 'Full Control' or 'Owner' permissions for all objects in portal).
    Go to System Administration->Permissions. Right click on the system that you intend to delete and open 'Permissions'.
    In the 'Search for' Input field type in your username and select'Users'in the dropdown .Add the user and assign 'Full Control' for the user.
    Login to portal using your userid.Now you will be able to delete the user by rightclicking on the system and clicking on 'Delete'.
    Regards,
    Srinath

  • How to create multiple TYPES of objects from one menu?

    Q: How can I create a single class to create objects of multiple 'object classes' in a way that is not a huge switch statement?
    Explaination:
    Let's say that I have an application that I am building, that manages five hundred object types. A properly-built object subclassing tree is created, and I want to be able to create objects of any 'leaf node' of this subclassing tree using a single 'objectCreate()' method in a 'factory object'. The purpos of this method will be to create an instance of the correct object, pass a handle to a few collections for properly sorting and storing these objects in groups.
    Usually, one could create a switch in this function, testing for the type of object that the user wants to create from the menu. But in the case of having hundreds of possible object choices, this becomes harder and harder code to maintain (let alone performance).
    Any suggestions?

    But if my menu has:
    1. German Shepard
    2. Doberman Pinscher
    3. Malamut
    4. Persian Long-hair
    5. Siamese
    6. Tabby
    And my object class tree goes:
                                  [ Animal ]
                 [ Cat ]                              [ Dog ]
      [ various breeds ]                         [ various breeds ]How do I code the menu class to respond to the input, so that it runs the correct [breed] object's constructor?
    The line:
    Animal choice = new xxxxxxxx();
    I can't use a variable to replace 'xxxxxxxx' in run-time, but having a ton of choices in code sounds/looks unreasonable.
    if (choice == "Doberman Pinscher")
    Animal choice = new doberman();
    else if (choice == "Tabby")
    Animal choice = new tabby();
    Do you see what I am trying to avoid? I am not experienced enough to instantly realize how to avoid the latter, and instead, do a single instantiation command for the correct constructor.

  • How to delete sub types in a wage type

    hi experts,
    how to delete the subtypes in a wage type . with out deleting the wage type but it should not display in the wage type list

    Hi Deepti,
    Its not deletions, I think u need restriction based on the employee sub group and personnel sub area.
    For this u have to do the following settigns
    1. Maintain grouping for Employee sub grp in table  V_503_G
    2.Maintain the grouping for Personnel Sub area in table V_001P_K
    3. Then go to the table V_511_B and double click on the wage type, u will be able to view 0 to 9 for EES, & PS
    In step 2 & 3 what ever the groupings u have maintained under that number maintain the value '1' and remaining field leave blank. So that the wage type will apllicable and visible to those EES & PS only
    If you don't want for any EES & PS then maintain all the numbers with blank in the table V_511_B. That will not display in the list.
    Never try to delet the wage type, it leads to errors
    Kumar

  • How to get similar color for objects in different pictures

    how do you get similar color for objects in different pictures
    I have a prodject that i'm working on and i need to edit several images at once (preferabley) so that they are the same color. They are wooden cupboards and i need all the wood looking the same colour. In light room you can edit a group of images at the same time hence the colours are the same . Is this possible in Elements ? If so how do i do this ?
    I have tried duplicating layers and it just replaces the whole image, it seems to work using levels layers but not the other layers ... I have 30 more images to do and would ideally not like to adjust all the images manually ? I dont mind doing minor tweaks. Essentially all the images where taken with the same camera and lighting and lens's ...
    Screen shot is where I'm at at the moment...
    I have posted this question else where but was told to repost  - this is a link to my previous post as to where we got to
    http://forums.adobe.com/message/4720576#4720576

    You could try using the raw converter. Open one file and edit it (File>Open, pick the image and choose Camera Raw as the format before you click Open). Then open the next image and click the little four-lined square on the upper right side of the ACR window and choose Previous Conversion from the flyout menu.

  • How to delete CS and ID objects

    Hi
    How to delete configuration scenario including all objects in ID so that it should not come back if I do reject changes in ID change List
    Thanks,
    srini

    Srinivas,
    You can delete the individual objects under the configuration scenario and then delete the configuration scenario. If you think that you may use some of the objects in future then you can just remove it from the scenario. after deletion , go to activation tab and activate it , this would complete the deletion procedure. Reject chnages would bring back the deleted stuff back to scenario so don't use that.
    Hope this helps
    Thanks and Regards
    Arvind

  • How to distinguish the type of object that came in the JMS message.

    I have a queue that has 4 different object's being sent through messages across the queue. Depending on the object that comes in I need to determine what process to start. I have created a master project with a single queue listener that will start the master process. Either before the listener starts the master process or after the master process starts in a method I need to figure out the type of object that was contained in that method. In Java its simply if(msg InstanceOf ObjectB), else if (msg InstanceOf ObjectC)....and so forth. What is the way this would be done in ALBPM6.0's fuego code or whatever it is called?

    In case you had an ID, which is assigned automagically on emp, this could also be written like this:
    create trigger emp_trig
    after insert or update or delete on emp
    for each row
    begin
    insert into emp_log values(
    :new.empno, :new.ename,
    decode(nvl(:old.id,-1),-1,'Insert',decode(nvl(:new.id,-1),-1,'Delete','Update')), sysdate);
    end;
    ..where -1 is a value you do not expect to be propagated ever in id column. Also, :new.empno and :new.enmae will be null if the dml being executed is a delete statement.

  • How to find the type of objects contained in a Stored Package?

    Hello,
    I need to populate all the procedures and functions contained in a package. I have rewritten a query like this
    "SELECT PROCEDURE_NAME FROM ALL_PROCEDURES WHERE OBJECT_NAME = 'MYPACKAGENAME'
    Above Query returns a record, having NULL PROCEDURE_NAME value. Why?
    I also want the 'type' of object (stored procedure/function ) contained in the a package.
    How to fetch it?
    Following query always returns object type 'PACKAGE', which is of no use for me. I want to know if it is stored procedure or function.
    SELECT PROCEDURE_NAME, *OBJECT_TYPE* FROM ALL_PROCEDURES WHERE OBJECT_NAME = 'MYPACKAGENAME'
    Cheers,
    Machhindra

    Hi,
    Just thinkin Out of Box way... :-
    Microsoft Windows [Version 5.2.3790]
    (C) Copyright 1985-2003 Microsoft Corp.
    F:\Documents and Settings\Administrator>sqlplus scott/tiger@service1
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 26 21:49:03 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE OR REPLACE PACKAGE emp_mgmt AS
      2  FUNCTION hire (last_name VARCHAR2, job_id VARCHAR2,
      3     manager_id NUMBER, salary NUMBER,
      4     commission_pct NUMBER, department_id NUMBER)
      5     RETURN NUMBER;
      6  FUNCTION create_dept(department_id NUMBER, location_id NUMBER)
      7     RETURN NUMBER;
      8  PROCEDURE remove_emp(employee_id NUMBER);
      9  PROCEDURE remove_dept(department_id NUMBER);
    10  PROCEDURE increase_sal(employee_id NUMBER, salary_incr NUMBER);
    11  PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER);
    12  no_comm EXCEPTION;
    13  no_sal EXCEPTION;
    14  END emp_mgmt;
    15  /
    Package created.
    SQL>
    SQL> SELECT PROCEDURE_NAME FROM ALL_PROCEDURES WHERE OBJECT_NAME = 'EMP_MGMT';
    PROCEDURE_NAME
    CREATE_DEPT
    HIRE
    INCREASE_COMM
    INCREASE_SAL
    REMOVE_DEPT
    REMOVE_EMP
    6 rows selected.
    Now you requirement
    SQL> SELECT PROCEDURE_NAME,A.OBJECT_NAME,OBJECT_TYPE FROM ALL_PROCEDURES A, USER_OBJECTS UO WHERE UO.OBJECT_NAME = A.O
    BJECT_NAME AND A.OBJECT_NAME='EMP_MGMT';
    PROCEDURE_NAME                 OBJECT_NAME
    OBJECT_TYPE
    REMOVE_EMP                     EMP_MGMT
    PACKAGE
    REMOVE_DEPT                    EMP_MGMT
    PACKAGE
    INCREASE_SAL                   EMP_MGMT
    PACKAGE
    PROCEDURE_NAME                 OBJECT_NAME
    OBJECT_TYPE
    INCREASE_COMM                  EMP_MGMT
    PACKAGE
    HIRE                           EMP_MGMT
    PACKAGE
    CREATE_DEPT                    EMP_MGMT
    PACKAGEIn oder to know the type of Object why don't you simple decribe in order know the Object definition it self.. instead of firing queries...Don't you thinl it easy of use.. !! you will get better Explanation about your Package
    SQL> desc EMP_MGMT;
    FUNCTION CREATE_DEPT RETURNS NUMBER
    Argument Name                  Type                    In/Out Default?
    DEPARTMENT_ID                  NUMBER                  IN
    LOCATION_ID                    NUMBER                  IN
    FUNCTION HIRE RETURNS NUMBER
    Argument Name                  Type                    In/Out Default?
    LAST_NAME                      VARCHAR2                IN
    JOB_ID                         VARCHAR2                IN
    MANAGER_ID                     NUMBER                  IN
    SALARY                         NUMBER                  IN
    COMMISSION_PCT                 NUMBER                  IN
    DEPARTMENT_ID                  NUMBER                  IN
    PROCEDURE INCREASE_COMM
    Argument Name                  Type                    In/Out Default?
    EMPLOYEE_ID                    NUMBER                  IN
    COMM_INCR                      NUMBER                  IN
    PROCEDURE INCREASE_SAL
    Argument Name                  Type                    In/Out Default?
    EMPLOYEE_ID                    NUMBER                  IN
    SALARY_INCR                    NUMBER                  IN
    PROCEDURE REMOVE_DEPT
    Argument Name                  Type                    In/Out Default?
    DEPARTMENT_ID                  NUMBER                  IN
    PROCEDURE REMOVE_EMP
    Argument Name                  Type                    In/Out Default?
    EMPLOYEE_ID                    NUMBER                  IN
    SQL>- Pavan Kumar N

  • How to delete or rename an object that has been created in IR.

    Dear friends
    I have transfered a software component from SLD.
    But if I want to rename this so that I can re-import it from SLD or delet this transfered SWC object, how can i do it.
    I see a 'delete' option under the menu item Object, but it is grayed out and cannot be used.
    Any suggestions or feedback will be greatly appreciated.
    Thanks

    Gregor,
    You can delete it by double clicking on the software component. And in the right frame choose Software Component Version - Delete.
    raj.

  • How To delete Inspection type permanently  in Mass processing?

    Hi SAP gurus,
    I have activated an inspection type 04. Later i found that tis particular inspection type is not useful for me. Using qa08 i deactivated this particular inspection type. But still materials goes to Quality Inspection (QI). But i want materials to go to Unrestricted Use directly. How to delete this inspection type permanently in mass processing.. Or please say me a other solution to make material go to Unrestricted use..
    Thanks in advance..

    Hi Paul..
    Yes i deactivated the inspection type after production is created. You have said that the inspection is still in "Q". Please say me how to find this. Another thing is, i found another option to send it to unrestricted. When doing GR, i selected stock type as Unrestricted. Since 04 inspection type is deactivated, its now going directly to unrestricted even after the production order is created before deactivation.
    Thanks a lot for your help.

  • How to pass any type of objects into Portal's rules engine?

    Is that possible to pass any type of objects into Portal's rules engine? Or BEA's Portal service rules engine can only allow to pass a limited number of objects?
    Are there any information about BEA's rules engine? and Can we use its rules engine without using its Portal service?
    Thank you.

    I worked on BEA rules engine 4 months back. I'm sure you can pass any JAVA object to it's working meomory. I am giving my sample rules here, hope it will be helpful for you.
    I just replace pcakage name, other than that everything is from wroking project. Open in xml spy, it should be clear from the desc. If you have any questions post back.
    <cr:rule-set is-complete="true" xmlns="http://www.bea.com/servers/p13n/xsd/expression/expressions/2.1.1" xmlns:cr="http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1" xmlns:literal="http://www.bea.com/servers/p13n/xsd/expression/literal/1.0.1" xmlns:string="http://www.bea.com/servers/p13n/xsd/expression/string/1.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1 rules-core-2_1_1.xsd">
         <cr:rule is-complete="true">
              <cr:name>TaxForm1040</cr:name>
              <cr:description>If salary is 70,000 then this rule makes 1040 as required form</cr:description>
              <cr:conditions>
                   <multi-and>
                        <multi-and>
                             <equal-to>
    <instance-method>
    <variable>
    <name>SalaryField</name>
    <type-alias>com.blah.field.REInputObject</type-alias>
    </variable>
    <name>getKey</name>
    </instance-method>
    <literal:string>Salary</literal:string>
    </equal-to>
    <equal-to>
    <instance-method>
    <variable>
    <name>SalaryField</name>
    <type-alias>com.blah.field.REInputObject</type-alias>
    </variable>
    <name>getValue</name>
    </instance-method>
    <literal:integer>70000</literal:integer>
    </equal-to>
                        </multi-and>
                   </multi-and>
              </cr:conditions>
              <cr:actions>
                   <new-instance>
                        <type-alias>com.blah.field.RequiredField</type-alias>
                        <arguments>
                             <literal:string>1040</literal:string>
                        </arguments>
                   </new-instance>
              </cr:actions>
         </cr:rule>
    </cr:rule-set>

  • How can I store a File object into a Vector and get it back

    hi there
    I need to store a number of File object into a Vector first, and later on I need to get each File object out and work with it.
    Vector mylist;
    File[] myfile;
    ....get a list of files from using File Chooser
    mylist = new Vetor();
    for (i=0;i<myfile.length;i++){
    mylist.add(myfile);
    ..how do I get them back? i try to do this way
    for (i=0;i<mylist.size(); i++)
    File tempfile = mylist.get(i);
    ..work with tempfile. but I got java.lang.object error: imcompatible types. what can I do?

    Vector mylist;
    File[] myfile;
    ....get a list of files from using File Chooser
    mylist = new Vetor();
    for (i=0;i<myfile.length;i++){
    mylist.add(myfile);
    ok try this: i don't reall understand what your trying to do though...
    File[] files;
    // get files
    Vector fileList = new Vector();
    for (int i = 0; i < files.length; i++)
      fileList.add(files);
    // to get them out.
    for (int i = 0; i < fileList.size(); i++)
    ((File)fileList.elementAt(i)).toString();
    // or
    // to get them out.
    for (int i = 0; i < fileList.size(); i++)
    File temp = (File)fileList.elementAt(i);
    System.out.println(temp.toString);

  • How do you compile "type body" objects that are invalid?

    We just completed a few application upgrades and now the objects catindexmethods and textindexmethods are invalid. These are part of our intermedia install but haven't started using it yet. How to I recompile these objects to be valid again?

    Did a little deeper and you shall find it:
    alter type xxx compile body;

  • How to delete/mark obsolete database objects from ODI model?

    Hi,
    ODI never deletes objects while reverse engineering.
    So is it way to automate deletion or marking obsolete database objects (dropped or renamed fields, constraints) from an ODI model?
    Does someone use ODI Java API (http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e17060/overview-tree.html) or direct updating SNP_% repository tables to do it?

    I can help you with marking obsolete database objects.
    In the model, there is an option "Display the metadata changes in the Model Tree". Check this.
    This will show you what has changed or is obsolete.

Maybe you are looking for