QuickSort in HashTable - Urgent

I am using jdk1.1.8. I need a program for sorting Hashtable. because there is no class Map in this version. I am using POS system. This only accepts jdk1.1.8.
It is urgent. Can any one send the code pls
regards,
namanc

Try something like:
public class KeyValue {
  private Object key;
  private Object value;
  public KeyValue( Object key, Object value ) {
    this.key = key;
    this.value = value;
  public Object getKey() { return key; }
  public Object getValue() { return value; }
  public String toString() {
    return "[ "+key +", "+value +"]";
  /* testing */
  public static void main( String[] args ) {
    Hashtable ht = new Hashtable();
    ht.put("D","d");
    ht.put("A","a");
    ht.put("H","h");
    Vector v = new Vector();
    Enumeration enum = ht.keys();
    while (enum.hasMoreElements()) {
      Object key = enum.nextElement();
      Object val = ht.get( key );
      v.add( new KeyValue( key, val ) );
    Comparator c = new Comparator() {
      public boolean equals( Object o1, Object o2 ) {
        KeyValue k1 = (KeyValue)o1;
        KeyValue k2 = (KeyValue)o2;
        return k1.getKey().equals( k2.getKey() );
      public int compare( Object o1, Object o2 ) {
        KeyValue k1 = (KeyValue)o1;
        KeyValue k2 = (KeyValue)o2;
        String s1 = (String)k1.getKey();
        String s2 = (String)k2.getKey();
        return s1.compareTo( s2 );
    System.out.println("Before");
    printVector( v );
    QuickSort.sort( v, c );
    System.out.println("After");
    printVector( v );
  private static void printVector( Vector v ) {
    for (int i = 0; i < v.size(); i++) {
      System.out.println(v.get(i));

Similar Messages

  • Urgent help: sort hashtable

    can anyone please show me som code that sort a Hashtable, like the one below, by its keys.
    Hashtable ole = new Hashtable();
    ole.put(new Integer(2),"erik2");
    ole.put(new Integer(1),"erik1");
    ole.put(new Integer(4),"erik4");
    ole.put(new Integer(3),"erik3");
    ( yes I need to access the items in a particular order )

    http://forum.java.sun.com/thread.jsp?forum=31&thread=151707
    Don't post identical questions. You will make ppl angry and no one will want to help you.

  • Reposting:urgent....how to use hashtable values

    Hi
    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).
    is it <hashtable>.get(object name);
    if it is what should be my object name...is it VO attribute of LOV???or the Id in that lov page??
    please help me out..
    Regards
    Sandeep.G

    if(pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
    if (lovResults != null)
    value = (String) lovResults.get("<Lov Item Name>");
    }

  • Please HELP on Button Click. URGENT Folks.!!!

    Folks,
    I need some very URGENT help.
    When I click a Button,how do I associate this Button clicked with a particular Key?
    I am reading data from a Hashtable in the foll.format
    Monday Data [ More Info]
    Tuesday Data [ More Info]
    where :
    Data to display is a Label
    [More Info] is a JButton.
    But I am unable to associate the button clicked with that particular Data.
    ie I am unable to link the button clicked with the Key its associated to.
    So when I click the 2nd More Info Button,I must be associated with Tuesday Data.
    I am not being able to link Button Clicked to its Key Value.
    Any one can help me to get the Key Value please?
    Or is displayng thru Hashtable not right? Do I need to use some
    other collection.
    My code is:
    public class JPanelDemo extends JFrame{
    private JPanel JButtonPanel;
    private Hashtable ht = new Hashtable();
    Enumeration enum;
    String str;
    public JPanelDemo() {
    JButtonPanel = new JPanel();
    Container c = getContentPane();
    // Put Data into Table.
    ht.put("Monday ", new JButton("More Info"));
    ht.put("Tuesday ", new JButton("More Info"));
    ht.put("Wednesday ", new JButton("More Info"));
    ht.put("Thursday ", new JButton("More Info"));
    JButtonPanel.setLayout(new GridLayout(ht.size(),ht.size()) ) ;
    // Instantiate ButtonHandler.
    ButtonHandler handler = new ButtonHandler();
    // Enumerate thru Keys.
    enum = ht.keys();
    while(enum.hasMoreElements()){
    str = (String) enum.nextElement();
    JButtonPanel.add(new JLabel(str)); // Key
    JButton jB = (JButton)ht.get(str); // Value
    JButtonPanel.add(jB);
    jB.addActionListener(handler);
    c.add(JButtonPanel,BorderLayout.NORTH);
    show();
    public static void main(String[] args) {
    JPanelDemo JPanelDemo1 = new JPanelDemo();
    // Inner Class for BUTTON handling.
    private class ButtonHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    JOptionPane.showMessageDialog(null,
    "You Pressed " + e.getActionCommand(),
    "I NEED THE KEY VALUE HERE", /* key VALUE required ie Monday,Tuesday..*?
    0);
    } // End ButtonHandler.
    } // End of class

    Hi,
    i have modified your program to produce the intended results..
    Hope this helps!
    josh
    public class JPanelDemo extends JFrame{
    private JPanel JButtonPanel;
    private Hashtable ht = new Hashtable();
    Enumeration enum;
    String str;
    public JPanelDemo() {
    JButtonPanel = new JPanel();
    Container c = getContentPane();
    // Put Data into Table.
    ht.put("Monday ", new JButton("More Info"));
    ht.put("Tuesday ", new JButton("More Info"));
    ht.put("Wednesday ", new JButton("More Info"));
    ht.put("Thursday ", new JButton("More Info"));
    JButtonPanel.setLayout(new GridLayout(ht.size(),ht.size()) ) ;
    // Instantiate ButtonHandler.
    ButtonHandler handler = new ButtonHandler();
    // Enumerate thru Keys.
    enum = ht.keys();
    while(enum.hasMoreElements()){
    str = (String) enum.nextElement();
    JButtonPanel.add(new JLabel(str)); // Key
    JButton jB = (JButton)ht.get(str); // Value
    JButtonPanel.add(jB);
    jB.addActionListener(handler);
    c.add(JButtonPanel,BorderLayout.NORTH);
    show();
    public static void main(String[] args) {
    JPanelDemo JPanelDemo1 = new JPanelDemo();
    public String compare(JButton b){
    int i = ht.size();
    Enumeration enum1 = ht.keys();
    while(enum1.hasMoreElements()){
    String str = (String) enum1.nextElement();
    JButton jB = (JButton)ht.get(str); // Value
    if( jB.equals(b) ){
    return str;
    return null;
    // Inner Class for BUTTON handling.
    private class ButtonHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    JButton b = (JButton)e.getSource();
    String s = compare(b);
    JOptionPane.showMessageDialog(null,
    "You Pressed " + s,
    "I NEED THE KEY VALUE HERE",0);
    } // End of class

  • JtextPane Help Please  Urgent.

    Hi,
    I need to read text character by character in a TextArea. Further, if the text is boldm italic etc. I also need to display it that way. I have done this with JTextArea. But, it does not allow me to use the features like bold, italic etc. I also need to have scrolling with the text area. I know that this can be done by JTextPane or JEditorPane. I tried to use JtextPAne, but the text does not get displayed.
    I have used setText and getText methods and added textPane to scrollPane but no use.
    Can someone please help with this? It is kind of urgent.
    Thanks in advance.
    sjl

    You must use sone default action on JTextPane component assign it to a menu item or toolbar button and after can add some style to text inserted...remember that must add a StyledEditorKit() to your component in such way that can add some default functionality.
    public class SimpleEditor extends JFrame {
         protected JTextPane textComp;
         protected Hashtable actionHash = new Hashtable();
         public SimpleEditor() {
              super("SimpleEditor");     
              textComp = createTextComponent();
              hashDefaultActions();
              makeActionsPretty();
              Container content = getContentPane();
              content.add(createToolBar(), BorderLayout.NORTH);
                                               scroll = new JScrollPane(textComp);
              content.add(scroll , BorderLayout.CENTER);
              setSize(320, 240);
                          protected JTextPane createTextComponent() {
              JTextPane ta = new JTextPane();
              ta.setEditorKit(new StyledEditorKit());
              return ta;
                             protected void hashDefaultActions() {
              Action[] actions = textComp.getActions();
              for (int i = 0; i < actions.length; i++) {
                   String name = (String) actions.getValue(Action.NAME);
                   actionHash.put(name, actions[i]);
    // You can add your custom action
         protected void makeActionsPretty() {
              Action a;
              a = getHashedAction(DefaultEditorKit.cutAction);
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a.putValue(Action.NAME, "Taglia");
              a = getHashedAction(DefaultEditorKit.copyAction);
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a.putValue(Action.NAME, "Copia");
              a = getHashedAction(DefaultEditorKit.pasteAction);
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a.putValue(Action.NAME, "Incolla");
              a = getHashedAction(DefaultEditorKit.selectAllAction);
              a.putValue(Action.NAME, "Seleziona tutto");
              a = getHashedAction("font-bold");
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a.putValue(Action.NAME, "Bold");
              a = getHashedAction("font-italic");
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a.putValue(Action.NAME, "Italic");
              a = getHashedAction("font-underline");
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a.putValue(Action.NAME, "Underline");
              a = getHashedAction("font-family-SansSerif");
              a.putValue(Action.NAME, "SansSerif");
              a = getHashedAction("font-family-Monospaced");
              a.putValue(Action.NAME, "Monospaced");
              a = getHashedAction("font-family-Serif");
              a.putValue(Action.NAME, "Serif");
              a = getHashedAction("font-size-10");
              a.putValue(Action.NAME, "10");
              a = getHashedAction("font-size-12");
              a.putValue(Action.NAME, "12");
              a = getHashedAction("font-size-16");
              a.putValue(Action.NAME, "16");
              a = getHashedAction("font-size-24");
              a.putValue(Action.NAME, "24");
              a = getHashedAction("left-justify");
              a.putValue(Action.NAME, "Sinistra");
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a = getHashedAction("center-justify");
              a.putValue(Action.NAME, "Centrato");
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
              a = getHashedAction("right-justify");
              a.putValue(Action.NAME, "Destra");
              a.putValue(Action.SMALL_ICON, //Put your image HERE);
         protected JToolBar createToolBar() {
              JButton button;
              JToolBar bar = new JToolBar();
              // Add simple actions for opening & saving
              button = bar.add(getOpenAction());
              button.setText("");
              button.setFocusable(false);
              button = bar.add(getSaveAction());
              button.setText("");
              button.setFocusable(false);
              bar.addSeparator();
              // Add cut/copy/paste buttons
              button = bar.add(getHashedAction(DefaultEditorKit.cutAction));
              button.setText("");
              button.setFocusable(false);
              button = bar.add(getHashedAction(DefaultEditorKit.copyAction));
              button.setText("");
              button.setFocusable(false);
              button = bar.add(getHashedAction(DefaultEditorKit.pasteAction));
              button.setText("");
              button.setFocusable(false);
              bar.addSeparator();
              JButton toggle = new JButton(getHashedAction("font-bold"));
              toggle.setText("");
              toggle.setFocusable(false);
              bar.add(toggle);
              toggle = new JButton(getHashedAction("font-italic"));
              toggle.setText("");
              toggle.setFocusable(false);
              bar.add(toggle);
              toggle = new JButton(getHashedAction("font-underline"));
              toggle.setText("");
              toggle.setFocusable(false);
              bar.add(toggle);
              toggle = new JButton(getHashedAction("left-justify"));
              toggle.setText("");
              toggle.setFocusable(false);
              bar.add(toggle);
              toggle = new JButton(getHashedAction("center-justify"));
              toggle.setText("");
              toggle.setFocusable(false);
              bar.add(toggle);
              toggle = new JButton(getHashedAction("right-justify"));
              toggle.setText("");
              toggle.setFocusable(false);
              bar.add(toggle);
              return bar;
         public static void main(String[] args) {
              SimpleEditor editor = new SimpleEditor();
              editor.setVisible(true);
    The above code show how to get some default functionality of the JTextPane particularly to StyledEditorKit associated to JTextPane. You can get all default action and after put them as an Action directly to element of JToolBar or JButton...and so you have styled text.
    I hope this help you.
    regards anti-shock

  • Problem with downloading images from image URL's _ Plzz help me urgent

    Hello,
    I have a set of URL's in a hashtable. Now using the the enumerator, for each URL, I am trying to download the Image. The example for the image URL is something like this:
    http://gallery.hd.org/_exhibits/flowers/_more2003/_more09/flower-Holland-Netherlands-RF.jpgI am using ImageIO.read(new URL("URL")) for downloading the image
    My problem is, if I get a URL which is broken link like the below exaple
    http://www.ossrc.org.in/images/cii-shiksha.jpgmy code is waiting for for the data to come in. The code is hanging there. My code does not terminates but hangs and does not proceed futhur. How to resolve this problem. Please tell me.
    Its very urgent plzzzzzzzzz.
    Thanks,
    chaitanya
    Message was edited by:
    RKC

    Oh, too bad, it's urgent. I must be too late.

  • Urgent in my project work

    I have one urgent requirement in our project
    we have of list of requisitions in the page listing ;we will have check boxes to that
    say if i check 5 requisitions
    we will update the status(statuses like pending,processing,rejecting,invalidate)
    when user select reject status we have to send email notification to those users who created those requisitions;when i click update button
    I will get userid and requistionid;
    if we put in hashtable
    userid will come in duplicated but requistionid is unique.
    say data wil come like this;
    ht.put("Vikram",1313);
    ht.put("Shekar",1513);
    ht.put("Shekar",4213);
    ht.put("Vikram",4613);
    ht.put("Vikram",4583);
    ht.put("Ranga",4183);
    dont tell me that compare with userid.equals("Vikram");
    i cant compare like that because i dont know which user can come from database
    how to do this with Hashtable;IS ANY OTHER WAY.
    i want to send one email to user vikram with requistionids 1313,4613,4583
    bye
    chaitanya

    I'm not quite sure what you are asking here. How to retrieve email address? How to distinguish users?
    I can see one problem however Unless you have a specialised Hashtable, you are only allowed to map one key to one value. Subsequent puts will override the old value. Hence, if you call ht.put("Vikram"...) with three different values, only the last one will be kept. You need a unique key to use a hashtable properly.
    What you can do is store each entry in the hashtable as a list. That will then give you a list of ids to notify for each user.
    ie
    "Vikram" = [1313, 4613, 4583]
    "Ranga" = [4183]
    Does that help at all?

  • Hash Table copy to Text file : urgent

    HI
    I have a hash Table which cintaine id's and name pair Now i want to copy or dump this whole table into a Text file, But i do not know how to do this .
    This is very urgent for me.
    Please help me .
    Preeti

    HashTable is Serializable
    use ObjectOutputStream to write to the file and use ObjectInputStream to read from the file
    HashTable ht=new HashTable()
    ht.put("key1","value1");
    ht.put("key2","value2");
    FileOutputStream ostream = new FileOutputStream
    ("Hash.txt");
    ObjectOutputStream oos = new ObjectOutputStream(ostream);
    oos.writeObject(ht);
    oos.flush();
    oos.close();//dont forget thisuse ObjectInputStream To read HashTable from file
    use readObject() method

  • Hashtable proiblem.Please Help

    Folks.
    I am using a Hashtable with the flwg values:
    public class TestHashTable {
    public static void main(String[] args){
    Hashtable balance = new Hashtable();
    Enumeration names;
    String str;
    balance.put("Entertainment","Video");
    balance.put("Settings","Setup");
    balance.put("Entertainment","Audio");
    balance.put("Entertainment","MidpMan");
    balance.put("Pim","Setup");
    /* Show the Hashtable contents */
    names = balance.keys();
    while(names.hasMoreElements()){
    str = (String)names.nextElement();
    System.out.println(str + ":" + balance.get(str));     
           What I am being displayed is:
    Pim:Setup
    Entertainment:MidpMan
    Settings:Setup
    Can a hashtable store duplicate keys? Also what can I do to view all the above elements?
    An urgent response is appreciated?

    In a Hashtable (and any java.util.Map) a single key object maps to a single value object. So if you add multiple values to the same key (as you did) the earlier values get overwritten.
    If you want multiple values per key, then make the key map to a java.util.List, and add to that list. Something like:
    import java.util.*;
    private void helperMethodAddToList(Map m, String key, String value) {
        List vals = m.get(key);
        if (vals == null) {
            vals = new LinkedList();
            m.put(key, vals);
        vals.add(value);
    }That's just a suggestion.

  • URGENT : Custom Connector Reconciliation sample code

    hi all,
    I am looking for a custom connector reconciliation sample code for reference. There is already a custom connector developed for provisioning. Can someone help me out? This is urgent.
    -Mahendra.
    Edited by: Mahendra on Jun 27, 2011 7:08 AM

    You'll need to create a new instance of a scheduled task. Here is a sample Re: Sample CLASSES for different types of OIM components!!!
    Then you'll need to read your target in the code somewhere and generate your hashtable with format of "Reconciliation Field" and "Value" in your input to your hash. Once you have created your hash, the following code will create your event:
    >
         public long reconEvent(Hashtable userHash) throws Exception{
              reconIntf = (tcReconciliationOperationsIntf)getUtilityOps("Thor.API.Operations.tcReconciliationOperationsIntf");
              long event = 0;
              boolean reconEvent = reconIntf.ignoreEvent(resourceObject, userHash);
              log.debug("reconEvent: " + reconEvent);
              if (!reconEvent){
                   event = reconIntf.createReconciliationEvent(resourceObject, userHash, true);
              return event;          
    >
    -Kevin

  • Rootless JTree (URGENT!!!)

    Hi! I am trying to create a Jtree with no root nodes, Instead It will have many nodes at the top level. Like this.
    X1
    |_ child
    X2
    |_ child
    X3
    |_ child
    etc, you get the point.
    I have done this by using a Vector of nodes. Here is my sample program,
    My Tree node class
    public class ISTreeNode extends DefaultMutableTreeNode {
    private Icon icon;
    private String id;
    private String type;
    My node Renderer
    public class ISTreeNodeRenderer extends DefaultTreeCellRenderer {
    public Component getTreeCellRendererComponent(JTree tree, Object value,
    boolean sel, boolean expanded, boolean leaf,
    int row, boolean hasFocus)
    ISTreeNode node = (ISTreeNode)value;
    ...... set the icon/ type etc
    my tree creation procedure
    initData() {
    Vector nodeVec = new Vector(3);
              for (int i=0; i < 3; i++) {
    String vpdStr = "X "+i;
              ISTreeNode vpd = new ISTreeNode(vpdStr);
    vpd.setIcon(getIcon());
    vpd.setId(""+i);
              vpd.setType(ISViewerConstants.VPD);
    nodeVec.addElement(vpd);
              JTree tree = new JTree( nodeVec );
    tree.setCellRenderer(new ISTreeNodeRenderer());
    Well so that was sample program. But i have a problem to get to my ISTreeNOde in my cellRenderer, at
    ISTreeNode node = (ISTreeNode)value; code in renderer. JVM gives a wrong Cast exception. Is there some thing i am doing wrong. How do i get the ISTreeNode, in renderer cos i want to set the icons etc. Or is there a better way to create a Jtree with multiple roots and custom icons. How do i create child nodes if i am using a vector data model.
    Appreciate your help its urgent.
    Sada

    Finally after looking at the code. I found out and this works (Read along). This should be added to the documentation. When ever a Tree is created using the hashTable or Vector, I think it created DynamicUtilTreeNodes (This is an inner class in the JTree how do we know!!! ) which extends DefaultMutableTreeNode. So any node is definetly a DefaultMutableTreeNode, So if you call getUserObject on the casted node. you will get your node which is ISTreeNode. Here is teh code that works.
    Code starts.... for renderer.
    public class ISTreeNodeRenderer extends DefaultTreeCellRenderer {
    public Component getTreeCellRendererComponent(JTree tree, Object value,
    boolean sel, boolean expanded, boolean leaf,
    int row, boolean hasFocus)
    super.getTreeCellRendererComponent(tree, value, sel, expanded,
    leaf, row, hasFocus);
    DefaultMutableTreeNode dNode = (DefaultMutableTreeNode)value;
    Object obj = dNode.getUserObject();
    if (obj instanceof ISTreeNode ) {
    // change the icon stuff

  • URGENT!!! servlet communication

    hi!!
    big guys
    i have problem plz find a solution for me
    i am processing user request form thru a servlet
    and i want to generate another servlet or receiving error values from user
    so how can i call another servlet from within other servlet also passing certain parameters
    is it thru request dispatcher interface
    then what code runs another servlet
    plz reply urgent
    thanks in advance for your reply
    monoj

    Hmm, so you want to forward the servlet request? If so, here is one idea, which might not be optimal, so if anyone knows a better way, please do share it.
    Basically, what you just do, is see if your conditions are fulfilled, if so, just call another servlet. The problem is, that since servlets are stateful, this might be a small problem if your servlet that you are forwarding to is called from many servlets. That too can actually be solved. Here is how I would do it:
    public class MyServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse res) {
              // Check if the parameters are valid
              if(!isValidRequest(req)) {
                  ServletForwarder.forwardToServlet("mypackage.MyErrorSerlvet",req,res);
                  return;
              // Do the normal stuff....
    // Then the ServletForwarder class
    public class ServletForwarder {
          private static ServletForwarder self = new ServletForwarder();
          private Hashtable servlets;
          // Use a private constructor to make sure this is a singleton
          private ServletForwarder() {
             servlets = new Hashtable();
          public static void forwardToServlet(String sName,
                                                             HttpServletRequest req,
                                                             HttpServletResponse res) {
                 Object ob = self.servlets.get(sName);
                 if(ob != null) {
                        ((HttpServlet)ob).doGet(req,res);
                        return;
                 try {
                        HttpServlet serv = (HttpServlet)Class.forName(sName).newInstace();
                         serv.doGet(req,res);
                        self.servlets.put(sName,serv);
                 catch(Exception e) {
                      e.printStackTrace();
    }The idea is that the class ServletForwarder handles the forwarding to the different servlets. It keeps track of already instantiated servlets, so using stateful servlets is possible.
    Tuomas Rinta

  • InitialDirContext  red underline problem... Urgent

    Hello everybody, i'm facing a strange error when i try to set the enviroument created to access the LDAP to the InitialDirContext. I'm running the following code under window xp and i'm getting a red underline with "ctx = new InitialDirContext(env);". It specify that i either remove the "env" or to set it as boolean to satisfy the constructors.
    The code is:
    Hashtable env = new Hashtable();
                             env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
                             env.put(Context.SECURITY_PRINCIPAL, "cn=Manager,dc=mydomain");
                             env.put(Context.SECURITY_CREDENTIALS, "secret");
                             DirContext ctx = null;
                   NamingEnumeration results = null;
                   boolean answer = false;
                   try {
                        ctx = new InitialDirContext(env);
                   SearchControls controls = new SearchControls();
                   controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   results = ctx.search("", "(objectclass=person)", controls);
    I tried to resolve it by downloading the jdni.jar file and include it in the path variable. Nothing is changed and i still get that red underline ..
    Please support.
    Regards,
    Ahmed Banihammad

    95% of the code you posted has absolutely nothing to do with selecting the text in a combobox when it gains focus. If you want to create a simple executable example that contains two components so we can tab from one component to the other, then maybe I'll take some time to look at your problem, but frankly its not urgent to me and I'm not going to read throught unnecessary code in an attempt to find the problem.

  • HashTable retrievalble

    Hi,
    I have a Hashtable which has around 350 entries, when i was printing the entries, the result iam getting was completed shuffled from the order i entered into the hashtable.
    So How can i get them in the same order as i entered in the hashtable.
    Please reply fast...Its reallly Urgent....
    Thank You.

    Hi,
    Let me be specific, I actually had a Lis.jsp file which has 5 tabs where when i click each tab it has some fields under it(initially has default values) and we can jus fill those fields and go to next tab and fill those fields under other tab...so i do this for all the tabs and all these values entered into the fields are entered dynamically into the hashtable....so now i have another tab finish...so when i click this tab....it goes to another JSP file calles result.jsp.....here i print the values i entered into the hashtable along with the corresponding ids(keys) ....so now all these are shuffled iam not getting them in order ....so can i still use LinkedHashMap....
    Thank You

  • Logical command in ABAP.....Urgent

    Hi,
      i am pretty new using ABAP program so i neeed help urgently. i am trying to move a file on the application server from one directory to the other and i was using the open dataset function to do that. but the file i am trying to move is pretty big and because i am using internal table to store, it is causing problems with the space.
      i have consulted the basis guys and they have managed to create a logical file for copying from one directory to the other on the application server. to help you furthter. i am enclosing the mail sent to me.
    I have created a logical command which should copy the file from one location to the other but you need to pass it the source dir and file name and the destination dir and file name.
    The logical command is ZCOPY and uses cmd /c copy
    Copies one or more files to another location.
    COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
         [+ source [/A | /B] [+ ...]] [destination [/A | /B]]
      source       Specifies the file or files to be copied.
      /A           Indicates an ASCII text file.
      /B           Indicates a binary file.
      destination  Specifies the directory and/or filename for the new file(s).
      /V           Verifies that new files are written correctly.
      /N           Uses short filename, if available, when copying a file with a
                   non-8dot3 name.
      /Y           Suppresses prompting to confirm you want to overwrite an
                   existing destination file.
      /-Y          Causes prompting to confirm you want to overwrite an
                   existing destination file.
      /Z           Copies networked files in restartable mode.
    The switch /Y may be preset in the COPYCMD environment variable.
    This may be overridden with /-Y on the command line.  Default is
    to prompt on overwrites unless COPY command is being executed from
    within a batch script.
    the problem now is i have no idea about how to use the logical command. can any one help me.
    Thank you,
    Ravi.

    If memory is not an issue, then there should be no reason why this should not work.
    report zrich_0001.
    parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt',
                d2 type localfile default '/usr/sap/TST/SYS/Data2.txt'.
    data: itab type table of string with header line.
    start-of-selection.
    * Read old file
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into itab.
          if sy-subrc <> 0.
            exit.
          endif.
          append itab.
        enddo.
      endif.
      close dataset d1.
    * Write to new file
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
    * Delete the old file
      delete dataset d1.
    Regards,
    Rich Heilman

Maybe you are looking for