Author Topic: [Java] SortedProperties  (Read 2385 times)

0 Members and 1 Guest are viewing this topic.

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
[Java] SortedProperties
« on: September 17, 2007, 02:27:00 pm »
/**
 * This file is distributed under the GPL
 * $Id: SortedProperties.java 619 2007-08-28 14:57:28Z scotta $
 */

package net.bnubot.util;

import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Vector;

public class SortedProperties extends Properties {
   private static final long serialVersionUID = 213081373529965920L;

   @SuppressWarnings("unchecked")
   public synchronized Enumeration keys() {
      Enumeration keysEnum = super.keys();
      Vector keyList = new Vector();
      while(keysEnum.hasMoreElements())
         keyList.add(keysEnum.nextElement());
      Collections.sort(keyList);
      return keyList.elements();
   }
}

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!