emma

v = null;; entry = m_next)
        {
          if (entry == null) {
            break label128;
          }
          if (m_softValue == _ref)
          {
            if (prev == null) {
              m_buckets[bucketIndex] = m_next;
            } else {
              m_next = m_next;
            }
            m_softValue = null;
            m_key = null;
            m_next = null;
            entry = null;
            
            m_size -= 1;
            
            break;
          }
          prev = entry;
        }
        label128:
        StringBuffer msg = new StringBuffer("removeClearedValues(): soft reference [" + _ref + "] did not match within bucket #" + bucketIndex + EOL);
        debugDump(msg);
        
        throw new Error(msg.toString());
      }
    }
  }
  
  private static final String EOL = System.getProperty("line.separator", "\n");
  private static final boolean IDENTITY_OPTIMIZATION = true;
  private static final boolean ENQUEUE_FOUND_CLEARED_ENTRIES = true;
  private static final boolean DEBUG = false;
}

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

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;

public abstract class Strings
{
  public static final String WHITE_SPACE = " \t\r\n";
  private static final boolean USE_GET_CHARS = true;
  
  public static String toListForm(String[] strings, char delimiter)
  {
    if (strings == null) {
      return null;
    }
    if (strings.length == 0) {
      return "";
    }
    StringBuffer s = new StringBuffer();
    int i = 0;
    for (int iLimit = strings.length; i < iLimit; i++)
    {
      if (i != 0) {
        s.append(delimiter);
      }
      s.append(strings[i]);
    }
    return s.toString();
  }
  
  public static String[] removeDuplicates(String[] strings, boolean removeNull)
  {
    if (strings == null) {
      return strings;
    }
    int length = strings.length;
    if (length == 0) {
      return strings;
    }
    Set _strings = new HashSet(length);
    List _result = new ArrayList(length);
    for (int i = 0; i < length; i++)
    {
      String s = strings[i];
      if ((!removeNull) || (s != null)) {
        if (_strings.add(s)) {
          _result.add(s);
        }
      }
    }
    int resultLength = _result.size();
    if (resultLength == length) {
      return strings;
    }
    String[] result = new String[resultLength];
    _result.toArray(result);
    
    return result;
  }
  
  public static String[] merge(String[] strings, String delimiters, boolean removeNull)
  {
    if (strings == null) {
      return strings;
    }
    int length = strings.length;
    if (length == 0) {
      return strings;
    }
    if ((delimiters == null) || (delimiters.length() == 0)) {
      throw new IllegalArgumentException("null/empty input: delimiters");
    }
    Set _strings = new HashSet(length);
    List _result = new ArrayList(length);
    for (int i = 0; i < length; i++)
    {
      String s = strings[i];
      if ((!removeNull) || (s != null))
      {
        StringTokenizer tokenizer = new StringTokenizer(s, delimiters);
        while (tokenizer.hasMoreTokens())
        {
          String ss = tokenizer.nextToken();
          if (_strings.add(ss)) {
            _result.add(ss);
          }
        }
      }
    }
    String[] result = new String[_result.size()];
    _result.toArray(result);
    
    return result;
  }
  
  public static String[] mergeAT(String[] strings, String delimiters, boolean processAtFiles)
    throws IOException
  {
    if (!processAtFiles) {
      return merge(strings, delimiters, true);
    }
    if (strings == null) {
      return strings;
    }
    int length = strings.length;
    if (length == 0) {
      return strings;
    }
    if ((delimiters == null) || (delimiters.length() == 0)) {
      throw new IllegalArgumentException("null/empty input: delimiters");
    }
    Set _strings = new HashSet(length);
    List _result = new ArrayList(length);
    for (int i = 0; i < length; i++)
    {
      String s = strings[i];
      if (s != null)
      {
        StringTokenizer tokenizer = new StringTokenizer(s, delimiters);
        while (tokenizer.hasMoreTokens())
        {
          String ss = tokenizer.nextToken();
          if (ss.startsWith("@"))
          {
            String[] fileList = Files.readFileList(new File(ss.substring(1)));
            for (int j = 0; j < fileList.length; j++)
            {
              String sss = fileList[j];
              if (_strings.add(sss)) {
                _result.add(sss);
              }
            }
          }
          else if (_strings.add(ss))
          {
            _result.add(ss);
          }
        }
      }
    }
    String[] result = new String[_result.size()];
    _result.toArray(result);
    
    return result;
  }
  
  public static void HTMLEscape(String s, StringBuffer append)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    if (append == null) {
      throw new IllegalArgumentException("null input: append");
    }
    char[] chars = s.toCharArray();
    
