Package org.foray.common

Examples of org.foray.common.CharVector


                leaderText[i] = '.';
            } else {
                leaderText[i] = ' ';
            }
        }
        return new CharVector(leaderText);
    }
View Full Code Here


                }
            } else {
                returnArray[i - discardElements] = c;
            }
        }
        return new CharVector(returnArray);
    }
View Full Code Here

                discardElements ++;
            } else {
                returnArray[i - discardElements] = conversionChar;
            }
        }
        return new CharVector(returnArray);
    }
View Full Code Here

     * @param chars The raw text content.
     */
    public CharacterSequence4a(final FObj parent, final char[] chars) {
        super(parent);
        this.parent = parent;
        this.ca = new CharVector(chars);
        filterContent();
    }
View Full Code Here

        if (this.filterStatus >= CharacterSequence4a.FILTER_REFINED_FO_TREE) {
            /* The stored text has already been filtered. Just return it. */
            return this.ca;
        }

        final CharVector charArray = getPreTextTransformText(context);
        // Now handle text-transform.
        final TextTransform textTransform = effectiveParent.traitTextTransform(
                context);
        if (textTransform != TextTransform.NONE) {
            for (int i = 0; i < charArray.length(); i++) {
                charArray.set(i, applyTextTransform(context, charArray, i,
                        textTransform));
            }
        }

        /* Update the instance's text with the refined value, and update the
View Full Code Here

            /* The stored text has already been filtered. Just return it. */
            return this.ca;
        }

        /* Must handle white-space-treatment first. */
        CharVector workArray = applyWhiteSpaceTreatment(this.ca,
                effectiveParent.traitWhiteSpaceTreatment(context));

        // Now handle linefeed-treatment.
        workArray = applyLinefeedTreatment(workArray,
                effectiveParent.traitLinefeedTreatment(context));
View Full Code Here

            // Look in subsequent text items.
            remainingOffset = offset - (charArray.length() - 1 - index);
            CharacterSequence4a nextFOText =
                    this.getNextContiguousTextInBlock();
            while (nextFOText != null) {
                final CharVector nextText =
                        nextFOText.getPreTextTransformText(context);
                if (nextText.length() >= remainingOffset) {
                    return nextText.charAt(remainingOffset - 1);
                }
                remainingOffset -= nextText.length();
                nextFOText = nextFOText.getNextContiguousTextInBlock();
            }
            return 0x0000;
        }
        // Remaining case has the text in some previous FOText node
        remainingOffset = offset + index;
        CharacterSequence4a prevFOText =
                this.getPreviousContiguousTextInBlock();
        while (prevFOText != null) {
            final CharVector prevText = prevFOText.getPreTextTransformText(context);
            if (prevText.length() >= Math.abs(remainingOffset)) {
                return prevText.charAt(prevText.length() + remainingOffset);
            }
            remainingOffset += prevText.length();
            prevFOText = prevFOText.getPreviousContiguousTextInBlock();
        }
        return 0x0000;
    }
View Full Code Here

            /* The stored text has already been filtered. Just return it. */
            return this.ca;
        }

        // Start with the refined FO Tree text
        CharVector returnArray = getRefinedText(context);
        // Apply white-space-collapse.
        final boolean whiteSpaceCollapse =
                effectiveParent.traitWhiteSpaceCollapse(context);
        returnArray = applyWhiteSpaceCollapse(returnArray, whiteSpaceCollapse);

View Full Code Here

                discardElements ++;
            } else {
                returnArray[i - discardElements] = conversionChar;
            }
        }
        return new CharVector(returnArray);
    }
View Full Code Here

     * @return The normalized word.
     */
    private String normalizeWord(final char[] inputArray, final int offset,
            final int length) {
        final char[] word = new char[length];
        final CharVector c = new CharVector(2);
        c.add(Character.MIN_VALUE);
        for (int i = 0; i < length; i++) {
            c.set(0, inputArray[offset + i]);
            final int nc = this.classes.get(c, 0);
            if (nc < 0) {
                /* Found a non-letter character. Abort. */
                return null;
            }
View Full Code Here

TOP

Related Classes of org.foray.common.CharVector

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.