コード例 #1
0
ファイル: Node.java プロジェクト: TMSWhite/Dialogix2007
  /** Set the access time for this Node as Now() */
  private void setTimeStampStr() {
    if (timeStamp == null) {
      timeStampStr = "";
    }

    try {
      timeStampStr = Long.toString(timeStamp.getTime());
    } catch (NumberFormatException e) {
      Logger.getLogger(LoggerName).log(Level.SEVERE, "", e);
      timeStampStr = "";
    }
  }
コード例 #2
0
  /**
   * @param chkKeys List of String objects with the shas
   * @param targetFile target file
   * @return true if write was successful
   */
  public static boolean writeRequestFile(
      final FileRequestFileContent content, final File targetFile) {

    final Document doc = XMLTools.createDomDocument();
    if (doc == null) {
      logger.severe("Error - writeRequestFile: factory could'nt create XML Document.");
      return false;
    }

    final Element rootElement = doc.createElement(TAG_FrostFileRequestFile);
    doc.appendChild(rootElement);

    final Element timeStampElement = doc.createElement(TAG_timestamp);
    final Text timeStampText = doc.createTextNode(Long.toString(content.getTimestamp()));
    timeStampElement.appendChild(timeStampText);
    rootElement.appendChild(timeStampElement);

    final Element rootChkElement = doc.createElement(TAG_shaList);
    rootElement.appendChild(rootChkElement);

    for (final String chkKey : content.getShaStrings()) {

      final Element nameElement = doc.createElement(TAG_sha);
      final Text text = doc.createTextNode(chkKey);
      nameElement.appendChild(text);

      rootChkElement.appendChild(nameElement);
    }

    boolean writeOK = false;
    try {
      writeOK = XMLTools.writeXmlFile(doc, targetFile);
    } catch (final Throwable t) {
      logger.log(Level.SEVERE, "Exception in writeRequestFile/writeXmlFile", t);
    }

    return writeOK;
  }
コード例 #3
0
 public String toString() {
   return super.toString() + "(" + Long.toString(getWindow(), 16) + ")";
 }
コード例 #4
0
ファイル: PBVCPlugin.java プロジェクト: vohoaiviet/placecomm
 private void CountInstancesBtnMouseClicked(
     java.awt.event.MouseEvent evt) { // GEN-FIRST:event_CountInstancesBtnMouseClicked
   // TODO add your handling code here:
   LoggingAreaTA.append("Total: " + Long.toString(InstancesCount()) + " instances");
 } // GEN-LAST:event_CountInstancesBtnMouseClicked