congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Element
Code IndexAdd Tabnine to your IDE (free)

How to use
Element
in
org.archive.util.anvl

Best Java code snippets using org.archive.util.anvl.Element (Showing top 17 results out of 315)

origin: iipc/webarchive-commons

public Map<String, String> asMap() {
  Map<String, String> m = new HashMap<String, String>(size());
  for (final Iterator<Element> i = iterator(); i.hasNext();) {
    Element e = i.next();
    m.put(e.getLabel().toString(),
      e.isValue()? e.getValue().toString(): (String)null);
  }
  return m;
}

origin: iipc/openwayback

ANVLRecord headers = recinfo.getExtraHeaders();
for (Element el : headers) {
  w.write(el.getLabel() + ": " + el.getValue() + CRLF);
origin: stackoverflow.com

 private class CollectPathsVisitor extends ElementVisitor {
  public final Set<String> paths = new TreeSet<String>();
  public Object visit(Element element) {
    final IPath parentPath = (IPath) peek();
    final IPath path = parentPath.append(element.getLabel());
    if (!hasChildren(element))
      paths.add(path);
    return path;
  }
}
origin: org.netpreserve.commons/webarchive-commons

public boolean addLabel(final String l) {
  return super.add(new Element(new Label(l)));
}
origin: org.netpreserve.commons/webarchive-commons

public Value getValue() {
  if (!isValue()) {
    return null;
  }
  return (Value)this.subElements[1];
}

origin: org.netpreserve.commons/commons-web

public boolean addLabel(final String l) {
  return super.add(new Element(new Label(l)));
}
origin: org.netpreserve.commons/commons-web

public Value getValue() {
  if (!isValue()) {
    return null;
  }
  return (Value)this.subElements[1];
}

origin: org.netpreserve.commons/webarchive-commons

public Map<String, String> asMap() {
  Map<String, String> m = new HashMap<String, String>(size());
  for (final Iterator<Element> i = iterator(); i.hasNext();) {
    Element e = i.next();
    m.put(e.getLabel().toString(),
      e.isValue()? e.getValue().toString(): (String)null);
  }
  return m;
}

origin: iipc/webarchive-commons

public boolean addLabel(final String l) {
  return super.add(new Element(new Label(l)));
}
origin: iipc/webarchive-commons

public Value getValue() {
  if (!isValue()) {
    return null;
  }
  return (Value)this.subElements[1];
}

origin: org.netpreserve.commons/commons-web

public Map<String, String> asMap() {
  Map<String, String> m = new HashMap<String, String>(size());
  for (final Iterator<Element> i = iterator(); i.hasNext();) {
    Element e = i.next();
    m.put(e.getLabel().toString(),
      e.isValue()? e.getValue().toString(): (String)null);
  }
  return m;
}

origin: org.netpreserve.commons/webarchive-commons

public boolean addLabelValue(final String l, final String v) {
  try {
    return super.add(new Element(new Label(l), new Value(v)));
  } catch (IllegalArgumentException e) {
    logger.log(Level.WARNING, "bad label " + l + " or value " + v, e);
    return false;
  }
}

origin: org.netpreserve.commons/webarchive-commons

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < subElements.length; i++) {
      sb.append(subElements[i].toString());
      if (i == 0) {
        // Add colon after Label.
        sb.append(':');
        if (isValue()) {
          // Add space to intro the value.
          sb.append(' ');
        }
      }
    }
    return sb.toString();
  }
}
origin: org.netpreserve.commons/commons-web

public boolean addLabelValue(final String l, final String v) {
  try {
    return super.add(new Element(new Label(l), new Value(v)));
  } catch (IllegalArgumentException e) {
    logger.log(Level.WARNING, "bad label " + l + " or value " + v, e);
    return false;
  }
}

origin: org.netpreserve.commons/commons-web

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < subElements.length; i++) {
      sb.append(subElements[i].toString());
      if (i == 0) {
        // Add colon after Label.
        sb.append(':');
        if (isValue()) {
          // Add space to intro the value.
          sb.append(' ');
        }
      }
    }
    return sb.toString();
  }
}
origin: iipc/webarchive-commons

public boolean addLabelValue(final String l, final String v) {
  try {
    return super.add(new Element(new Label(l), new Value(v)));
  } catch (IllegalArgumentException e) {
    logger.log(Level.WARNING, "bad label " + l + " or value " + v, e);
    return false;
  }
}

origin: iipc/webarchive-commons

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < subElements.length; i++) {
      sb.append(subElements[i].toString());
      if (i == 0) {
        // Add colon after Label.
        sb.append(':');
        if (isValue()) {
          // Add space to intro the value.
          sb.append(' ');
        }
      }
    }
    return sb.toString();
  }
}
org.archive.util.anvlElement

Javadoc

ANVL 'data element'. Made of a lone Label, or a Label plus Value.

Most used methods

  • getLabel
  • getValue
  • <init>
  • isValue

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Runner (org.openjdk.jmh.runner)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now