emma

Entry;

public abstract interface IPathEnumerator$IPathHandler
{
  public abstract void handleDirStart(File paramFile1, File paramFile2);
  
  public abstract void handleFile(File paramFile1, File paramFile2);
  
  public abstract void handleDirEnd(File paramFile1, File paramFile2);
  
  public abstract void handleArchiveStart(File paramFile1, File paramFile2, Manifest paramManifest);
  
  public abstract void handleArchiveEntry(JarInputStream paramJarInputStream, ZipEntry paramZipEntry);
  
  public abstract void handleArchiveEnd(File paramFile1, File paramFile2);
}

/* Location:
 * Qualified Name:     com.vladium.util.IPathEnumerator.IPathHandler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

import com.vladium.logging.Logger;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.jar.Attributes;
import java.util.jar.Attributes.Name;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;

public abstract interface IPathEnumerator
{
  public abstract void enumerate()
    throws IOException;
  
  public static abstract class Factory
  {
    public static IPathEnumerator create(File[] path, boolean canonical, IPathEnumerator.IPathHandler handler)
    {
      return new PathEnumerator(path, canonical, handler);
    }
    
    private static final class PathEnumerator
      implements IPathEnumerator
    {
      private final ArrayList m_path;
      private final boolean m_canonical;
      private final Set m_pathSet;
      private final IPathEnumerator.IPathHandler m_handler;
      private final boolean m_processManifest;
      private final Logger m_log;
      private boolean m_verbose;
      private boolean m_trace1;
      private int m_pathIndex;
      private File m_currentPathDir;
      private static final boolean IGNORE_INVALID_ENTRIES = true;
      
      public void enumerate()
        throws IOException
      {
        IPathEnumerator.IPathHandler handler = m_handler;
        for (m_pathIndex = 0; m_pathIndex < m_path.size(); m_pathIndex += 1)
        {
          File f = (File)m_path.get(m_pathIndex);
          if (f.exists()) {
            if (f.isDirectory())
            {
              if (m_verbose) {
                m_log.verbose("processing dir path entry [" + f.getAbsolutePath() + "] ...");
              }
              m_currentPathDir = f;
              enumeratePathDir(null);
            }
            else
            {
              String name = f.getName();
              String lcName = name.toLowerCase();
              if ((lcName.endsWith(".zip")) || (lcName.endsWith(".jar")))
              {
                if (m_verbose) {
                  m_log.verbose("processing archive path entry [" + f.getAbsolutePath() + "] ...");
                }
                File parent = f.getParentFile();
                File archive = new File(name);
                m_currentPathDir = parent;
                
                enumeratePathArchive(name);
                handler.handleArchiveEnd(parent, archive);
              }
            }
          }
        }
      }
      
      PathEnumerator(File[] path, boolean canonical, IPathEnumerator.IPathHandler handler)
      {
        m_path = new ArrayList(path.length);
        for (int p = 0; p < path.length; p++) {
          m_path.add(path[p]);
        }
        m_canonical = canonical;
        if (handler == null) {
          throw new IllegalArgumentException("null input: handler");
        }
        m_handler = handler;
        
        m_processManifest = true;
        if (m_processManifest)
        {
          m_pathSet = new HashSet(path.length);
          for (int p = 0; p < path.length; p++) {
            m_pathSet.add(path[p].getPath());
          }
        }
        else
        {
          m_pathSet = null;
        }
        m_log = Logger.getLogger();
        m_verbose = m_log.atVERBOSE();
        m_trace1 = m_log.atTRACE1();
      }
      
      private void enumeratePathDir(String dir)
        throws IOException
      {
        boolean trace1 = m_trace1;
        
        File currentPathDir = m_currentPathDir;
        File fullDir = dir != null ? new File(currentPathDir, dir) : currentPathDir;
        
        String[] children = fullDir.list();
        IPathEnumerator.IPathHandler handler = m_handler;
        
        int c = 0;
        for (int cLimit = children.length; c < cLimit; c++)
        {
          String childName = children[c];
          
          File child = dir != null ? new File(dir, childName) : new File(childName);
          File fullChild = new File(fullDir, childName);
          if (fullChild.isDirectory())
          {
            handler.handleDirStart(currentPathDir, child);
            if (trace1) {
              m_log.trace1("enumeratePathDir", "recursing into [" + child.getName() + "] ...");
            }
            enumeratePathDir(child.getPath());
            handler.handleDirEnd(currentPathDir, child);
          }
          else
          {
            if (trace1) {
              m_log.trace1("enumeratePathDir", "processing file [" + child.getName() + "] ...");
            }
            handler.handleFile(currentPathDir, child);
          }
        }
      }
      
      private void enumeratePathArchive(String archive)
        throws IOException
      {
        boolean trace1 = m_trace1;
        
        File fullArchive = new File(m_currentPathDir, archive);
        
        JarInputStream in = null;
        try
        {
          in = new JarInputStream(new BufferedInputStream(new FileInputStream(fullArchive), 32768));
          
          IPathEnumerator.IPathHandler handler = m_handler;
          
          Manifest manifest = in.getManifest();
          if (manifest == null) {
            manifest = readManifestViaJarFile(fullArchive);
          }
          handler.handleArchiveStart(m_currentPathDir, new File(archive), manifest);
          ZipEntry entry;
          while ((entry = in.getNextEntry()) != null)
          {
            if (trace1) {
              m_log.trace1("enumeratePathArchive", "processing archive entry [" + entry.getName() + "] ...");
            }
            handler.handleArchiveEntry(in, entry);
            in.closeEntry();
          }
          if (m_processManifest)
          {
            if (manifest == null) {
              manifest = in.getManifest();
            }
            if (manifest != null)
            {
              Attributes attributes = manifest.getMainAttributes();
              if (attributes != null)
              {
                String jarClassPath = attributes.getValue(Attributes.Name.CLASS_PATH);
                if (jarClassPath != null)
                {
                  tokenizer = new StringTokenizer(jarClassPath);
                  for (p = 1; tokenizer.hasMoreTokens();)
                  {
                    String relPath = tokenizer.nextToken();
                    
                    File archiveParent = fullArchive.getParentFile();
                    File path = archiveParent != null ? new File(archiveParent, relPath) : new File(relPath);
                    
                    String fullPath = m_canonical ? Files.canonicalizePathname(path.getPath()) : path.getPath();
                    if (m_pathSet.add(fullPath))
                    {
                      if (m_verbose) {
                        m_log.verbose("  added manifest Class-Path entry [" + path + "]");
                      }
                      m_path.add(m_pathIndex + p++, path);
                    }
                  }
                }
              }
            }
          }
        }
        catch (FileNotFoundException fnfe) {}finally
        {
          StringTokenizer tokenizer;
          int p;
          if (in != null) {
            try
            {
              in.close();
            }
            catch (Exception ignore) {}
          }
        }
      }
      
      private static Manifest readManifestViaJarFile(File archive)
      {
        Manifest result = null;
        
        JarFile jarfile = null;
        try
        {
          jarfile = new JarFile(archive, false);
          result = jarfile.getManifest();
        }
        catch (IOException ignore) {}finally
        {
          if (jarfile != null) {
            try
            {
              jarfile.close();
            }
            catch (IOException ignore) {}
          }
        }
        return result;
      }
    }
  }
  
  public static abstract interface IPathHandler
  {
    public abstract void handleDirStart(File paramFile1, File paramFile2);
    
    public abstract void handleFile(File paramFile1, File paramFile2);
    
    public abstract void handleDirEnd(File paramFile1, File paramFile2);
    
    public abstract void handleArchiveStart(File paramFile1, File paramFile2, Manifest paramManifest);
    
    public abstract void handleArchiveEntry(JarInputStream paramJarInputStream, ZipEntry paramZipEntry);
    
    public abstract void handleArchiveEnd(File paramFile1, File paramFile2);
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IPathEnumerator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;

final class IProperties$Factory$PropertiesImpl
  implements IProperties, Cloneable
{
  private final IProperties.IMapper m_mapper;
  private HashMap m_valueMap;
  private PropertiesImpl m_delegate;
  private transient Set m_unmappedKeySet;
  
  public String getProperty(String key)
  {
    return getProperty(key, null);
  }
  
  public String getProperty(String key, String dflt)
  {
    String value = (String)m_valueMap.get(key);
    if ((value == null) && (m_mapper != null))
    {
      String mappedKey = m_mapper.getMappedKey(key);
      if (mappedKey != null) {
        value = (String)m_valueMap.get(mappedKey);
      }
    }
    if ((value == null) && (m_delegate != null)) {
      value = m_delegate.getProperty(key, null);
    }
    return value != null ? value : dflt;
  }
  
  public boolean isOverridden(String key)
  {
    return m_valueMap.containsKey(key);
  }
  
  public IProperties copy()
  {
    try
    {
      _clone = (PropertiesImpl)super.clone();
    }
    catch (CloneNotSupportedException cnse)
    {
      PropertiesImpl _clone;
      throw new Error(cnse.toString());
    }
    PropertiesImpl _clone;
    m_valueMap = ((HashMap)m_valueMap.clone());
    m_unmappedKeySet = null;
    
    PropertiesImpl scan = _clone;
    for (PropertiesImpl delegate = m_delegate; delegate != null; delegate = m_delegate)
    {
      try
      {
        _delegateClone = (PropertiesImpl)delegate.clone();
      }
      catch (CloneNotSupportedException cnse)
      {
        PropertiesImpl _delegateClone;
        throw new Error(cnse.toString());
      }
      PropertiesImpl _delegateClone;
      m_valueMap = ((HashMap)m_valueMap.clone());
      m_unmappedKeySet = null;
      
      scan.setDelegate(_delegateClone);
      scan = _delegateClone;
    }
    return _clone;
  }
  
  public Iterator properties()
  {
    return unmappedKeySet().iterator();
  }
  
  public Properties toProperties()
  {
    Properties result = new Properties();
    for (Iterator i = properties(); i.hasNext();)
    {
      String n = (String)i.next();
      String v = getProperty(n);
      
      result.setProperty(n, v);
    }
    return result;
  }
  
  public boolean isEmpty()
  {
    return (m_valueMap.isEmpty()) && ((m_delegate == null) || ((m_delegate != null) && (m_delegate.isEmpty())));
  }
  
  public String[] toAppArgsForm(String prefix)
  {
    if (isEmpty()) {
      return IConstants.EMPTY_STRING_ARRAY;
    }
    if (prefix == null) {
      throw new IllegalArgumentException("null input: prefix");
    }
    List _result = new ArrayList();
    for (Iterator names = properties(); names.hasNext();)
    {
      String name = (String)names.next();
      String value = getProperty(name, "");
      
      _result.add(prefix.concat(name).concat("=").concat(value));
    }
    String[] result = new String[_result.size()];
    _result.toArray(result);
    
    return result;
  }
  
  public void list(PrintStream out)
  {
    Iterator i;
    if (out != null) {
      for (i = properties(); i.hasNext();)
      {
        String n = (String)i.next();
        String v = getProperty(n);
        
        out.println(n + ":\t[" + v + "]");
      }
    }
  }
  
  public void list(PrintWriter out)
  {
    Iterator i;
    if (out != null) {
      for (i = properties(); i.hasNext();)
      {
        String n = (String)i.next();
        String v = getProperty(n);
        
        out.println(n + ":\t[" + v + "]");
      }
    }
  }
  
  public String setProperty(String key, String value)
  {
    if (value == null) {
      throw new IllegalArgumentException("null input: value");
    }
    m_unmappedKeySet = null;
    
    return (String)m_valueMap.put(key, value);
  }
  
  IProperties$Factory$PropertiesImpl(HashMap values, IProperties.IMapper mapper)
  {
    m_mapper = mapper;
    m_valueMap = (values != null ? values : new HashMap());
    
    m_delegate = null;
  }
  
  Set unmappedKeySet()
  {
    Set result = m_unmappedKeySet;
    if (result == null)
    {
      result = new TreeSet();
      result.addAll(m_valueMap.keySet());
      if (m_delegate != null) {
        result.addAll(m_delegate.unmappedKeySet());
      }
      m_unmappedKeySet = result;
      return result;
    }
    return result;
  }
  
  PropertiesImpl getLastProperties()
  {
    PropertiesImpl result = this;
    for (PropertiesImpl delegate = m_delegate; delegate != null; delegate = m_delegate)
    {
      if (delegate == this) {
        throw new IllegalStateException("cyclic delegation detected");
      }
      result = delegate;
    }
    return result;
  }
  
  void setDelegate(PropertiesImpl delegate)
  {
    m_delegate = delegate;
    
    m_unmappedKeySet = null;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IProperties.Factory.PropertiesImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;

public abstract class IProperties$Factory
{
  public static IProperties create(IProperties.IMapper mapper)
  {
    return new PropertiesImpl(null, mapper);
  }
  
  public static IProperties wrap(Properties properties, IProperties.IMapper mapper)
  {
    HashMap map = new HashMap();
    for (Enumeration names = properties.propertyNames(); names.hasMoreElements();)
    {
      String n = (String)names.nextElement();
      String v = properties.getProperty(n);
      
      map.put(n, v);
    }
    return new PropertiesImpl(map, mapper);
  }
  
  public static IProperties combine(IProperties overrides, IProperties base)
  {
    IProperties result = overrides != null ? overrides.copy() : create(null);
    
    ((PropertiesImpl)result).getLastProperties().setDelegate((PropertiesImpl)base);
    
    return result;
  }
  
  private static final class PropertiesImpl
    implements IProperties, Cloneable
  {
    private final IProperties.IMapper m_mapper;
    private HashMap m_valueMap;
    private PropertiesImpl m_delegate;
    private transient Set m_unmappedKeySet;
    
    public String getProperty(String key)
    {
      return getProperty(key, null);
    }
    
    public String getProperty(String key, String dflt)
    {
      String value = (String)m_valueMap.get(key);
      if ((value == null) && (m_mapper != null))
      {
        String mappedKey = m_mapper.getMappedKey(key);
        if (mappedKey != null) {
          value = (String)m_valueMap.get(mappedKey);
        }
      }
      if ((value == null) && (m_delegate != null)) {
        value = m_delegate.getProperty(key, null);
      }
      return value != null ? value : dflt;
    }
    
    public boolean isOverridden(String key)
    {
      return m_valueMap.containsKey(key);
    }
    
    public IProperties copy()
    {
      try
      {
        _clone = (PropertiesImpl)super.clone();
      }
      catch (CloneNotSupportedException cnse)
      {
        PropertiesImpl _clone;
        throw new Error(cnse.toString());
      }
      PropertiesImpl _clone;
      m_valueMap = ((HashMap)m_valueMap.clone());
      m_unmappedKeySet = null;
      
      PropertiesImpl scan = _clone;
      for (PropertiesImpl delegate = m_delegate; delegate != null; delegate = m_delegate)
      {
        try
        {
          _delegateClone = (PropertiesImpl)delegate.clone();
        }
        catch (CloneNotSupportedException cnse)
        {
          PropertiesImpl _delegateClone;
          throw new Error(cnse.toString());
        }
        PropertiesImpl _delegateClone;
        m_valueMap = ((HashMap)m_valueMap.clone());
        m_unmappedKeySet = null;
        
        scan.setDelegate(_delegateClone);
        scan = _delegateClone;
      }
      return _clone;
    }
    
    public Iterator properties()
    {
      return unmappedKeySet().iterator();
    }
    
    public Properties toProperties()
    {
      Properties result = new Properties();
      for (Iterator i = properties(); i.hasNext();)
      {
        String n = (String)i.next();
        String v = getProperty(n);
        
        result.setProperty(n, v);
      }
      return result;
    }
    
    public boolean isEmpty()
    {
      return (m_valueMap.isEmpty()) && ((m_delegate == null) || ((m_delegate != null) && (m_delegate.isEmpty())));
    }
    
    public String[] toAppArgsForm(String prefix)
    {
      if (isEmpty()) {
        return IConstants.EMPTY_STRING_ARRAY;
      }
      if (prefix == null) {
        throw new IllegalArgumentException("null input: prefix");
      }
      List _result = new ArrayList();
      for (Iterator names = properties(); names.hasNext();)
      {
        String name = (String)names.next();
        String value = getProperty(name, "");
        
        _result.add(prefix.concat(name).concat("=").concat(value));
      }
      String[] result = new String[_result.size()];
      _result.toArray(result);
      
      return result;
    }
    
    public void list(PrintStream out)
    {
      Iterator i;
      if (out != null) {
        for (i = properties(); i.hasNext();)
        {
          String n = (String)i.next();
          String v = getProperty(n);
          
          out.println(n + ":\t[" + v + "]");
        }
      }
    }
    
    public void list(PrintWriter out)
    {
      Iterator i;
      if (out != null) {
        for (i = properties(); i.hasNext();)
        {
          String n = (String)i.next();
          String v = getProperty(n);
          
          out.println(n + ":\t[" + v + "]");
        }
      }
    }
    
    public String setProperty(String key, String value)
    {
      if (value == null) {
        throw new IllegalArgumentException("null input: value");
      }
      m_unmappedKeySet = null;
      
      return (String)m_valueMap.put(key, value);
    }
    
    PropertiesImpl(HashMap values, IProperties.IMapper mapper)
    {
      m_mapper = mapper;
      m_valueMap = (values != null ? values : new HashMap());
      
      m_delegate = null;
    }
    
    Set unmappedKeySet()
    {
      Set result = m_unmappedKeySet;
      if (result == null)
      {
        result = new TreeSet();
        result.addAll(m_valueMap.keySet());
        if (m_delegate != null) {
          result.addAll(m_delegate.unmappedKeySet());
        }
        m_unmappedKeySet = result;
        return result;
      }
      return result;
    }
    
    PropertiesImpl getLastProperties()
    {
      PropertiesImpl result = this;
      for (PropertiesImpl delegate = m_delegate; delegate != null; delegate = m_delegate)
      {
        if (delegate == this) {
          throw new IllegalStateException("cyclic delegation detected");
        }
        result = delegate;
      }
      return result;
    }
    
    void setDelegate(PropertiesImpl delegate)
    {
      m_delegate = delegate;
      
      m_unmappedKeySet = null;
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IProperties.Factory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

public abstract interface IProperties$IMapper
{
  public abstract String getMappedKey(String paramString);
}

/* Location:
 * Qualified Name:     com.vladium.util.IProperties.IMapper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;

public abstract interface IProperties
{
  public abstract String getProperty(String paramString);
  
  public abstract String getProperty(String paramString1, String paramString2);
  
  public abstract boolean isOverridden(String paramString);
  
  public abstract IProperties copy();
  
  public abstract Iterator properties();
  
  public abstract Properties toProperties();
  
  public abstract String[] toAppArgsForm(String paramString);
  
  public abstract boolean isEmpty();
  
  public abstract void list(PrintStream paramPrintStream);
  
  public abstract void list(PrintWriter paramPrintWriter);
  
  public abstract String setProperty(String paramString1, String paramString2);
  
  public static abstract class Factory
  {
    public static IProperties create(IProperties.IMapper mapper)
    {
      return new PropertiesImpl(null, mapper);
    }
    
    public static IProperties wrap(Properties properties, IProperties.IMapper mapper)
    {
      HashMap map = new HashMap();
      for (Enumeration names = properties.propertyNames(); names.hasMoreElements();)
      {
        String n = (String)names.nextElement();
        String v = properties.getProperty(n);
        
        map.put(n, v);
      }
      return new PropertiesImpl(map, mapper);
    }
    
    public static IProperties combine(IProperties overrides, IProperties base)
    {
      IProperties result = overrides != null ? overrides.copy() : create(null);
      
      ((PropertiesImpl)result).getLastProperties().setDelegate((PropertiesImpl)base);
      
      return result;
    }
    
    private static final class PropertiesImpl
      implements IProperties, Cloneable
    {
      private final IProperties.IMapper m_mapper;
      private HashMap m_valueMap;
      private PropertiesImpl m_delegate;
      private transient Set m_unmappedKeySet;
      
      public String getProperty(String key)
      {
        return getProperty(key, null);
      }
      
      public String getProperty(String key, String dflt)
      {
        String value = (String)m_valueMap.get(key);
        if ((value == null) && (m_mapper != null))
        {
          String mappedKey = m_mapper.getMappedKey(key);
          if (mappedKey != null) {
            value = (String)m_valueMap.get(mappedKey);
          }
        }
        if ((value == null) && (m_delegate != null)) {
          value = m_delegate.getProperty(key, null);
        }
        return value != null ? value : dflt;
      }
      
      public boolean isOverridden(String key)
      {
        return m_valueMap.containsKey(key);
      }
      
      public IProperties copy()
      {
        try
        {
          _clone = (PropertiesImpl)super.clone();
        }
        catch (CloneNotSupportedException cnse)
        {
          PropertiesImpl _clone;
          throw new Error(cnse.toString());
        }
        PropertiesImpl _clone;
        m_valueMap = ((HashMap)m_valueMap.clone());
        m_unmappedKeySet = null;
        
        PropertiesImpl scan = _clone;
        for (PropertiesImpl delegate = m_delegate; delegate != null; delegate = m_delegate)
        {
          try
          {
            _delegateClone = (PropertiesImpl)delegate.clone();
          }
          catch (CloneNotSupportedException cnse)
          {
            PropertiesImpl _delegateClone;
            throw new Error(cnse.toString());
          }
          PropertiesImpl _delegateClone;
          m_valueMap = ((HashMap)m_valueMap.clone());
          m_unmappedKeySet = null;
          
          scan.setDelegate(_delegateClone);
          scan = _delegateClone;
        }
        return _clone;
      }
      
      public Iterator properties()
      {
        return unmappedKeySet().iterator();
      }
      
      public Properties toProperties()
      {
        Properties result = new Properties();
        for (Iterator i = properties(); i.hasNext();)
        {
          String n = (String)i.next();
          String v = getProperty(n);
          
          result.setProperty(n, v);
        }
        return result;
      }
      
      public boolean isEmpty()
      {
        return (m_valueMap.isEmpty()) && ((m_delegate == null) || ((m_delegate != null) && (m_delegate.isEmpty())));
      }
      
      public String[] toAppArgsForm(String prefix)
      {
        if (isEmpty()) {
          return IConstants.EMPTY_STRING_ARRAY;
        }
        if (prefix == null) {
          throw new IllegalArgumentException("null input: prefix");
        }
        List _result = new ArrayList();
        for (Iterator names = properties(); names.hasNext();)
        {
          String name = (String)names.next();
          String value = getProperty(name, "");
          
          _result.add(prefix.concat(name).concat("=").concat(value));
        }
        String[] result = new String[_result.size()];
        _result.toArray(result);
        
        return result;
      }
      
      public void list(PrintStream out)
      {
        Iterator i;
        if (out != null) {
          for (i = properties(); i.hasNext();)
          {
            String n = (String)i.next();
            String v = getProperty(n);
            
            out.println(n + ":\t[" + v + "]");
          }
        }
      }
      
      public void list(PrintWriter out)
      {
        Iterator i;
        if (out != null) {
          for (i = properties(); i.hasNext();)
          {
            String n = (String)i.next();
            String v = getProperty(n);
            
            out.println(n + ":\t[" + v + "]");
          }
        }
      }
      
      public String setProperty(String key, String value)
      {
        if (value == null) {
          throw new IllegalArgumentException("null input: value");
        }
        m_unmappedKeySet = null;
        
        return (String)m_valueMap.put(key, value);
      }
      
      PropertiesImpl(HashMap values, IProperties.IMapper mapper)
      {
        m_mapper = mapper;
        m_valueMap = (values != null ? values : new HashMap());
        
        m_delegate = null;
      }
      
      Set unmappedKeySet()
      {
        Set result = m_unmappedKeySet;
        if (result == null)
        {
          result = new TreeSet();
          result.addAll(m_valueMap.keySet());
          if (m_delegate != null) {
            result.addAll(m_delegate.unmappedKeySet());
          }
          m_unmappedKeySet = result;
          return result;
        }
        return result;
      }
      
      PropertiesImpl getLastProperties()
      {
        PropertiesImpl result = this;
        for (PropertiesImpl delegate = m_delegate; delegate != null; delegate = m_delegate)
        {
          if (delegate == this) {
            throw new IllegalStateException("cyclic delegation detected");
          }
          result = delegate;
        }
        return result;
      }
      
      void setDelegate(PropertiesImpl delegate)
      {
        m_delegate = delegate;
        
        m_unmappedKeySet = null;
      }
    }
  }
  
  public static abstract interface IMapper
  {
    public abstract String getMappedKey(String paramString);
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IProperties
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

final class IntIntMap$Entry
{
  int m_key;
  int m_value;
  Entry m_next;
  
  IntIntMap$Entry(int key, int value, Entry next)
  {
    m_key = key;
    m_value = value;
    m_next = next;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IntIntMap.Entry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

public final class IntIntMap
{
  private final float m_loadFactor;
  private Entry[] m_buckets;
  private int m_size;
  private int m_sizeThreshold;
  
  public IntIntMap()
  {
    this(11, 0.75F);
  }
  
  public IntIntMap(int initialCapacity)
  {
    this(initialCapacity, 0.75F);
  }
  
  public IntIntMap(int initialCapacity, float loadFactor)
  {
    if (initialCapacity < 0) {
      throw new IllegalArgumentException("negative input: initialCapacity [" + initialCapacity + "]");
    }
    if ((loadFactor <= 0.0D) || (loadFactor >= 1.000001D)) {
      throw new IllegalArgumentException("loadFactor not in (0.0, 1.0] range: " + loadFactor);
    }
    if (initialCapacity == 0) {
      initialCapacity = 1;
    }
    m_loadFactor = (loadFactor > 1.0D ? 1.0F : loadFactor);
    m_sizeThreshold = ((int)(initialCapacity * loadFactor));
    m_buckets = new Entry[initialCapacity];
  }
  
  public String toString()
  {
    StringBuffer s = new StringBuffer();
    debugDump(s);
    
    return s.toString();
  }
  
  public int size()
  {
    return m_size;
  }
  
  public boolean contains(int key)
  {
    Entry[] buckets = m_buckets;
    int bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key) {
        return true;
      }
    }
    return false;
  }
  
  public boolean get(int key, int[] out)
  {
    Entry[] buckets = m_buckets;
    int bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key)
      {
        out[0] = m_value;
        return true;
      }
    }
    return false;
  }
  
  public boolean get(int key, int[] out, int index)
  {
    Entry[] buckets = m_buckets;
    int bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key)
      {
        out[index] = m_value;
        return true;
      }
    }
    return false;
  }
  
  public int[] keys()
  {
    int[] result = new int[m_size];
    int scan = 0;
    for (int b = 0; b < m_buckets.length; b++) {
      for (Entry entry = m_buckets[b]; entry != null; entry = m_next) {
        result[(scan++)] = m_key;
      }
    }
    return result;
  }
  
  public void put(int key, int value)
  {
    Entry currentKeyEntry = null;
    
    int bucketIndex = (key & 0x7FFFFFFF) % m_buckets.length;
    
    Entry[] buckets = m_buckets;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key)
      {
        currentKeyEntry = entry;
        break;
      }
    }
    if (currentKeyEntry != null)
    {
      m_value = value;
    }
    else
    {
      if (m_size >= m_sizeThreshold) {
        rehash();
      }
      buckets = m_buckets;
      bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
      Entry bucketListHead = buckets[bucketIndex];
      Entry newEntry = new Entry(key, value, bucketListHead);
      buckets[bucketIndex] = newEntry;
      
      m_size += 1;
    }
  }
  
  public void remove(int key)
  {
    int bucketIndex = (key & 0x7FFFFFFF) % m_buckets.length;
    
    Entry[] buckets = m_buckets;
    Entry entry = buckets[bucketIndex];
    for (Entry prev = entry; entry != null;)
    {
      Entry next = m_next;
      if (key == m_key)
      {
        if (prev == entry) {
          buckets[bucketIndex] = next;
        } else {
          m_next = next;
        }
        m_size -= 1;
        break;
      }
      prev = entry;
      entry = next;
    }
  }
  
  void debugDump(StringBuffer out)
  {
    if (out != null)
    {
      out.append(super.toString());out.append(EOL);
      out.append("size = " + m_size + ", bucket table size = " + m_buckets.length + ", load factor = " + m_loadFactor + EOL);
      out.append("size threshold = " + m_sizeThreshold + EOL);
    }
  }
  
  private static final class Entry
  {
    int m_key;
    int m_value;
    Entry m_next;
    
    Entry(int key, int value, Entry next)
    {
      m_key = key;
      m_value = value;
      m_next = next;
    }
  }
  
  private void rehash()
  {
    Entry[] buckets = m_buckets;
    
    int newBucketCount = (m_buckets.length << 1) + 1;
    Entry[] newBuckets = new Entry[newBucketCount];
    Entry entry;
    for (int b = 0; b < buckets.length; b++) {
      for (entry = buckets[b]; entry != null;)
      {
        Entry next = m_next;
        int entryKeyHash = m_key & 0x7FFFFFFF;
        
        int newBucketIndex = entryKeyHash % newBucketCount;
        
        Entry bucketListHead = newBuckets[newBucketIndex];
        m_next = bucketListHead;
        newBuckets[newBucketIndex] = entry;
        
        entry = next;
      }
    }
    m_sizeThreshold = ((int)(newBucketCount * m_loadFactor));
    m_buckets = newBuckets;
  }
  
  private static final String EOL = System.getProperty("line.separator", "\n");
}

/* Location:
 * Qualified Name:     com.vladium.util.IntIntMap
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

import java.io.Serializable;

final class IntObjectMap$Entry
  implements Serializable
{
  Object m_value;
  final int m_key;
  Entry m_next;
  
  IntObjectMap$Entry(int key, Object value, Entry next)
  {
    m_key = key;
    m_value = value;
    m_next = next;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IntObjectMap.Entry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

import java.io.Serializable;

public final class IntObjectMap
  implements Serializable
{
  private final float m_loadFactor;
  private Entry[] m_buckets;
  private int m_size;
  private int m_sizeThreshold;
  
  public IntObjectMap()
  {
    this(11, 0.75F);
  }
  
  public IntObjectMap(int initialCapacity)
  {
    this(initialCapacity, 0.75F);
  }
  
  public IntObjectMap(int initialCapacity, float loadFactor)
  {
    if (initialCapacity < 0) {
      throw new IllegalArgumentException("negative input: initialCapacity [" + initialCapacity + "]");
    }
    if ((loadFactor <= 0.0D) || (loadFactor >= 1.000001D)) {
      throw new IllegalArgumentException("loadFactor not in (0.0, 1.0] range: " + loadFactor);
    }
    if (initialCapacity == 0) {
      initialCapacity = 1;
    }
    m_loadFactor = (loadFactor > 1.0D ? 1.0F : loadFactor);
    m_sizeThreshold = ((int)(initialCapacity * loadFactor));
    m_buckets = new Entry[initialCapacity];
  }
  
  public String toString()
  {
    StringBuffer s = new StringBuffer();
    debugDump(s);
    
    return s.toString();
  }
  
  public int size()
  {
    return m_size;
  }
  
  public boolean contains(int key)
  {
    Entry[] buckets = m_buckets;
    int bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key) {
        return true;
      }
    }
    return false;
  }
  
  public Object get(int key)
  {
    Entry[] buckets = m_buckets;
    int bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key) {
        return m_value;
      }
    }
    return null;
  }
  
  public int[] keys()
  {
    if (m_size == 0) {
      return IConstants.EMPTY_INT_ARRAY;
    }
    int[] result = new int[m_size];
    int scan = 0;
    for (int b = 0; b < m_buckets.length; b++) {
      for (Entry entry = m_buckets[b]; entry != null; entry = m_next) {
        result[(scan++)] = m_key;
      }
    }
    return result;
  }
  
  public Object put(int key, Object value)
  {
    Entry currentKeyEntry = null;
    
    int bucketIndex = (key & 0x7FFFFFFF) % m_buckets.length;
    
    Entry[] buckets = m_buckets;
    for (Entry entry = buckets[bucketIndex]; entry != null; entry = m_next) {
      if (key == m_key)
      {
        currentKeyEntry = entry;
        break;
      }
    }
    if (currentKeyEntry != null)
    {
      Object currentKeyValue = m_value;
      m_value = value;
      
      return currentKeyValue;
    }
    if (m_size >= m_sizeThreshold) {
      rehash();
    }
    buckets = m_buckets;
    bucketIndex = (key & 0x7FFFFFFF) % buckets.length;
    Entry bucketListHead = buckets[bucketIndex];
    Entry newEntry = new Entry(key, value, bucketListHead);
    buckets[bucketIndex] = newEntry;
    
    m_size += 1;
    
    return null;
  }
  
  void debugDump(StringBuffer out)
  {
    if (out != null)
    {
      out.append(super.toString());out.append(EOL);
      out.append("size = " + m_size + ", bucket table size = " + m_buckets.length + ", load factor = " + m_loadFactor + EOL);
      out.append("size threshold = " + m_sizeThreshold + EOL);
    }
  }
  
  private static final class Entry
    implements Serializable
  {
    Object m_value;
    final int m_key;
    Entry m_next;
    
    Entry(int key, Object value, Entry next)
    {
      m_key = key;
      m_value = value;
      m_next = next;
    }
  }
  
  private void rehash()
  {
    Entry[] buckets = m_buckets;
    
    int newBucketCount = (m_buckets.length << 1) + 1;
    Entry[] newBuckets = new Entry[newBucketCount];
    Entry entry;
    for (int b = 0; b < buckets.length; b++) {
      for (entry = buckets[b]; entry != null;)
      {
        Entry next = m_next;
        int entryKey = m_key;
        
        int newBucketIndex = (entryKey & 0x7FFFFFFF) % newBucketCount;
        
        Entry bucketListHead = newBuckets[newBucketIndex];
        m_next = bucketListHead;
        newBuckets[newBucketIndex] = entry;
        
        entry = next;
      }
    }
    m_sizeThreshold = ((int)(newBucketCount * m_loadFactor));
    m_buckets = newBuckets;
  }
  
  private static final String EOL = System.getProperty("line.separator", "\n");
}

/* Location:
 * Qualified Name:     com.vladium.util.IntObjectMap
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

final class IntSet$Entry
{
  final int m_key;
  Entry m_next;
  
  IntSet$Entry(int key, Entry next)
  {
    m_key = key;
    m_next = next;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.IntSet.Entry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util;

public final class IntSet
{
  private final float m_loadFactor;
  private Entry[] m_buckets;
  private int m_size;
  private int m_sizeThreshold;
  
  public IntSet()
  {
    this(11, 0.75F);
  }
  
  public IntSet(int initialCapacity)
  {
    this(initialCapacity, 0.75F);
  }
  
  public IntSet(int initialCapacity, float loadFactor)
  {
    if (initialCapacity < 0) {
      throw new IllegalArgumentException("negative input: initialCapacity [" + initialCapacity + "]");
    }
    if ((loadFactor <= 0.0D) || (loadFactor >= 1.000001D)) {
      throw new IllegalArgume
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd