Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    public static long getLong(Node aNode, String attr, long defaultValue) {
        if (aNode.getAttributes().getNamedItem(attr) != null) {
            String attrString = aNode.getAttributes().getNamedItem(attr).getNodeValue();
            Long year = Long.parseLong(attrString);
            return year;
        } else {
            return defaultValue;
        }
    }
}