下面列出了怎么用com.sun.tools.javac.util.ArrayUtils的API类实例代码及写法,或者点击链接到github查看源代码。
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
Assert.check(!(value instanceof Type.TypeVar));
Assert.check(!(value instanceof Types.UniqueType &&
((UniqueType) value).type instanceof Type.TypeVar));
Integer index = indices.get(value);
if (index == null) {
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
Assert.check(!(value instanceof Type.TypeVar));
Assert.check(!(value instanceof Types.UniqueType &&
((UniqueType) value).type instanceof Type.TypeVar));
Integer index = indices.get(value);
if (index == null) {
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Place an object in the pool, unless it is already there.
* If object is a symbol also enter its owner unless the owner is a
* package. Return the object's index in the pool.
*/
public int put(Object value) {
value = makePoolValue(value);
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
// System.err.println("put " + value + " " + value.getClass());//DEBUG
index = pp;
indices.put(value, index);
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = value;
if (value instanceof Long || value instanceof Double) {
pool = ArrayUtils.ensureCapacity(pool, pp);
pool[pp++] = null;
}
}
return index.intValue();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Initialize new trackable variable by setting its address field
* to the next available sequence number and entering it under that
* index into the vars array.
*/
void newVar(JCVariableDecl varDecl) {
VarSymbol sym = varDecl.sym;
vardecls = ArrayUtils.ensureCapacity(vardecls, nextadr);
if ((sym.flags() & FINAL) == 0) {
sym.flags_field |= EFFECTIVELY_FINAL;
}
sym.adr = nextadr;
vardecls[nextadr] = varDecl;
inits.excl(nextadr);
uninits.incl(nextadr);
nextadr++;
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}
/** Append a character to sbuf.
*/
protected void putChar(char ch, boolean scan) {
sbuf = ArrayUtils.ensureCapacity(sbuf, sp);
sbuf[sp++] = ch;
if (scan)
scanChar();
}