Examples of StringVector


Examples of com.ctc.wstx.util.StringVector

     */

    public NonNsStreamWriter(XmlWriter xw, String enc, WriterConfig cfg)
    {
        super(xw, enc, cfg);
        mElements = new StringVector(32);
    }
View Full Code Here

Examples of com.ctc.wstx.util.StringVector

public class TestStringVector
    extends TestCase
{
    public void testBasic()
    {
        StringVector sv = new StringVector(2);

        sv.addString("foo");
        sv.addString("xyz");
        assertEquals(2, sv.size());
        sv.addStrings("bar", "foo2");
        assertEquals(4, sv.size());
        sv.setString(3, "foo3");
        assertEquals(4, sv.size());
        assertEquals("foo3", sv.getString(3));

        sv.addString(new String("foo")); // so as to be different from entry 0
        sv.addString(new String("bar"));
        assertEquals("foo", sv.getString(4));
        // this uses identity
        assertEquals("xyz", sv.findLastFromMap("foo"));
        // and this equality
        assertEquals("bar", sv.findLastNonInterned("foo"));

        sv.clear(true);
        assertEquals(0, sv.size());
    }
View Full Code Here

Examples of com.ctc.wstx.util.StringVector

    {
        if (mValueBuffer == null) {
            mValueBuffer = new TextBuilder(EXP_ATTR_COUNT);
        }
        if (mAttrNames == null) {
            mAttrNames = new StringVector(EXP_ATTR_COUNT);
        }
    }
View Full Code Here

Examples of com.ctc.wstx.util.StringVector

        mValidator.validateElementStart(mElements[mSize-1], null,null);

        // Then attributes, if any:
        int attrLen = ac.getCount();
        if (attrLen > 0) {
            StringVector attrNames = ac.getNameList();
            String[] nameData = attrNames.getInternalArray();
            TextBuilder attrBuilder = ac.getAttrBuilder();
            char[] attrCB = attrBuilder.getCharBuffer();
            for (int i = 0; i < attrLen; ++i) {
                String normValue = mValidator.validateAttribute
                    (nameData[i], null, null, attrCB,
View Full Code Here

Examples of com.ctc.wstx.util.StringVector

     */

    public NonNsStreamWriter(XmlWriter xw, String enc, WriterConfig cfg)
    {
        super(xw, enc, cfg);
        mElements = new StringVector(32);
    }
View Full Code Here

Examples of com.funambol.syncclient.blackberry.StringVector

     */
    public void setLastTimestamp(long lastTimestamp) throws DataAccessException
    {   
        // FIXME: use J2ME RecordStore here
        mailStore = PersistentStore.getPersistentObject(MAIL_LAST_TIMESTAMP_KEY);
        StringVector data = new StringVector();
        data.insertElementAt(Long.toString(lastTimestamp), 0);
        mailStore.setContents(data);
        mailStore.commit();
    }
View Full Code Here

Examples of com.nexirius.util.StringVector

            DialogManager.error("CannotRead{0}", fileName);

            return null;
        }

        StringVector sv;

        try {
            sv = new StringVector();
            BufferedInputStream in = file.getBufferedInputStream();
            ByteArrayOutputStream line = new ByteArrayOutputStream(102400);

            int oldc = 0;

            while (true) {
                int c = in.read();

                if (c < 0) {
                    break;
                }

                if (c == '\n' && oldc != '\r') {
                    //String s = line.toString("ISO-8859-1");
                    String s = line.toString("Cp1252");
                    //String str = new String(bytes, "ISO-8859-1");
                    sv.append(s);
                    line.reset();
                } else {
                    line.write(c);
                }

                oldc = c;
            }

        } catch (Exception e) {
            DialogManager.error(e.getMessage());

            return null;
        }

        ArrayModel arr = null;
        String[] columnNames = null;

        for (String line = sv.firstItem(); line != null; line = sv.nextItem()) {

            StringVector tokens = new StringVector(line, ';', false);

            if (tokens.size() < 2) {
                continue;
            }

            StructModel s = new StructModel("A");
            if (columnNames == null) {
                StringVector columnNamesVector = null;

                columnNamesVector = tokens;

                columnNames = new String[tokens.size()];

                int i = 0;
                for (i = 0; i < columnNames.length; ++i) {
                    if (columnNamesVector != null && i < columnNamesVector.size()) {
                        columnNames[i] = columnNamesVector.getItem(i);
                    } else {
                        columnNames[i] = Integer.toString(i);
                    }

                    s.append(new StringModel("", columnNames[i]));
View Full Code Here

Examples of com.nexirius.util.StringVector

    private void init() {
        MailModel mailModel = new MailModel();

        DataModelEnumeration en = mailModel.getChildren().getEnumeration();

        fields = new StringVector();

        while (en.hasMore()) {
            DataModel model = en.next();

            fields.sortInsert(model.getFieldName());
View Full Code Here

Examples of com.nexirius.util.StringVector

//        removeDoubleQuotes = new BooleanModel(true, FIELD_removeDoubleQuotes);
//        append(removeDoubleQuotes);
    }

    public void setMaxAttributes(int maxFields) {
        StringVector sv = new StringVector();

        for (int i = 0; i < maxFields; ++i) {
            sv.append("field_" + i);
        }

        SimpleArrayModel fieldAttributes = new SimpleArrayModel(sv.getArray());
        for (int i = 0; i < MailModel.MAIL_FIELDS.length; i++) {
            String attribute = MailModel.MAIL_FIELDS[i];

            append(new ComboBoxModel(i, fieldAttributes, attribute));
        }
View Full Code Here

Examples of com.nexirius.util.StringVector

                if (x < 0) {
                    return model;
                }

                FieldName fieldName = fields.getFieldName(x);
                StringVector sv = new StringVector();

                while (fieldName != null) {
                    sv.insertElementAt(fieldName.toString(), 0);
                    fieldName = fieldName.getParent();
                }

                sv.removeElementAt(0);

                String names[] = sv.getArray();

                return model.getChild(names);
            } catch (Exception ex) {
                ex.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.