Beispiel #1
0
 public long getLongContent(long defaultValue) {
   String c = node.getTextContent();
   if (c != null) {
     try {
       return Long.parseLong(c);
     } catch (NumberFormatException nfe) {
     }
   }
   return defaultValue;
 }
  public long getUnicodeAsLong() {
    long retval = -1;

    String s = getUnicodeAsString();
    if (s.equals("")) {
      return retval;
    } // if

    try {
      retval = Long.parseLong(s, 16);
    } catch (NumberFormatException e) {
      retval = -1;
    } // try-catch

    return retval;
  }
  /** creates new file */
  public GlyphFile(File a_dir, String a_name, long a_unicode) throws FileNotFoundException {
    super();

    m_fileName = createFileName(a_dir, a_name);

    init(getClass().getResource(s_emptyFileName));
    setGlyphTitle(a_name);
    setUnicode(Long.toHexString(a_unicode));

    /*int eastAsianWidth = UCharacter.getIntPropertyValue(
    (int) a_unicode,
    0x1004); //UProperty.EAST_ASIAN_WIDTH);
         */
    int eastAsianWidth = 5; // ??
    if (eastAsianWidth == 5 || eastAsianWidth == 1) {
      setAdvanceWidth(k_fullWidth);
    } // if

    saveGlyphFile();
  }
Beispiel #4
0
 /**
  * Returns the value of an attribute.
  *
  * @param name the non-null full name of the attribute.
  * @param defaultValue the default value of the attribute.
  * @return the value, or defaultValue if the attribute does not exist.
  */
 public long getLong(String name, long defaultValue) {
   String value = getString(name);
   return (value == null) ? defaultValue : Long.parseLong(value);
 }