Package java.util

Examples of java.util.EnumSet$EnumSetImpl$IteratorImpl


  }

  @Override
  protected EnumSet<ForgeDirection> getConsumingSides()
  {
    EnumSet set = EnumSet.allOf(ForgeDirection.class);
    set.removeAll(getOutputtingSides());
    set.remove(ForgeDirection.UNKNOWN);

    return set;
  }
View Full Code Here


     */
    public EnumTypeConverter(DatabaseMapping mapping, Class enumClass, boolean useOrdinalValues) {
        super(mapping);
        m_enumClassName = enumClass.getName();
        m_enumClass = enumClass;
        EnumSet theEnums = EnumSet.allOf(enumClass);
        Iterator<Enum> i = theEnums.iterator();
       
        while (i.hasNext()) {
            Enum theEnum = i.next();
           
            if (useOrdinalValues) {
View Full Code Here

    public boolean canConvert(Class type) {
        return EnumSet.class.isAssignableFrom(type);
    }

    public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
        EnumSet set = (EnumSet) source;
        Class enumTypeForSet = (Class) Fields.read(typeField, set);
        String attributeName = mapper.aliasForSystemAttribute("enum-type");
        if (attributeName != null) {
            writer.addAttribute(attributeName, mapper.serializedClass(enumTypeForSet));
        }
View Full Code Here

        String attributeName = mapper.aliasForSystemAttribute("enum-type");
        if (attributeName == null) {
            throw new ConversionException("No EnumType specified for EnumSet");
        }
        Class enumTypeForSet = mapper.realClass(reader.getAttribute(attributeName));
        EnumSet set = EnumSet.noneOf(enumTypeForSet);
        String[] enumValues = reader.getValue().split(",");
        for (int i = 0; i < enumValues.length; i++) {
            String enumValue = enumValues[i];
            if(enumValue.length() > 0) {
                set.add(Enum.valueOf(enumTypeForSet, enumValue));
            }
        }
        return set;
    }
View Full Code Here

    }

    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

        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

        ArrayList enums = new ArrayList();
        for (Object object : l) {
            enums.add(ec.decode(enumType, object));
        }
        EnumSet copyOf = EnumSet.copyOf(enums);
        return copyOf;
    }
View Full Code Here

        if (value == null)
            return null;

        ArrayList values = new ArrayList();

        EnumSet s = (EnumSet) value;
        Object[] array = s.toArray();
        for (int i = 0; i < array.length; i++) {
            values.add(ec.encode(array[i]));
        }

        return values;
View Full Code Here

   * @return the enumerator value
   * @throws ConfigurationException
   * @throws Exception if the en Class is not an Enumerator that implements the IProperties interface
   */
  public static Object findByKey(Class en,String iKey) throws ConfigurationException {
    EnumSet values = EnumSet.allOf( en );
      for (Object v : values) {
          try {
        if ( ((String)en.getMethod("getKey").invoke(v)).equalsIgnoreCase(iKey)  )
          return v;
      } catch (Exception e) {
View Full Code Here

  
  public static Object findByKey(String completeKey) throws ConfigurationException {
    String[] splittedKeys=completeKey.split("\\.");
    String section=splittedKeys[0];
    Class en = PropertiesConfigurationHelper.CONFIGURATION_SECTIONS.get(section);
    EnumSet values = EnumSet.allOf( en );
      for (Object v : values) {
          try {
            String key=StringUtils.join(Arrays.copyOfRange(splittedKeys, 1, splittedKeys.length),".");
        if ( ((String)en.getMethod("getKey").invoke(v)).equalsIgnoreCase(key)  )
          return v;
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.