All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jsimpledb.schema.CounterSchemaField Maven / Gradle / Ivy

Go to download

JSimpleDB core API classes which provide objects, fields, indexes, queries, and schema management on top of a key/value store.

There is a newer version: 3.6.1
Show newest version

/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package org.jsimpledb.schema;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

/**
 * A counter field in a {@link SchemaObjectType}.
 */
public class CounterSchemaField extends SchemaField {

    @Override
    public  R visit(SchemaFieldSwitch target) {
        return target.caseCounterSchemaField(this);
    }

    @Override
    void writeXML(XMLStreamWriter writer) throws XMLStreamException {
        writer.writeEmptyElement(COUNTER_FIELD_TAG.getNamespaceURI(), COUNTER_FIELD_TAG.getLocalPart());
        this.writeAttributes(writer);
    }

    @Override
    boolean isCompatibleWithInternal(AbstractSchemaItem that) {
        return true;
    }

// Object

    @Override
    public String toString() {
        return "counter " + super.toString();
    }

// Cloneable

    @Override
    public CounterSchemaField clone() {
        return (CounterSchemaField)super.clone();
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy