Package java.util

Examples of java.util.EnumSet$EnumSetImpl$IteratorImpl


    }

    protected void initializeConversions(Class enumClass) {
        // Initialize conversion if not already set by Converter
        if (getFieldToAttributeValues().isEmpty()) {
            EnumSet theEnums = EnumSet.allOf(enumClass);
            Iterator<Enum> i = theEnums.iterator();
           
            while (i.hasNext()) {
                Enum theEnum = i.next();
               
                if (m_useOrdinalValues) {
View Full Code Here


  /*
   * Simple way to cycle an enum...
   */
  public static <T extends Enum> T nextEnum(T ce)
  {
    EnumSet valList = EnumSet.allOf( ce.getClass() );

    int pLoc = ce.ordinal() + 1;
    if ( pLoc >= valList.size() )
      pLoc = 0;

    if ( pLoc < 0 || pLoc >= valList.size() )
      pLoc = 0;

    int pos = 0;
    for (Object g : valList)
    {
View Full Code Here

  /*
   * Simple way to cycle an enum...
   */
  public static <T extends Enum> T prevEnum(T ce)
  {
    EnumSet valList = EnumSet.allOf( ce.getClass() );

    int pLoc = ce.ordinal() - 1;
    if ( pLoc < 0 )
      pLoc = valList.size() - 1;

    if ( pLoc < 0 || pLoc >= valList.size() )
      pLoc = 0;

    int pos = 0;
    for (Object g : valList)
    {
View Full Code Here

  {
    String comment = null;

    if ( value != null )
    {
      EnumSet set = EnumSet.allOf( value.getClass() );

      for (Object Oeg : set)
      {
        Enum eg = (Enum) Oeg;
        if ( comment == null )
View Full Code Here

    {
      localObject = EnumSet.copyOf((EnumSet)paramIterable);
      return new ImmutableEnumSet((EnumSet)localObject);
    }
    Object localObject = (Enum)localIterator.next();
    EnumSet localEnumSet = EnumSet.of((Enum)localObject);
    while (localIterator.hasNext())
      localEnumSet.add(localIterator.next());
    return new ImmutableEnumSet(localEnumSet);
  }
View Full Code Here

  }

  public static EnumSet newEnumSet(Iterable paramIterable, Class paramClass)
  {
    Preconditions.checkNotNull(paramIterable);
    EnumSet localEnumSet = EnumSet.noneOf(paramClass);
    Iterables.addAll(localEnumSet, paramIterable);
    return localEnumSet;
  }
View Full Code Here

    return (paramCollection instanceof EnumSet) ? EnumSet.complementOf((EnumSet)paramCollection) : makeComplementByHand(paramCollection, paramClass);
  }

  private static EnumSet makeComplementByHand(Collection paramCollection, Class paramClass)
  {
    EnumSet localEnumSet = EnumSet.allOf(paramClass);
    localEnumSet.removeAll(paramCollection);
    return localEnumSet;
  }
View Full Code Here

        serializer.write(kryo, output, element);
    }

    public EnumSet read (Kryo kryo, Input input, Class<EnumSet> type) {
      Registration registration = kryo.readClass(input);
      EnumSet object = EnumSet.noneOf(registration.getType());
      Serializer serializer = registration.getSerializer();
      int length = input.readInt(true);
      for (int i = 0; i < length; i++)
        object.add(serializer.read(kryo, input, null));
      return object;
    }
View Full Code Here

  static public class EnumSetSerializer extends Serializer<EnumSet> {
    public void write (Kryo kryo, Output output, EnumSet object) {
      Serializer serializer;
      if (object.isEmpty()) {
        EnumSet tmp = EnumSet.complementOf(object);
        if (tmp.isEmpty()) throw new KryoException("An EnumSet must have a defined Enum to be serialized.");
        serializer = kryo.writeClass(output, tmp.iterator().next().getClass()).getSerializer();
      } else {
        serializer = kryo.writeClass(output, object.iterator().next().getClass()).getSerializer();
      }
      output.writeInt(object.size(), true);
      for (Object element : object)
View Full Code Here

        serializer.write(kryo, output, element);
    }

    public EnumSet read (Kryo kryo, Input input, Class<EnumSet> type) {
      Registration registration = kryo.readClass(input);
      EnumSet object = EnumSet.noneOf(registration.getType());
      Serializer serializer = registration.getSerializer();
      int length = input.readInt(true);
      for (int i = 0; i < length; i++)
        object.add(serializer.read(kryo, input, null));
      return object;
    }
View Full Code Here

TOP

Related Classes of java.util.EnumSet$EnumSetImpl$IteratorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.