org-openide-util-enumerations

16:40:43.596 INFO  jd.cli.Main - Decompiling org-openide-util-enumerations.jar
package org.openide.util.enum;

import java.util.Enumeration;

/**
 * @deprecated
 */
public abstract class AlterEnumeration
  implements Enumeration
{
  private Enumeration en;
  
  public AlterEnumeration(Enumeration paramEnumeration)
  {
    en = paramEnumeration;
  }
  
  protected abstract Object alter(Object paramObject);
  
  public boolean hasMoreElements()
  {
    return en.hasMoreElements();
  }
  
  public Object nextElement()
  {
    return alter(en.nextElement());
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.AlterEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
 * @deprecated
 */
public class ArrayEnumeration
  implements Enumeration
{
  private Object[] array;
  private int index = 0;
  
  public ArrayEnumeration(Object[] paramArrayOfObject)
  {
    array = paramArrayOfObject;
  }
  
  public boolean hasMoreElements()
  {
    return index < array.length;
  }
  
  public Object nextElement()
  {
    try
    {
      return array[(index++)];
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException)
    {
      throw new NoSuchElementException();
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.ArrayEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
 * @deprecated
 */
public final class EmptyEnumeration
  implements Enumeration
{
  public static final EmptyEnumeration EMPTY = new EmptyEnumeration();
  
  public boolean hasMoreElements()
  {
    return false;
  }
  
  public Object nextElement()
    throws NoSuchElementException
  {
    throw new NoSuchElementException();
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.EmptyEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
 * @deprecated
 */
public class FilterEnumeration
  implements Enumeration
{
  private static final Object EMPTY = new Object();
  private Enumeration en;
  private Object next = EMPTY;
  
  public FilterEnumeration(Enumeration paramEnumeration)
  {
    en = paramEnumeration;
  }
  
  protected boolean accept(Object paramObject)
  {
    return paramObject != null;
  }
  
  public boolean hasMoreElements()
  {
    if (next != EMPTY) {
      return true;
    }
    while (en.hasMoreElements())
    {
      next = en.nextElement();
      if (accept(next)) {
        return true;
      }
    }
    next = EMPTY;
    
    return false;
  }
  
  public Object nextElement()
  {
    if ((next == EMPTY) && (!hasMoreElements())) {
      throw new NoSuchElementException();
    }
    Object localObject = next;
    next = EMPTY;
    
    return localObject;
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.FilterEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

final class QueueEnumeration$ListItem
{
  Object object;
  ListItem next;
  
  QueueEnumeration$ListItem(Object paramObject)
  {
    object = paramObject;
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.QueueEnumeration.ListItem
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
 * @deprecated
 */
public class QueueEnumeration
  implements Enumeration
{
  private ListItem next;
  private ListItem last;
  
  public QueueEnumeration()
  {
    next = null;
    
    last = null;
  }
  
  protected void process(Object paramObject) {}
  
  public synchronized void put(Object paramObject)
  {
    if (last != null)
    {
      ListItem localListItem = new ListItem(paramObject);
      last.next = localListItem;
      last = localListItem;
    }
    else
    {
      next = (last = new ListItem(paramObject));
    }
  }
  
  public synchronized void put(Object[] paramArrayOfObject)
  {
    for (int i = 0; i < paramArrayOfObject.length; i++) {
      put(paramArrayOfObject[i]);
    }
  }
  
  public boolean hasMoreElements()
  {
    return next != null;
  }
  
  public synchronized Object nextElement()
  {
    if (next == null) {
      throw new NoSuchElementException();
    }
    Object localObject = next.object;
    if ((next = next.next) == null) {
      last = null;
    }
    process(localObject);
    
    return localObject;
  }
  
  private static final class ListItem
  {
    Object object;
    ListItem next;
    
    ListItem(Object paramObject)
    {
      object = paramObject;
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.QueueEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.HashSet;

/**
 * @deprecated
 */
public class RemoveDuplicatesEnumeration
  extends FilterEnumeration
{
  private HashSet all = new HashSet(37);
  
  public RemoveDuplicatesEnumeration(Enumeration paramEnumeration)
  {
    super(paramEnumeration);
  }
  
  protected boolean accept(Object paramObject)
  {
    return all.add(paramObject);
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.RemoveDuplicatesEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
 * @deprecated
 */
public class SequenceEnumeration
  implements Enumeration
{
  private Enumeration en;
  private Enumeration current;
  private boolean checked = false;
  
  public SequenceEnumeration(Enumeration paramEnumeration)
  {
    en = paramEnumeration;
  }
  
  public SequenceEnumeration(Enumeration paramEnumeration1, Enumeration paramEnumeration2)
  {
    this(new ArrayEnumeration(new Enumeration[] { paramEnumeration1, paramEnumeration2 }));
  }
  
  private void ensureCurrent()
  {
    while ((current == null) || (!current.hasMoreElements())) {
      if (en.hasMoreElements())
      {
        current = ((Enumeration)en.nextElement());
      }
      else
      {
        current = null;
        
        return;
      }
    }
  }
  
  public boolean hasMoreElements()
  {
    if (!checked)
    {
      ensureCurrent();
      checked = true;
    }
    return current != null;
  }
  
  public synchronized Object nextElement()
  {
    if (!checked) {
      ensureCurrent();
    }
    if (current != null)
    {
      checked = false;
      
      return current.nextElement();
    }
    checked = true;
    throw new NoSuchElementException();
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.SequenceEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.util.enum;

import java.util.Enumeration;
import java.util.NoSuchElementException;

/**
 * @deprecated
 */
public class SingletonEnumeration
  implements Enumeration
{
  private Object object;
  
  public SingletonEnumeration(Object paramObject)
  {
    object = paramObject;
  }
  
  public boolean hasMoreElements()
  {
    return object != null;
  }
  
  public synchronized Object nextElement()
  {
    if (object == null) {
      throw new NoSuchElementException();
    }
    Object localObject = object;
    object = null;
    
    return localObject;
  }
}

/* Location:
 * Qualified Name:     org.openide.util.enum.SingletonEnumeration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
1

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