    int i = 0;
    for (int iLimit = s.length(); i < iLimit; i++)
    {
      char c = chars[i];
      switch (c)
      {
      case '<': 
        append.append("&lt;");
        break;
      case '>': 
        append.append("&gt;");
        break;
      case '"': 
        append.append("&#34;");
        break;
      case '&': 
        append.append("&amp;");
        break;
      default: 
        append.append(c);
      }
    }
  }
  
  public static void HTMLEscapeNB(String s, StringBuffer append)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    if (append == null) {
      throw new IllegalArgumentException("null input: append");
    }
    char[] chars = s.toCharArray();
    
    int i = 0;
    for (int iLimit = s.length(); i < iLimit; i++)
    {
      char c = chars[i];
      switch (c)
      {
      case ' ': 
        append.append('�');
        break;
      case '\t': 
        append.append("��������");
        break;
      case '<': 
        append.append("&lt;");
        break;
      case '>': 
        append.append("&gt;");
        break;
      case '"': 
        append.append("&#34;");
        break;
      case '&': 
        append.append("&amp;");
        break;
      default: 
        append.append(c);
      }
    }
  }
  
  public static String HTMLEscape(String s)
  {
    StringBuffer buf = new StringBuffer();
    HTMLEscape(s, buf);
    
    return buf.toString();
  }
  
  public static String HTMLEscapeSP(String s)
  {
    StringBuffer buf = new StringBuffer();
    HTMLEscapeNB(s, buf);
    
    return buf.toString();
  }
}

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

class WCMatcher$1 {}

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

final class WCMatcher$AllMatcher
  extends WCMatcher
{
  WCMatcher$AllMatcher(WCMatcher.1 x0)
  {
    this();
  }
  
  public final boolean matches(String s)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    return true;
  }
  
  public final boolean matches(char[] chars)
  {
    if (chars == null) {
      throw new IllegalArgumentException("null input: chars");
    }
    return true;
  }
  
  private WCMatcher$AllMatcher() {}
}

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

final class WCMatcher$EmptyMatcher
  extends WCMatcher
{
  WCMatcher$EmptyMatcher(WCMatcher.1 x0)
  {
    this();
  }
  
  public final boolean matches(String s)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    return false;
  }
  
  public final boolean matches(char[] chars)
  {
    if (chars == null) {
      throw new IllegalArgumentException("null input: chars");
    }
    return chars.length == 0;
  }
  
  private WCMatcher$EmptyMatcher() {}
}

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

final class WCMatcher$EndsWithMatcher
  extends WCMatcher
{
  private final char[] m_suffixChars;
  private final String m_suffix;
  
  public final boolean matches(String s)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    return s.endsWith(m_suffix);
  }
  
  public final boolean matches(char[] chars)
  {
    if (chars == null) {
      throw new IllegalArgumentException("null input: chars");
    }
    char[] suffixChars = m_suffixChars;
    int suffixLength = suffixChars.length - 1;
    int charsLength = chars.length;
    if (charsLength < suffixLength) {
      return false;
    }
    for (int c = 0; c < suffixLength; c++) {
      if (chars[(charsLength - 1 - c)] != suffixChars[(suffixLength - c)]) {
        return false;
      }
    }
    return true;
  }
  
  WCMatcher$EndsWithMatcher(char[] pattern, int patternLength)
  {
    m_suffixChars = pattern;
    m_suffix = new String(pattern, 1, patternLength - 1);
  }
}

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

final class WCMatcher$PatternMatcher
  extends WCMatcher
{
  private final char[] m_pattern;
  private final int m_patternLength;
  
  public final boolean matches(String s)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    char[] string = s.toCharArray();
    int stringLength = string.length;
    
    char[] pattern = m_pattern;
    int patternLength = m_patternLength;
    
    int si = 0;int pi = 0;
    boolean star = false;
    for (;;)
    {
      int i = 0;
      for (;; i++)
      {
        if (pi + i >= patternLength) {
          break label148;
        }
        char patternChar = pattern[(pi + i)];
        if (patternChar == '*')
        {
          si += i;
          pi += i + 1;
          
          star = true;
          break;
        }
        int si_i = si + i;
        if (si_i == stringLength) {
          return false;
        }
        if (patternChar != string[si_i]) {
          if (patternChar != '?')
          {
            if (!star) {
              return false;
            }
            si++;
            
            break;
          }
        }
      }
      label148:
      if (si + i == stringLength) {
        return true;
      }
      if (!star) {
        return false;
      }
      si++;
    }
  }
  
  public final boolean matches(char[] string)
  {
    if (string == null) {
      throw new IllegalArgumentException("null input: string");
    }
    int stringLength = string.length;
    
    char[] pattern = m_pattern;
    int patternLength = m_patternLength;
    
    int si = 0;int pi = 0;
    boolean star = false;
    for (;;)
    {
      int i = 0;
      for (;; i++)
      {
        if (pi + i >= patternLength) {
          break label141;
        }
        char patternChar = pattern[(pi + i)];
        if (patternChar == '*')
        {
          si += i;
          pi += i + 1;
          
          star = true;
          break;
        }
        int si_i = si + i;
        if (si_i == stringLength) {
          return false;
        }
        if (patternChar != string[si_i]) {
          if (patternChar != '?')
          {
            if (!star) {
              return false;
            }
            si++;
            
            break;
          }
        }
      }
      label141:
      if (si + i == stringLength) {
        return true;
      }
      if (!star) {
        return false;
      }
      si++;
    }
  }
  
  WCMatcher$PatternMatcher(char[] pattern, int patternLength)
  {
    m_pattern = pattern;
    m_patternLength = patternLength;
  }
}

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

final class WCMatcher$StartsWithMatcher
  extends WCMatcher
{
  private final char[] m_prefixChars;
  private final String m_prefix;
  
  public final boolean matches(String s)
  {
    if (s == null) {
      throw new IllegalArgumentException("null input: s");
    }
    return s.startsWith(m_prefix);
  }
  
  public final boolean matches(char[] chars)
  {
    if (chars == null) {
      throw new IllegalArgumentException("null input: chars");
    }
    char[] prefixChars = m_prefixChars;
    int prefixLength = prefixChars.length - 1;
    if (chars.length < prefixLength) {
      return false;
    }
    for (int c = 0; c < prefixLength; c++) {
      if (chars[c] != prefixChars[c]) {
        return false;
      }
    }
    return true;
  }
  
  WCMatcher$StartsWithMatcher(char[] pattern, int patternLength)
  {
    m_prefixChars = pattern;
    m_prefix = new String(pattern, 0, patternLength - 1);
  }
}

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

public abstract class WCMatcher
{
  public static WCMatcher compile(String pattern)
  {
    if (pattern == null) {
      throw new IllegalArgumentException("null input: pattern");
    }
    char[] chars = pattern.toCharArray();
    int charsLength = chars.length;
    if (charsLength == 0) {
      return EMPTY_MATCHER;
    }
    int patternLength = 0;int starCount = 0;int questionCount = 0;
    boolean star = false;
    for (int c = 0; c < charsLength; c++)
    {
      char ch = chars[c];
      if (ch == '*')
      {
        if (!star)
        {
          star = true;
          starCount++;
          chars[(patternLength++)] = '*';
        }
      }
      else
      {
        star = false;
        if (ch == '?') {
          questionCount++;
        }
        chars[(patternLength++)] = ch;
      }
    }
    if ((starCount == 1) && (questionCount == 0))
    {
      if (patternLength == 1) {
        return ALL_MATCHER;
      }
      if (chars[0] == '*') {
        return new EndsWithMatcher(chars, patternLength);
      }
      if (chars[(patternLength - 1)] == '*') {
        return new StartsWithMatcher(chars, patternLength);
      }
    }
    return new PatternMatcher(chars, patternLength);
  }
  
  public abstract boolean matches(String paramString);
  
  public abstract boolean matches(char[] paramArrayOfChar);
  
  private static final class AllMatcher
    extends WCMatcher
  {
    AllMatcher(WCMatcher.1 x0)
    {
      this();
    }
    
    public final boolean matches(String s)
    {
      if (s == null) {
        throw new IllegalArgumentException("null input: s");
      }
      return true;
    }
    
    public final boolean matches(char[] chars)
    {
      if (chars == null) {
        throw new IllegalArgumentException("null input: chars");
      }
      return true;
    }
    
    private AllMatcher() {}
  }
  
  private static final class EmptyMatcher
    extends WCMatcher
  {
    EmptyMatcher(WCMatcher.1 x0)
    {
      this();
    }
    
    public final boolean matches(String s)
    {
      if (s == null) {
        throw new IllegalArgumentException("null input: s");
      }
      return false;
    }
    
    public final boolean matches(char[] chars)
    {
      if (chars == null) {
        throw new IllegalArgumentException("null input: chars");
      }
      return chars.length == 0;
    }
    
    private EmptyMatcher() {}
  }
  
