Package org.marc4j.marc

Examples of org.marc4j.marc.VariableField


        assertEquals(3, fieldList.size());

        fieldList = record.getDataFields();
        assertEquals(12, fieldList.size());

        VariableField field = record.getVariableField("245");
        assertEquals("245", field.getTag());

        fieldList = record.getVariableFields("650");
        assertEquals(3, fieldList.size());

        String[] fields = { "245", "260", "300" };
View Full Code Here


        fieldList = record.getVariableFields(fields);
        assertEquals(3, fieldList.size());
    }

    public void testFind() throws Exception {
        VariableField field = record.getVariableField("245");
        assertEquals(true, field.find("Summerland"));
        assertEquals(true, field.find("Sum*erland"));
        assertEquals(true, field.find("[Cc]habo[a-z]"));

        field = record.getVariableField("008");
        assertEquals(true, field.find("eng"));

        List result = record.find("Summerland");
        assertEquals(1, result.size());
        field = (VariableField) result.get(0);
        assertEquals("245", field.getTag());

        result = record.find("Chabon");
        assertEquals(2, result.size());

        result = record.find("100", "Chabon");
View Full Code Here

        }
        List<VariableField> fields = record.getVariableFields();
        Iterator<VariableField> iter = fields.iterator();
        while (iter.hasNext())
        {
            VariableField field = iter.next();
            if (field instanceof DataField)
            {
                DataField df = (DataField)field;
                List<Subfield> subf = df.getSubfields();
                Iterator<Subfield> sfiter = subf.iterator();
View Full Code Here

        assertEquals(3, fieldList.size());

        fieldList = record.getDataFields();
        assertEquals(12, fieldList.size());

        VariableField field = record.getVariableField("245");
        assertEquals("245", field.getTag());

        fieldList = record.getVariableFields("650");
        assertEquals(3, fieldList.size());

        String[] fields = { "245", "260", "300" };
View Full Code Here

        fieldList = record.getVariableFields(fields);
        assertEquals(3, fieldList.size());
    }

    public void testFind() throws Exception {
        VariableField field = record.getVariableField("245");
        assertEquals(true, field.find("Summerland"));
        assertEquals(true, field.find("Sum*erland"));
        assertEquals(true, field.find("[Cc]habo[a-z]"));

        field = record.getVariableField("008");
        assertEquals(true, field.find("eng"));

        List result = record.find("Summerland");
        assertEquals(1, result.size());
        field = (VariableField) result.get(0);
        assertEquals("245", field.getTag());

        result = record.find("Chabon");
        assertEquals(2, result.size());

        result = record.find("100", "Chabon");
View Full Code Here

        sb.append("LEADER ");
        sb.append(getLeader().toString());
        sb.append('\n');
        Iterator i = getVariableFields().iterator();
        while (i.hasNext()) {
            VariableField field = (VariableField) i.next();
            sb.append(field.toString());
            sb.append('\n');
        }
        return sb.toString();
    }
View Full Code Here

    public List find(String pattern) {
        List result = new ArrayList();
        Iterator i = controlFields.iterator();
        while (i.hasNext()) {
            VariableField field = (VariableField) i.next();
            if (field.find(pattern))
                result.add(field);
        }
        i = dataFields.iterator();
        while (i.hasNext()) {
            VariableField field = (VariableField) i.next();
            if (field.find(pattern))
                result.add(field);
        }
        return result;
    }
View Full Code Here

    public List find(String tag, String pattern) {
        List result = new ArrayList();
        Iterator i = getVariableFields(tag).iterator();
        while (i.hasNext()) {
            VariableField field = (VariableField) i.next();
            if (field.find(pattern))
                result.add(field);
        }
        return result;
    }
View Full Code Here

    public List find(String[] tag, String pattern) {
        List result = new ArrayList();
        Iterator i = getVariableFields(tag).iterator();
        while (i.hasNext()) {
            VariableField field = (VariableField) i.next();
            if (field.find(pattern))
                result.add(field);
        }
        return result;
    }
View Full Code Here

   
    public int compareTo(Object obj) {
        if (!(obj instanceof VariableFieldImpl))
            throw new ClassCastException("A VariableField object expected");

        VariableField field = (VariableField) obj;
        return tag.compareTo(field.getTag());
    }
View Full Code Here

TOP

Related Classes of org.marc4j.marc.VariableField

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.