Package net.percederberg.mibble.type

Examples of net.percederberg.mibble.type.BitSetType


     * @param type           the MIB type
     * @param indent         the indentation to use
     */
    private void printConstraint(MibType type, String indent) {
        IntegerType     intType;
        BitSetType      bitType;
        StringType      strType;

        if (type instanceof IntegerType) {
            intType = (IntegerType) type;
            if (intType.hasSymbols()) {
                os.println(" {");
                printEnumeration(intType.getAllSymbols(),
                                 indent + "    ");
                os.println();
                os.print(indent);
                os.print("}");
            } else if (intType.hasConstraint()) {
                os.print(" (");
                os.print(intType.getConstraint());
                os.print(")");
            }
        } else if (type instanceof BitSetType) {
            bitType = (BitSetType) type;
            if (bitType.hasSymbols()) {
                os.println(" {");
                printEnumeration(bitType.getAllSymbols(),
                                 indent + "    ");
                os.println();
                os.print(indent);
                os.print("}");
            } else if (bitType.hasConstraint()) {
                os.print(" (");
                os.print(bitType.getConstraint());
                os.print(")");
            }
        } else if (type instanceof StringType) {
            strType = (StringType) type;
            if (strType.hasConstraint()) {
View Full Code Here


     * @param node           the node being exited
     *
     * @return the node to add to the parse tree
     */
    protected Node exitBitStringType(Production node) {
        BitSetType  type;
        ArrayList   values;
        Object      obj;

        values = getChildValues(node);
        if (values.size() == 0) {
            type = new BitSetType();
        } else {
            obj = values.get(0);
            if (obj instanceof ArrayList) {
                type = new BitSetType((ArrayList) obj);
            } else {
                type = new BitSetType((Constraint) obj);
            }
        }
        node.addValue(type);
        return node;
    }
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.type.BitSetType

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.