Package org.apache.poi.hwpf.model

Examples of org.apache.poi.hwpf.model.PlexOfField


            List<FieldImpl> result )
    {
        int next = startOffsetInclusive;
        while ( next < endOffsetExclusive )
        {
            PlexOfField startPlexOfField = plexOfFields.get( next );
            if ( startPlexOfField.getFld().getBoundaryType() != FieldDescriptor.FIELD_BEGIN_MARK )
            {
                /* Start mark seems to be missing */
                next++;
                continue;
            }

            /*
             * we have start node. end offset points to next node, separator or
             * end
             */
            int nextNodePositionInList = binarySearch( plexOfFields, next + 1,
                    endOffsetExclusive, startPlexOfField.getFcEnd() );
            if ( nextNodePositionInList < 0 )
            {
                /*
                 * too bad, this start field mark doesn't have corresponding end
                 * field mark or separator field mark in fields table
                 */
                next++;
                continue;
            }
            PlexOfField nextPlexOfField = plexOfFields
                    .get( nextNodePositionInList );

            switch ( nextPlexOfField.getFld().getBoundaryType() )
            {
            case FieldDescriptor.FIELD_SEPARATOR_MARK:
            {
                PlexOfField separatorPlexOfField = nextPlexOfField;

                int endNodePositionInList = binarySearch( plexOfFields,
                        nextNodePositionInList, endOffsetExclusive,
                        separatorPlexOfField.getFcEnd() );
                if ( endNodePositionInList < 0 )
                {
                    /*
                     * too bad, this separator field mark doesn't have
                     * corresponding end field mark in fields table
                     */
                    next++;
                    continue;
                }
                PlexOfField endPlexOfField = plexOfFields
                        .get( endNodePositionInList );

                if ( endPlexOfField.getFld().getBoundaryType() != FieldDescriptor.FIELD_END_MARK )
                {
                    /* Not and ending mark */
                    next++;
                    continue;
                }

                FieldImpl field = new FieldImpl( startPlexOfField,
                        separatorPlexOfField, endPlexOfField );
                result.add( field );

                // adding included fields
                if ( startPlexOfField.getFcStart() + 1 < separatorPlexOfField
                        .getFcStart() - 1 )
                {
                    parseFieldStructureImpl( plexOfFields, next + 1,
                            nextNodePositionInList, result );
                }
                if ( separatorPlexOfField.getFcStart() + 1 < endPlexOfField
                        .getFcStart() - 1 )
                {
                    parseFieldStructureImpl( plexOfFields,
                            nextNodePositionInList + 1, endNodePositionInList,
                            result );
View Full Code Here


    private String dumpPlexes( ArrayList<PlexOfField> fieldsPlexes )
    {
        StringBuilder dump = new StringBuilder();
        for ( int i = 0; i < fieldsPlexes.size(); i++ )
        {
            final PlexOfField flds = fieldsPlexes.get( i );
            dump.append( flds.toString() + "\n" );
        }
        return dump.toString();
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hwpf.model.PlexOfField

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.