本文整理了Java中java.util.Vector.remove()
方法的一些代码示例,展示了Vector.remove()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.remove()
方法的具体详情如下:
包路径:java.util.Vector
类名称:Vector
方法名:remove
[英]Removes the object at the specified location from this vector. All elements with an index bigger than location have their index decreased by 1.
[中]从该向量中移除指定位置处的对象。索引大于位置的所有元素的索引都会减少1。
代码示例来源:origin: alibaba/druid
public boolean removeColumn(ColumnGroup ptg, TableColumn tc) {
boolean retFlag = false;
if (tc != null) {
for (int i = 0; i < ptg.vector.size(); i++) {
Object tmpObj = ptg.vector.get(i);
if (tmpObj instanceof ColumnGroup) {
retFlag = removeColumn((ColumnGroup) tmpObj, tc);
if (retFlag) {
break;
}
} else if (tmpObj instanceof TableColumn) {
if (tmpObj == tc) {
ptg.vector.remove(i);
retFlag = true;
break;
}
}
}
}
return retFlag;
}
代码示例来源:origin: gocd/gocd
/**
* Do we have to traverse a symlink when trying to reach path from
* basedir?
* @param base base File (dir).
* @param pathElements Vector of path elements (dirs...file).
* @since Ant 1.6
*/
private boolean isSymlink(File base, Vector pathElements) {
if (pathElements.size() > 0) {
String current = (String) pathElements.remove(0);
try {
return FileUtil.isSymbolicLink(base, current)
|| isSymlink(new File(base, current), pathElements);
} catch (IOException ioe) {
String msg = "IOException caught while checking "
+ "for links, couldn't get canonical path!";
// will be caught and redirected to Ant's logging system
System.err.println(msg);
}
}
return false;
}
代码示例来源:origin: robovm/robovm
/**
* Register the extension namespace for an ElemExtensionDecl or ElemFunction,
* and prepare a support object to launch the appropriate ExtensionHandler at
* transformation runtime.
*/
public void registerExtension(ExtensionNamespaceSupport extNsSpt)
{
String namespace = extNsSpt.getNamespace();
if (namespaceIndex(namespace, m_extensions) == -1)
{
m_extensions.add(extNsSpt);
if (m_unregisteredExtensions.contains(namespace))
m_unregisteredExtensions.remove(namespace);
}
}
代码示例来源:origin: postgresql/postgresql
if (dims.size() == 0)
dims.add(arrayList);
PgArrayList p = ((PgArrayList) dims.lastElement());
p.add(a);
dims.add(a);
dims.remove(dims.size() - 1);
if (dims.size() > 0)
代码示例来源:origin: smuyyh/BookReader
int paraSpace = 0;
mPageLineCount = mVisibleHeight / (mFontSize + mLineSpace);
while ((lines.size() < mPageLineCount) && (curBeginPos > 0)) {
Vector<String> paraLines = new Vector<>(); // 段落行
byte[] parabuffer = readParagraphBack(curBeginPos); // 1.读取上一个段落
paraLines.add(strParagraph.substring(0, paintSize));
strParagraph = strParagraph.substring(paintSize);
while (lines.size() > mPageLineCount) { // 4.如果段落添加完,但是超出一页,则超出部分需删减
try {
curBeginPos += lines.get(0).getBytes(charset).length; // 5.删减行数同时起始位置指针也要跟着偏移
lines.remove(0);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
代码示例来源:origin: stackoverflow.com
Vector<Object> tbl1 = new Vector<Object>();
Random rnd = new Random();
tbl.add("Integer");
tbl.add("Double");
tbl.add("Boolean");
tbl.add("Boolean");
tbl.add("String");
return this.colNames.size();
return this.colNames.get(colNum);
return this.data.size();
Vector<Object> value = this.data.get(row);
return value.get(col);
public void setValueAt(Object newVal, int row, int col) {
Vector<Object> aRow = data.elementAt(row);
aRow.remove(col);
aRow.insertElementAt(newVal, col);
fireTableCellUpdated(row, col);
代码示例来源:origin: org.apache.ant/ant
value = passedTokens.remove(passedTokens.size() - 1);
if (passedTokens.isEmpty()) {
value = beginToken + value + endToken;
passedTokens.remove(passedTokens.size() - 1);
代码示例来源:origin: stackoverflow.com
Vector<Vector<Integer>> current_domain = new Vector<Vector<Integer>>();
Vector<Integer> vect = new Vector<Integer>();
vect.add(4);
vect.add(5);
current_domain.add(vect);
current_domain.get(0).remove(0);
System.out.println(current_domain);
代码示例来源:origin: xalan/xalan
quicksort(rules, 0, rules.size()-1);
for (int i = 0; i < rules.size(); i++) {
currentRule = (WhitespaceRule)rules.elementAt(i);
if (currentRule.getAction() == STRIP_SPACE) {
for (int idx = 0; idx < rules.size(); ) {
currentRule = (WhitespaceRule)rules.elementAt(idx);
rules.remove(idx);
代码示例来源:origin: org.scijava/j3dcore
void doRemoveLight(int index) {
Light light = this.lights.get(index);
((LightRetained)light.retained).setInImmCtx(false);
this.lights.remove(index);
this.lightsChanged = true;
}
代码示例来源:origin: alibaba/druid
public boolean removeColumnGrp(ColumnGroup ptg, ColumnGroup tg) {
boolean retFlag = false;
if (tg != null) {
for (int i = 0; i < ptg.vector.size(); i++) {
Object tmpObj = ptg.vector.get(i);
if (tmpObj instanceof ColumnGroup) {
if (tmpObj == tg) {
ptg.vector.remove(i);
retFlag = true;
break;
} else {
retFlag = removeColumnGrp((ColumnGroup) tmpObj, tg);
if (retFlag) {
break;
}
}
} else if (tmpObj instanceof TableColumn) {
break;
}
}
}
return retFlag;
}
代码示例来源:origin: xalan/xalan
/**
* Register the extension namespace for an ElemExtensionDecl or ElemFunction,
* and prepare a support object to launch the appropriate ExtensionHandler at
* transformation runtime.
*/
public void registerExtension(ExtensionNamespaceSupport extNsSpt)
{
String namespace = extNsSpt.getNamespace();
if (namespaceIndex(namespace, m_extensions) == -1)
{
m_extensions.add(extNsSpt);
if (m_unregisteredExtensions.contains(namespace))
m_unregisteredExtensions.remove(namespace);
}
}
代码示例来源:origin: org.netbeans.api/org-openide-awt
while (historyList.size() > (historyIndex + 1))
historyList.remove(historyList.size() - 1);
historyList.add(evt.getNewValue());
historyIndex = historyList.size() - 1;
代码示例来源:origin: Sable/soot
transformsToAdd.add(arg);
transformsToWeights.put(arg, new Integer(tweight));
if (arg.equals("wjtp.jbco_fr")) {
transformsToAdd.add(trans);
Map<Object, Integer> htmp = transformsToMethodsToWeights.get(trans);
if (htmp == null) {
transformsToAdd.remove("wjtp.jbco_cc");
transformsToAdd.remove("jtp.jbco_jl");
transformsToAdd.remove("bb.jbco_j2bl");
transformsToAdd.remove("bb.jbco_ful");
if (transformsToAdd.size() == 0) {
logger.debug("No Jbco tasks to complete. Shutting Down...");
System.exit(0);
if (transformsToAdd.remove("wjtp.jbco_fr")) {
FieldRenamer.v().setRenameFields(true);
for (int i = 0; i < transformsToAdd.size(); i++) {
if (transformsToAdd.get(i).startsWith("bb")) {
jl = "jtp.jbco_jl";
jtp.add(new Transform(jl, newTransform((Transformer) getTransform(jl))));
for (int i = 0; i < transformsToAdd.size(); i++) {
String tname = transformsToAdd.get(i);
IJbcoTransform t = getTransform(tname);
代码示例来源:origin: gocd/gocd
if (pathElements.size() == 0) {
return base;
String current = (String) pathElements.remove(0);
if (base == null) {
return findFile(new File(current), pathElements, cs);
代码示例来源:origin: xalan/xalan
while (input.size() > 0) {
boolean changed = false;
for (int i = 0; i < input.size(); ) {
final TopLevelElement vde = (TopLevelElement) input.elementAt(i);
final Vector dep = vde.getDependencies();
if (dep == null || result.containsAll(dep)) {
result.addElement(vde);
input.remove(i);
changed = true;
代码示例来源:origin: net.sf.squirrel-sql.plugins/smarttools
private void addEntry() {
int index = listSourceColumns.getSelectedIndex();
if (index > -1) {
vecTarget.add(vecSource.get(index));
vecSource.remove(index);
displayLists();
}
}
代码示例来源:origin: org.scijava/j3dcore
void doRemoveSound(int index) {
Sound sound = this.sounds.get(index);
SoundScheduler soundScheduler = getSoundScheduler();
((SoundRetained)(sound.retained)).setInImmCtx(false);
this.sounds.remove(index);
this.soundsChanged = true;
// stop sound if playing on audioDevice
sendSoundMessage(GraphicsContext3D.REMOVE_SOUND, null, sound);
}
代码示例来源:origin: com.alibaba/druid
public boolean removeColumn(ColumnGroup ptg, TableColumn tc) {
boolean retFlag = false;
if (tc != null) {
for (int i = 0; i < ptg.vector.size(); i++) {
Object tmpObj = ptg.vector.get(i);
if (tmpObj instanceof ColumnGroup) {
retFlag = removeColumn((ColumnGroup) tmpObj, tc);
if (retFlag) {
break;
}
} else if (tmpObj instanceof TableColumn) {
if (tmpObj == tc) {
ptg.vector.remove(i);
retFlag = true;
break;
}
}
}
}
return retFlag;
}
代码示例来源:origin: org.apache.ant/ant
filesets.add(implicit);
} finally {
if (implicit != null) {
filesets.remove(implicit);
内容来源于网络,如有侵权,请联系作者删除!