  private static final class StartsWithMatcher
    extends WCMatcher
  {
    private final char[] m_prefixChars;
    private final String m_prefix;
    
    public final boolean matches(String s)
    {
      if (s == null) {
        throw new IllegalArgumentException("null input: s");
      }
      return s.startsWith(m_prefix);
    }
    
    public final boolean matches(char[] chars)
    {
      if (chars == null) {
        throw new IllegalArgumentException("null input: chars");
      }
      char[] prefixChars = m_prefixChars;
      int prefixLength = prefixChars.length - 1;
      if (chars.length < prefixLength) {
        return false;
      }
      for (int c = 0; c < prefixLength; c++) {
        if (chars[c] != prefixChars[c]) {
          return false;
        }
      }
      return true;
    }
    
    StartsWithMatcher(char[] pattern, int patternLength)
    {
      m_prefixChars = pattern;
      m_prefix = new String(pattern, 0, patternLength - 1);
    }
  }
  
  private static final class EndsWithMatcher
    extends WCMatcher
  {
    private final char[] m_suffixChars;
    private final String m_suffix;
    
    public final boolean matches(String s)
    {
      if (s == null) {
        throw new IllegalArgumentException("null input: s");
      }
      return s.endsWith(m_suffix);
    }
    
    public final boolean matches(char[] chars)
    {
      if (chars == null) {
        throw new IllegalArgumentException("null input: chars");
      }
      char[] suffixChars = m_suffixChars;
      int suffixLength = suffixChars.length - 1;
      int charsLength = chars.length;
      if (charsLength < suffixLength) {
        return false;
      }
      for (int c = 0; c < suffixLength; c++) {
        if (chars[(charsLength - 1 - c)] != suffixChars[(suffixLength - c)]) {
          return false;
        }
      }
      return true;
    }
    
    EndsWithMatcher(char[] pattern, int patternLength)
    {
      m_suffixChars = pattern;
      m_suffix = new String(pattern, 1, patternLength - 1);
    }
  }
  
  private static final class PatternMatcher
    extends WCMatcher
  {
    private final char[] m_pattern;
    private final int m_patternLength;
    
    public final boolean matches(String s)
    {
      if (s == null) {
        throw new IllegalArgumentException("null input: s");
      }
      char[] string = s.toCharArray();
      int stringLength = string.length;
      
      char[] pattern = m_pattern;
      int patternLength = m_patternLength;
      
      int si = 0;int pi = 0;
      boolean star = false;
      for (;;)
      {
        int i = 0;
        for (;; i++)
        {
          if (pi + i >= patternLength) {
            break label148;
          }
          char patternChar = pattern[(pi + i)];
          if (patternChar == '*')
          {
            si += i;
            pi += i + 1;
            
            star = true;
            break;
          }
          int si_i = si + i;
          if (si_i == stringLength) {
            return false;
          }
          if (patternChar != string[si_i]) {
            if (patternChar != '?')
            {
              if (!star) {
                return false;
              }
              si++;
              
              break;
            }
          }
        }
        label148:
        if (si + i == stringLength) {
          return true;
        }
        if (!star) {
          return false;
        }
        si++;
      }
    }
    
    public final boolean matches(char[] string)
    {
      if (string == null) {
        throw new IllegalArgumentException("null input: string");
      }
      int stringLength = string.length;
      
      char[] pattern = m_pattern;
      int patternLength = m_patternLength;
      
      int si = 0;int pi = 0;
      boolean star = false;
      for (;;)
      {
        int i = 0;
        for (;; i++)
        {
          if (pi + i >= patternLength) {
            break label141;
          }
          char patternChar = pattern[(pi + i)];
          if (patternChar == '*')
          {
            si += i;
            pi += i + 1;
            
            star = true;
            break;
          }
          int si_i = si + i;
          if (si_i == stringLength) {
            return false;
          }
          if (patternChar != string[si_i]) {
            if (patternChar != '?')
            {
              if (!star) {
                return false;
              }
              si++;
              
              break;
            }
          }
        }
        label141:
        if (si + i == stringLength) {
          return true;
        }
        if (!star) {
          return false;
        }
        si++;
      }
    }
    
    PatternMatcher(char[] pattern, int patternLength)
    {
      m_pattern = pattern;
      m_patternLength = patternLength;
    }
  }
  
  private static final WCMatcher ALL_MATCHER = new AllMatcher(null);
  private static final WCMatcher EMPTY_MATCHER = new EmptyMatcher(null);
}

