int          i;
    void segmentValue()        throws ConfigurationException    {        if (valueSegments == null)        {            Collection   segments = new ArrayList();            char         ch;            char         lastCh;            char[]       chars;            boolean      literal;            ValueSegment currentSegment = new ValueSegment();            chars   = cookedValue.toCharArray();            lastCh  = '\0';            currentSegment.isLiteral = false;            for (i = 0; i < chars.length; i++)            {                ch = chars[i];                switch (ch)                {                    case LITERAL_QUOTE:                        if (lastCh == XStringBuffer.METACHAR_SEQUENCE_START)                        {                            // Escaped quote. Pass as literal.                            currentSegment.append (ch);                        }                        else if (currentSegment.isLiteral)                        {                            // End of literal sequence. Thus, end of segment.                            if (currentSegment.length() > 0)                            {                                segments.add (currentSegment);                                currentSegment = new ValueSegment();                            }                            currentSegment.isLiteral = false;                        }                        else                        {                            // Start of literal sequence. Any previously                            // buffered characters are part of the previous                            // sequence and must be saved.                            if (currentSegment.length() > 0)                            {                                segments.add (currentSegment);                                currentSegment = new ValueSegment();                            }                            currentSegment.isLiteral = true;                        }                        break;                    default:                        currentSegment.append (ch);                }                lastCh = ch;            }            if (currentSegment.isLiteral)            {                throw new ConfigurationException                    ("Unterminated quoted string in variable \""                   + this.name                   + "\"");            }            if (currentSegment.length() > 0)                segments.add (currentSegment);            if (segments.size() > 0)            {                valueSegments = new ValueSegment [segments.size()];                i = 0;                for (Iterator it = segments.iterator(); it.hasNext(); )                    valueSegments[i++] = (ValueSegment) it.next();            }        }    }