All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kz.greetgo.msoffice.xlsx.parse.XmlIn Maven / Gradle / Ivy

There is a newer version: 0.5.9
Show newest version
package kz.greetgo.msoffice.xlsx.parse;

import java.util.LinkedList;

public class XmlIn {
  private LinkedList inPath = new LinkedList();

  public void stepIn(String name) {
    inPath.add(name);
    chachedCurrent = null;
  }

  public void stepOut() {
    inPath.removeLast();
    chachedCurrent = null;
  }

  private String chachedCurrent = null;

  public String current() {
    if (chachedCurrent != null) return chachedCurrent;

    StringBuilder sb = new StringBuilder();
    for (String name : inPath) {
      if (sb.length() > 0) sb.append('/');
      sb.append(name);
    }

    return chachedCurrent = sb.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy