/** Return true if this is the empty name. */ public boolean isEmpty() { return getByteLength() == 0; }
/** Return true if this is the empty name. */ public boolean isEmpty() { return getByteLength() == 0; }
public void printVarInit(final JCVariableDecl tree) { int col = out.col; if (!ERROR.contentEquals(tree.name)) col -= tree.name.getByteLength(); wrapAssignOpTree("=", col, new Runnable() { @Override public void run() { printNoParenExpr(tree.init); } }); }
/** Return the concatenation of this name, the given ASCII * character, and name `n'. */ public Name append(char c, Name n) { int len = getByteLength(); byte[] bs = new byte[len + 1 + n.getByteLength()]; getBytes(bs, 0); bs[len] = (byte) c; n.getBytes(bs, len+1); return table.fromUtf(bs, 0, bs.length); }
/** Return the concatenation of this name, the given ASCII * character, and name `n'. */ public Name append(char c, Name n) { int len = getByteLength(); byte[] bs = new byte[len + 1 + n.getByteLength()]; getBytes(bs, 0); bs[len] = (byte) c; n.getBytes(bs, len+1); return table.fromUtf(bs, 0, bs.length); }
/** Copy all bytes of this name to buffer cs, starting at start. */ public void getBytes(byte cs[], int start) { System.arraycopy(getByteArray(), getByteOffset(), cs, start, getByteLength()); }
/** Return the last part of a class name. */ public static Name shortName(Name classname) { return classname.subName( classname.lastIndexOf((byte)'.') + 1, classname.getByteLength()); }
/** Returns last occurrence of byte b in this name, -1 if not found. */ public int lastIndexOf(byte b) { byte[] bytes = getByteArray(); int offset = getByteOffset(); int i = getByteLength() - 1; while (i >= 0 && bytes[offset + i] != b) i--; return i; }
/** Does given name start with "access$" and end in an odd digit? */ private boolean isOddAccessName(Name name) { return name.startsWith(accessDollar) && (name.getByteAt(name.getByteLength() - 1) & 1) == 1; }
/** Return the last part of a class name. */ public static Name shortName(Name classname) { return classname.subName( classname.lastIndexOf((byte)'.') + 1, classname.getByteLength()); }
/** Return internal representation of given name, * converting '/' to '.'. */ public static byte[] internalize(Name name) { return internalize(name.getByteArray(), name.getByteOffset(), name.getByteLength()); }
public Name fullName(JCTree tree) { switch (tree.getTag()) { case IDENT: return ((JCIdent) tree).name; case SELECT: JCFieldAccess sel = (JCFieldAccess)tree; Name sname = fullName(sel.selected); return sname != null && sname.getByteLength() > 0 ? sname.append('.', sel.name) : sel.name; default: return null; } }
private void printAllQualified(Symbol t) { if (t.owner != null && t.owner.name.getByteLength() > 0) { printAllQualified(t.owner); print('.'); } print(t.name); }
public final void print(Name n) { if (n == null) return; out.appendUtf8(n.getByteArray(), n.getByteOffset(), n.getByteLength()); }
/** Append a name. */ public void appendName(Name name) { appendBytes(name.getByteArray(), name.getByteOffset(), name.getByteLength()); }
/** Return external representation of given name, * converting '/' to '.'. */ public static byte[] externalize(Name name) { return externalize(name.getByteArray(), name.getByteOffset(), name.getByteLength()); }
/** Return the string representation of this name. */ @Override public String toString() { return Convert.utf2string(getByteArray(), getByteOffset(), getByteLength()); }
/** Return external representation of given name, * converting '/' to '.'. */ public static byte[] externalize(Name name) { return externalize(name.getByteArray(), name.getByteOffset(), name.getByteLength()); }
/** Return the string representation of this name. */ @Override public String toString() { return Convert.utf2string(getByteArray(), getByteOffset(), getByteLength()); }
private void printQualified(Symbol t) { if (t.owner != null && t.owner.name.getByteLength() > 0 && !(t.type instanceof Type.TypeVar) && !(t.owner instanceof MethodSymbol)) { if (t.owner instanceof Symbol.PackageSymbol) printAllQualified(t.owner); else printQualified(t.owner); print('.'); } print(t.name); }