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 {
    /**
     * Extracts a Long from a document that consists of a Long only.
     * 
     * @param doc
     * @return the Long
     */
    public static Long extractLong(Node doc) {
        if (doc == null) {
            return 0l;
        }
        return Long.parseLong(doc.getFirstChild().getTextContent());
    }
}