home *** CD-ROM | disk | FTP | other *** search
- package com.kav.xsl;
-
- import java.io.PrintWriter;
-
- class NodeExpr extends PatternExpr {
- public static final int ANCESTOR_EXPR = 0;
- public static final int ATTRIBUTE_EXPR = 1;
- public static final int ELEMENT_EXPR = 2;
- public static final int ID_EXPR = 3;
- public static final int IDENTITY_EXPR = 4;
- public static final int PARENT_EXPR = 5;
- public static final int TEXT_EXPR = 6;
- public static final int COMMENT_EXPR = 7;
- public static final int PI_EXPR = 8;
- public static final String ATTRIBUTE = "@";
- public static final String COMMENT = "comment";
- // $FF: renamed from: ID java.lang.String
- public static final String field_0 = "id";
- // $FF: renamed from: PI java.lang.String
- public static final String field_1 = "pi";
- public static final String TEXT = "text";
- public static final String IDENTITY_PATTERN = ".";
- public static final String PARENT_PATTERN = "..";
- public static final String WILD_CARD = "*";
- private String name;
- private int type = -1;
-
- protected NodeExpr(int var1) {
- super(2);
- this.type = var1;
- }
-
- public String toString() {
- switch (this.type) {
- case 1:
- return "@" + this.name;
- case 2:
- return this.name;
- case 3:
- return "id('" + this.name + "')";
- case 4:
- return ".";
- case 5:
- return "..";
- case 6:
- return "text()";
- case 7:
- return "comment()";
- case 8:
- String var1 = "pi(";
- if (this.name != null) {
- var1 = var1 + this.name;
- }
-
- return var1 + ")";
- default:
- return this.name;
- }
- }
-
- protected int compareTo(NodeExpr var1) {
- if (var1 == null) {
- return 1;
- } else {
- int var2 = var1.getType();
- if (var2 != this.type) {
- return 0;
- } else {
- String var3 = var1.getName();
- switch (this.type) {
- case 1:
- case 2:
- case 3:
- case 8:
- if (var3 == null && this.name == null) {
- return 0;
- } else if (var3 == null && this.name != null) {
- return 1;
- } else if (var3 != null && this.name == null) {
- return -1;
- } else if (!this.name.equals(var3)) {
- if ("*".equals(var3)) {
- return 1;
- } else if ("*".equals(this.name)) {
- return -1;
- }
- }
- case 5:
- default:
- return 0;
- case 4:
- case 6:
- case 7:
- return 0;
- }
- }
- }
- }
-
- protected String getName() {
- return this.name;
- }
-
- protected int getType() {
- return this.type;
- }
-
- protected void print(PrintWriter var1) {
- var1.print(this.toString());
- var1.flush();
- }
-
- protected void setName(String var1) {
- this.name = var1;
- }
- }
-