Package java.util

Examples of java.util.EnumSet$EnumSetImpl$IteratorImpl


    }

    @Override
    public EnumSet read( final ByteBuffer buffer ) {
        final Class elementType = _kryo.readClass( buffer ).getType();
        final EnumSet result = EnumSet.noneOf( elementType );
        final int size = IntSerializer.get( buffer, true );
        for ( int i = 0; i < size; i++ ) {
            result.add( EnumSerializer.get( buffer, elementType ) );
        }
        return result;
    }
View Full Code Here


public class FSTCPEnumSetSerializer extends FSTBasicObjectSerializer {

    Field elemType;
    @Override
    public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
        EnumSet enset = (EnumSet) toWrite;
        int count = 0;
        out.writeInt(enset.size());
        if ( enset.isEmpty() ) { //WTF only way to determine enumtype ..
            EnumSet compl = EnumSet.complementOf(enset);
            out.writeClassTag(compl.iterator().next().getClass());
        } else {
            for (Object element : enset) {
                if ( count == 0 ) {
                    out.writeStringUTF(element.getClass().getName());
                }
View Full Code Here

    @Override
    public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPositioin) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        int len = in.readInt();
        Class elemCl = in.getClassForName( in.readStringUTF() );
        EnumSet enSet = EnumSet.noneOf(elemCl);
        in.registerObject(enSet,streamPositioin,serializationInfo, referencee); // IMPORTANT, else tracking double objects will fail
        for (int i = 0; i < len; i++) {
            String val = in.readStringUTF();
            enSet.add(Enum.valueOf(elemCl,val));
        }
        return enSet;
    }
View Full Code Here

public class FSTEnumSetSerializer extends FSTBasicObjectSerializer {

    Field elemType;
    @Override
    public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException {
        EnumSet enset = (EnumSet) toWrite;
        int count = 0;
        out.writeInt(enset.size());
        if ( enset.isEmpty() ) { //WTF only way to determine enumtype ..
            EnumSet compl = EnumSet.complementOf(enset);
            out.writeClassTag(compl.iterator().next().getClass());
        } else {
            for (Object element : enset) {
                if ( count == 0 ) {
                    out.writeClassTag(element.getClass());
                }
View Full Code Here

    @Override
    public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPositioin) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        int len = in.readInt();
        Class elemCl = in.readClass().getClazz();
        EnumSet enSet = EnumSet.noneOf(elemCl);
        in.registerObject(enSet,streamPositioin,serializationInfo, referencee); // IMPORTANT, else tracking double objects will fail
        for (int i = 0; i < len; i++)
            enSet.add(in.readObjectInternal(Enum.class));
        return enSet;
    }
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

    }

    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

     */
    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

    }

    @Override
    public EnumSet read(final Kryo kryo, final Input input, final Class<EnumSet<? extends Enum<?>>> type) {
        final Class<Enum> elementType = kryo.readClass( input ).getType();
        final EnumSet result = EnumSet.noneOf( elementType );
        final int size = input.readInt(true);
        final Enum<?>[] enumConstants = elementType.getEnumConstants();
        for ( int i = 0; i < size; i++ ) {
            result.add( enumConstants[input.readInt(true)] );
        }
        return result;
    }
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

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.