/* Location:
 * Qualified Name:     com.vladium.util.WCMatcher
 * 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.Enumeration;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;

public class XProperties
  extends Properties
{
  public XProperties() {}
  
  public XProperties(Properties base)
  {
    super(base);
  }
  
  public void list(PrintStream out)
  {
    Set _propertyNames = new TreeSet();
    for (Enumeration propertyNames = propertyNames(); propertyNames.hasMoreElements();) {
      _propertyNames.add(propertyNames.nextElement());
    }
    for (Iterator i = _propertyNames.iterator(); i.hasNext();)
    {
      String n = (String)i.next();
      String v = getProperty(n);
      
      out.println(n + ":\t[" + v + "]");
    }
  }
  
  public void list(PrintWriter out)
  {
    Set _propertyNames = new TreeSet();
    for (Enumeration propertyNames = propertyNames(); propertyNames.hasMoreElements();) {
      _propertyNames.add(propertyNames.nextElement());
    }
    for (Iterator i = _propertyNames.iterator(); i.hasNext();)
    {
      String n = (String)i.next();
      String v = getProperty(n);
      
      out.println(n + ":\t[" + v + "]");
    }
  }
}

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

public abstract class IOptsParser$Factory
{
  public static IOptsParser create(String metadataResourceName, ClassLoader loader, String msgPrefix, String[] usageOpts)
  {
    return new OptsParser(metadataResourceName, loader, msgPrefix, usageOpts);
  }
}

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

public abstract interface IOptsParser$IOpt
{
  public abstract String getName();
  
  public abstract String getCanonicalName();
  
  public abstract String getPatternPrefix();
  
  public abstract int getValueCount();
  
  public abstract String getFirstValue();
  
  public abstract String[] getValues();
}

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

import java.io.PrintWriter;

public abstract interface IOptsParser$IOpts
{
  public abstract int usageRequestLevel();
  
  public abstract void error(PrintWriter paramPrintWriter, int paramInt);
  
  public abstract IOptsParser.IOpt[] getOpts();
  
  public abstract boolean hasArg(String paramString);
  
  public abstract IOptsParser.IOpt[] getOpts(String paramString);
  
  public abstract String[] getFreeArgs();
}

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

import java.io.PrintWriter;

public abstract interface IOptsParser
{
  public static final int SHORT_USAGE = 1;
  public static final int DETAILED_USAGE = 2;
  
  public abstract void usage(PrintWriter paramPrintWriter, int paramInt1, int paramInt2);
  
  public abstract IOpts parse(String[] paramArrayOfString);
  
  public static abstract class Factory
  {
    public static IOptsParser create(String metadataResourceName, ClassLoader loader, String msgPrefix, String[] usageOpts)
    {
      return new OptsParser(metadataResourceName, loader, msgPrefix, usageOpts);
    }
  }
  
  public static abstract interface IOpts
  {
    public abstract int usageRequestLevel();
    
    public abstract void error(PrintWriter paramPrintWriter, int paramInt);
    
    public abstract IOptsParser.IOpt[] getOpts();
    
    public abstract boolean hasArg(String paramString);
    
    public abstract IOptsParser.IOpt[] getOpts(String paramString);
    
    public abstract String[] getFreeArgs();
  }
  
  public static abstract interface IOpt
  {
    public abstract String getName();
    
    public abstract String getCanonicalName();
    
    public abstract String getPatternPrefix();
    
    public abstract int getValueCount();
    
    public abstract String getFirstValue();
    
    public abstract String[] getValues();
  }
}

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

import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

final class OptsParser$MetadataParser
{
  private Reader m_in;
  private List m_opts;
  private OptsParser.Token m_token;
  private int m_currentChar;
  private static final Map KEYWORDS;
  
  OptsParser.OptDef[] parse(Reader in)
  {
    if (in == null) {
      throw new IllegalArgumentException("null input: in");
    }
    m_in = in;
    
    nextChar();
    nextToken();
    while (m_token != OptsParser.Token.EOF)
    {
      if (m_opts == null) {
        m_opts = new ArrayList();
      }
      m_opts.add(optdef());
    }
    OptsParser.OptDef[] result;
    OptsParser.OptDef[] result;
    if ((m_opts == null) || (m_opts.size() == 0))
    {
      result = EMPTY_OPTDEF_ARRAY;
    }
    else
    {
      result = new OptsParser.OptDef[m_opts.size()];
      m_opts.toArray(result);
    }
    m_in = null;
    m_opts = null;
    
    return result;
  }
  
  OptsParser.OptDef optdef()
  {
    OptsParser.OptDef optdef = new OptsParser.OptDef(false);
    
    optdef.setNames(optnamelist());
    accept(2);
    optmetadata(optdef);
    accept(3);
    
    return optdef;
  }
  
  String[] optnamelist()
  {
    return namelist();
  }
  
  void optmetadata(OptsParser.OptDef optdef)
  {
    switch (m_token.getID())
    {
    case 8: 
      accept();
      optdef.setRequired(true);
      
      break;
    case 7: 
      accept();
      optdef.setRequired(false);
      
      break;
    default: 
      throw new IllegalArgumentException("parse error: invalid token " + m_token + ", expected " + OptsParser.Token.REQUIRED + " or " + OptsParser.Token.OPTIONAL);
    }
    accept(4);
    if (m_token.getID() == 14)
    {
      accept();
      optdef.setMergeable(true);
      
      accept(4);
    }
    if (m_token.getID() == 15)
    {
      accept();
      optdef.setDetailedOnly(true);
      
      accept(4);
    }
    if (m_token.getID() == 16)
    {
      accept();
      optdef.setPattern(true);
      
      accept(4);
    }
    accept(10);
    accept(2);
    optdef.setValueCardinality(cardinality());
    
    accept(4);
    if (m_token.getID() == 1)
    {
      optdef.setValueMnemonic(m_token.getValue());
      accept();
      
      accept(4);
    }
    if (m_token.getID() == 12)
    {
      accept();
      
      accept(5);
      optdef.setRequiresSet(namelist());
      accept(6);
      
      accept(4);
    }
    if (m_token.getID() == 13)
    {
      accept();
      
      accept(5);
      optdef.setExcludesSet(namelist());
      accept(6);
      
      accept(4);
    }
    optdef.setDescription(accept(11).getValue());
  }
  
  int[] cardinality()
  {
    OptsParser.Token result = accept(9);
    if ("0".equals(result.getValue())) {
      return OptsParser.OptDef.C_ZERO;
    }
    if ("1".equals(result.getValue())) {
      return OptsParser.OptDef.C_ONE;
    }
    return OptsParser.OptDef.C_ZERO_OR_ONE;
  }
  
  String[] namelist()
  {
    List _result = new ArrayList();
    
    _result.add(accept(1).getValue());
    while (m_token.getID() == 4)
    {
      accept();
      _result.add(accept(1).getValue());
    }
    String[] result = new String[_result.size()];
    _result.toArray(result);
    
    return result;
  }
  
  OptsParser.Token accept()
  {
    OptsParser.Token current = m_token;
    nextToken();
    
    return current;
  }
  
  OptsParser.Token accept(int tokenID)
  {
    OptsParser.Token current = m_token;
    if (m_token.getID() == tokenID) {
      nextToken();
    } else {
      throw new IllegalArgumentException("parse error: invalid token [" + m_token + "], expected type [" + tokenID + "]");
    }
    return current;
  }
  
  void nextToken()
  {
    consumeWS();
    switch (m_currentChar)
    {
    case -1: 
      m_token = OptsParser.Token.EOF; break;
    case 58: 
      nextChar();
      m_token = OptsParser.Token.COLON;
      
      break;
    case 59: 
      nextChar();
      m_token = OptsParser.Token.SEMICOLON;
      
      break;
    case 44: 
      nextChar();
      m_token = OptsParser.Token.COMMA;
      
      break;
    case 123: 
      nextChar();
      m_token = OptsParser.Token.LBRACKET;
      
      break;
    case 125: 
      nextChar();
      m_token = OptsParser.Token.RBRACKET;
      
      break;
    case 48: 
      nextChar();
      m_token = new OptsParser.Token(9, "0");
      
      break;
    case 49: 
      nextChar();
      m_token = new OptsParser.Token(9, "1");
      
      break;
    case 63: 
      nextChar();
      m_token = new OptsParser.Token(9, "?");
      
      break;
    case 39: 
      StringBuffer value = new StringBuffer();
      
      nextChar();
      while (m_currentChar != 39)
      {
        value.append((char)m_currentChar);
        nextChar();
      }
      nextChar();
      
      m_token = new OptsParser.Token(1, value.toString());
      
      break;
    case 34: 
      StringBuffer value = new StringBuffer();
      
      nextChar();
      while (m_currentChar != 34)
      {
        value.append((char)m_currentChar);
        nextChar();
      }
      nextChar();
      
      m_token = new OptsParser.Token(11, value.toString());
      
      break;
    default: 
      StringBuffer value = new StringBuffer();
      while (Character.isLetter((char)m_currentChar))
      {
        value.append((char)m_currentChar);
        nextChar();
      }
      OptsParser.Token token = (OptsParser.Token)KEYWORDS.get(value.toString());
      if (token == null) {
        throw new IllegalArgumentException("parse error: unrecognized keyword [" + value + "]");
      }
      m_token = token;
    }
  }
  
  private void consumeWS()
  {
    if (m_currentChar == -1) {
      return;
    }
    while (Character.isWhitespace((char)m_currentChar)) {
      nextChar();
    }
  }
  
  private void nextChar()
  {
    try
    {
      m_currentChar = m_in.read();
    }
    catch (IOException ioe)
    {
      throw new RuntimeException("I/O error while parsing: " + ioe);
    }
  }
  
  private static final OptsParser.OptDef[] EMPTY_OPTDEF_ARRAY = new OptsParser.OptDef[0];
  
  static
  {
    KEYWORDS = new HashMap(17);
    
    KEYWORDS.put(OptsParser.Token.OPTIONAL.getValue(), OptsParser.Token.OPTIONAL);
    KEYWORDS.put(OptsParser.Token.REQUIRED.getValue(), OptsParser.Token.REQUIRED);
    KEYWORDS.put(OptsParser.Token.VALUES.getValue(), OptsParser.Token.VALUES);
    KEYWORDS.put(OptsParser.Token.REQUIRES.getValue(), OptsParser.Token.REQUIRES);
    KEYWORDS.put(OptsParser.Token.EXCLUDES.getValue(), OptsParser.Token.EXCLUDES);
    KEYWORDS.put(OptsParser.Token.MERGEABLE.getValue(), OptsParser.Token.MERGEABLE);
    KEYWORDS.put(OptsParser.Token.DETAILEDONLY.getValue(), OptsParser.Token.DETAILEDONLY);
    KEYWORDS.put(OptsParser.Token.PATTERN.getValue(), OptsParser.Token.PATTERN);
  }
}

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

import com.vladium.util.IConstants;
import java.util.ArrayList;

final class OptsParser$Opt
  implements IOptsParser.IOpt
{
  private final String m_name;
  private final String m_canonicalName;
  private final String m_patternPrefix;
  private ArrayList m_values;
  
  public String getName()
  {
    return m_name;
  }
  
  public String getCanonicalName()
  {
    return m_canonicalName;
  }
  
  public int getValueCount()
  {
    if (m_values == null) {
      return 0;
    }
    return m_values.size();
  }
  
  public String getFirstValue()
  {
    if (m_values == null) {
      return null;
    }
    return (String)m_values.get(0);
  }
  
  public String[] getValues()
  {
    if (m_values == null) {
      return IConstants.EMPTY_STRING_ARRAY;
    }
    String[] result = new String[m_values.size()];
    m_values.toArray(result);
    
    return result;
  }
  
  public String getPatternPrefix()
  {
    return m_patternPrefix;
  }
  
  public String toString()
  {
    StringBuffer s = new StringBuffer(m_name);
    if (!m_canonicalName.equals(m_name)) {
      s.append(" [" + m_canonicalName + "]");
    }
    if (m_values != null)
    {
      s.append(": ");
      s.append(m_values);
    }
    return s.toString();
  }
  
  OptsParser$Opt(String name, String canonicalName, String patternPrefix)
  {
    m_name = name;
    m_canonicalName = canonicalName;
    m_patternPrefix = patternPrefix;
  }
  
  void addValue(String value)
  {
    if (value == null) {
      throw new IllegalArgumentException("null input: value");
    }
    if (m_values == null) {
      m_values = new ArrayList();
    }
    m_values.add(value);
  }
}

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

final class OptsParser$OptDef
{
  OptsParser$OptDef(boolean usage)
  {
    m_usage = usage;
  }
  
  boolean isUsage()
  {
    return m_usage;
  }
  
  String getCanonicalName()
  {
    return m_names[0];
  }
  
  String[] getNames()
  {
    return m_names;
  }
  
  boolean isRequired()
  {
    return m_required;
  }
  
  String getValueMnemonic()
  {
    return m_valueMnemonic;
  }
  
  boolean isMergeable()
  {
    return m_mergeable;
  }
  
  boolean isDetailedOnly()
  {
    return m_detailedOnly;
  }
  
  boolean isPattern()
  {
    return m_pattern;
  }
  
  int[] getValueCardinality()
  {
    return m_valueCardinality;
  }
  
  String[] getRequiresSet()
  {
    return m_requiresSet;
  }
  
  String[] getExcludesSet()
  {
    return m_excludesSet;
  }
  
  String getDescription()
  {
    return m_description;
  }
  
  void setNames(String[] names)
  {
    if (names == null) {
      throw new IllegalArgumentException("null input: names");
    }
    m_names = names;
  }
  
  void setRequired(boolean required)
  {
    m_required = required;
  }
  
  void setValueMnemonic(String mnemonic)
  {
    if (mnemonic == null) {
      throw new IllegalArgumentException("null input: mnemonic");
    }
    m_valueMnemonic = mnemonic;
  }
  
  void setMergeable(boolean mergeable)
  {
    m_mergeable = mergeable;
  }
  
  void setDetailedOnly(boolean detailedOnly)
  {
    m_detailedOnly = detailedOnly;
  }
  
  void setPattern(boolean pattern)
  {
    m_pattern = pattern;
  }
  
  void setValueCardinality(int[] cardinality)
  {
    if ((cardinality == null) || (cardinality.length != 2)) {
      throw new IllegalArgumentException("null or invalid input: cardinality");
    }
    m_valueCardinality = cardinality;
  }
  
  void setRequiresSet(String[] names)
  {
    if (names == null) {
      throw new IllegalArgumentException("null input: names");
    }
    m_requiresSet = (names.length > 0 ? names : null);
  }
  
  void setExcludesSet(String[] names)
  {
    if (names == null) {
      throw new IllegalArgumentException("null input: names");
    }
    m_excludesSet = (names.length > 0 ? names : null);
  }
  
  void setDescription(String description)
  {
    if (description == null) {
      throw new IllegalArgumentException("null input: description");
    }
    m_description = description;
  }
  
  static final int[] C_ZERO = { 0, 0 };
  static final int[] C_ONE = { 1, 1 };
  static final int[] C_ZERO_OR_ONE = { 0, 1 };
  static final int[] C_ZERO_OR_MORE = { 0, Integer.MAX_VALUE };
  static final int[] C_ONE_OR_MORE = { 1, Integer.MAX_VALUE };
  private final boolean m_usage;
  private String[] m_names;
  private boolean m_required;
  private String m_valueMnemonic;
  private boolean m_mergeable;
  private boolean m_detailedOnly;
  private boolean m_pattern;
  private int[] m_valueCardinality;
  private String[] m_requiresSet;
  private String[] m_excludesSet;
  private String m_description;
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

final class OptsParser$OptDefMetadata
{
  final List m_optdefs;
  final Map m_optdefMap;
  final Set m_requiredOpts;
  final Map m_patternOptDefMap;
  private OptsParser.OptDef m_usageOptDef;
  
  OptsParser$OptDefMetadata()
  {
    m_optdefs = new ArrayList();
    m_optdefMap = new HashMap();
    m_requiredOpts = new HashSet();
    m_patternOptDefMap = new HashMap();
  }
  
  OptsParser.OptDef getOptDef(String name, String[] prefixout)
  {
    if (name == null) {
      throw new IllegalArgumentException("null input: name");
    }
    if (prefixout != null) {
      prefixout[0] = null;
    }
    OptsParser.OptDef result = (OptsParser.OptDef)m_optdefMap.get(name);
    if (result == null)
    {
      Iterator ps = m_patternOptDefMap.entrySet().iterator();
      while (ps.hasNext())
      {
        Map.Entry entry = (Map.Entry)ps.next();
        String pattern = (String)entry.getKey();
        if (name.startsWith(pattern))
        {
          if (prefixout != null) {
            prefixout[0] = pattern;
          }
          result = (OptsParser.OptDef)entry.getValue();
          break;
        }
      }
    }
    return result;
  }
  
  Iterator getOptDefs()
  {
    return m_optdefs.iterator();
  }
  
  OptsParser.OptDef getPatternOptDefs(String pattern)
  {
    if (pattern == null) {
      throw new IllegalArgumentException("null input: pattern");
    }
    return (OptsParser.OptDef)m_patternOptDefMap.get(pattern);
  }
  
  Set getRequiredOpts()
  {
    return m_requiredOpts;
  }
  
  OptsParser.OptDef getUsageOptDef()
  {
    return m_usageOptDef;
  }
  
  void addOptDef(OptsParser.OptDef optdef)
  {
    if (optdef == null) {
      throw new IllegalArgumentException("null input: optdef");
    }
    Map map = optdef.isPattern() ? m_patternOptDefMap : m_optdefMap;
    String[] names = optdef.getNames();
    for (int n = 0; n < names.length; n++)
    {
      if (map.containsKey(names[n])) {
        throw new IllegalArgumentException("duplicate option name [" + names[n] + "]");
      }
      map.put(names[n], optdef);
    }
    m_optdefs.add(optdef);
    if (optdef.isRequired()) {
      m_requiredOpts.add(optdef.getCanonicalName());
    }
    if (optdef.isUsage())
    {
      if (m_usageOptDef != null) {
        throw new IllegalArgumentException("usage optdef set already");
      }
      m_usageOptDef
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