java.util.Vector.setElementAt()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中java.util.Vector.setElementAt()方法的一些代码示例,展示了Vector.setElementAt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.setElementAt()方法的具体详情如下:
包路径:java.util.Vector
类名称:Vector
方法名:setElementAt

Vector.setElementAt介绍

[英]Replaces the element at the specified location in this vector with the specified object.
[中]用指定的对象替换此向量中指定位置的元素。

代码示例

代码示例来源:origin: plantuml/plantuml

private void setHintForNextCurve(Vector curveHints, int pointIndex, 
                  Hint hint) {
  while (curveHints.size() <= pointIndex) {
   curveHints.addElement(_initialHintForNextCurve);
  }
  curveHints.setElementAt(hint, pointIndex);
 }
}

代码示例来源:origin: postgresql/postgresql

public void remove
  (String l, String t)
{
  for (int i = 0;i < tokens.size();i++)
  {
    tokens.setElementAt(remove
              ((String)tokens.elementAt(i), l, t), i);
  }
}

代码示例来源:origin: xalan/xalan

/**
 * Used with quicksort method above
 */
private static int partition(Vector rules, int p, int r) {
final WhitespaceRule x = (WhitespaceRule)rules.elementAt((p+r) >>> 1);
int i = p - 1, j = r + 1;
while (true) {
  while (x.compareTo((WhitespaceRule)rules.elementAt(--j)) < 0) {
  }
  while (x.compareTo((WhitespaceRule)rules.elementAt(++i)) > 0) {
  }
  if (i < j) {
  final WhitespaceRule tmp = (WhitespaceRule)rules.elementAt(i);
  rules.setElementAt(rules.elementAt(j), i);
  rules.setElementAt(tmp, j);
  }
  else {
  return j;
  }
}
}

代码示例来源:origin: postgresql/postgresql

for (int i = 0; i < acls.size(); i++)
  String acl = (String)acls.elementAt(i);
  if (acl.startsWith("\"") && acl.endsWith("\""))
    acls.setElementAt(acl, i);

代码示例来源:origin: org.apache.ant/ant

/**
 * Set the Attribute's value; required
 *
 * @param value the attribute's value
 */
public void setValue(String value) {
  if (currentIndex >= values.size()) {
    values.addElement(value);
    currentIndex = values.size() - 1;
  } else {
    values.setElementAt(value, currentIndex);
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Replace an "xsl:template" property.
 * This is a hook for CompilingStylesheetHandler, to allow
 * us to access a template, compile it, instantiate it,
 * and replace the original with the compiled instance.
 * ADDED 9/5/2000 to support compilation experiment
 *
 * @param v Compiled template to replace with
 * @param i Index of template to be replaced
 *
 * @throws TransformerException
 */
public void replaceTemplate(ElemTemplate v, int i) throws TransformerException
{
 if (null == m_templates)
  throw new ArrayIndexOutOfBoundsException();
 replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i));
 m_templates.setElementAt(v, i);
 v.setStylesheet(this);
}

代码示例来源:origin: robovm/robovm

if (i >= b.size())
 b.insertElementAt(a.elementAt(i), i);
else
 b.setElementAt(a.elementAt(i), i);
if (r + m + 1 - j >= b.size())
 b.insertElementAt(a.elementAt(j), r + m + 1 - j);
else
 b.setElementAt(a.elementAt(j), r + m + 1 - j);
 a.setElementAt(b.elementAt(i), k);
 a.setElementAt(b.elementAt(j), k);

代码示例来源:origin: postgresql/postgresql

PSQLState.INVALID_CURSOR_STATE);
if (isBeforeFirst() || isAfterLast() || rows.size() == 0)
  return ;
int numKeys = primaryKeys.size();
rows.setElementAt( rowBuffer, current_row );
this_row = rowBuffer;

代码示例来源:origin: xalan/xalan

/**
 * Replace an "xsl:template" property.
 * This is a hook for CompilingStylesheetHandler, to allow
 * us to access a template, compile it, instantiate it,
 * and replace the original with the compiled instance.
 * ADDED 9/5/2000 to support compilation experiment
 *
 * @param v Compiled template to replace with
 * @param i Index of template to be replaced
 *
 * @throws TransformerException
 */
public void replaceTemplate(ElemTemplate v, int i) throws TransformerException
{
 if (null == m_templates)
  throw new ArrayIndexOutOfBoundsException();
 replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i));
 m_templates.setElementAt(v, i);
 v.setStylesheet(this);
}

代码示例来源:origin: xalan/xalan

public Type typeCheck(SymbolTable stable) throws TypeCheckError {
final Vector contents = getContents();
final int n = contents.size();
for (int i = 0; i < n; i++) {
  final Expression exp = (Expression)contents.elementAt(i);
  if (!exp.typeCheck(stable).identicalTo(Type.String)) {
  contents.setElementAt(new CastExpr(exp, Type.String), i);
  }
}
return _type = Type.String;
}

代码示例来源:origin: postgresql/postgresql

if (isBeforeFirst() || isAfterLast() || rows.size() == 0)
int numKeys = primaryKeys.size();
rows.setElementAt( rowBuffer, current_row );

代码示例来源:origin: robovm/robovm

String rd[] = (String []) tr.rows.elementAt(row);
StringBuffer sb = new StringBuffer();
sb.append("SELECT ");
tr.rows.setElementAt(trnew.rows.elementAt(0), row);

代码示例来源:origin: xalan/xalan

if (i >= b.size())
 b.insertElementAt(a.elementAt(i), i);
else
 b.setElementAt(a.elementAt(i), i);
if (r + m + 1 - j >= b.size())
 b.insertElementAt(a.elementAt(j), r + m + 1 - j);
else
 b.setElementAt(a.elementAt(j), r + m + 1 - j);
 a.setElementAt(b.elementAt(i), k);
 a.setElementAt(b.elementAt(j), k);

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * Set the Attribute's value; required
 *
 * @param value the attribute's value
 */
public void setValue( String value )
{
  if ( currentIndex >= values.size() )
  {
    values.addElement( value );
    currentIndex = values.size() - 1;
  }
  else
  {
    values.setElementAt( value, currentIndex );
  }
}

代码示例来源:origin: robovm/robovm

ElemTemplateElement midNode = (ElemTemplateElement) v.elementAt( ( lo0 + hi0 ) / 2 );
 while( (lo < hi0) && (((ElemTemplateElement) v.elementAt(lo)).compareTo(midNode) < 0) )
 while( (hi > lo0) && (((ElemTemplateElement) v.elementAt(hi)).compareTo(midNode) > 0) )          {
  --hi;
  ElemTemplateElement node = (ElemTemplateElement) v.elementAt(lo);
  v.setElementAt(v.elementAt(hi), lo);
  v.setElementAt(node, hi);

代码示例来源:origin: robovm/robovm

/**
 * NEEDSDOC Method replaceOrPushUserParam 
 *
 *
 * NEEDSDOC @param qname
 * NEEDSDOC @param xval
 */
private void replaceOrPushUserParam(QName qname, XObject xval)
{
 int n = m_userParams.size();
 for (int i = n - 1; i >= 0; i--)
 {
  Arg arg = (Arg) m_userParams.elementAt(i);
  if (arg.getQName().equals(qname))
  {
   m_userParams.setElementAt(new Arg(qname, xval, true), i);
   return;
  }
 }
 m_userParams.addElement(new Arg(qname, xval, true));
}

代码示例来源:origin: dk.eobjects.metamodel/MetaModel-dbase

/**
 * set header information
 */
public void setHeader(String ID, String DBFName) {
  if (idVector.size() == 0) {
    idVector.addElement(ID);
    dataVector.addElement(DBFName);
  } else {
    idVector.setElementAt(ID, 0);
    dataVector.setElementAt(DBFName, 0);
  }
  return;
}

代码示例来源:origin: xalan/xalan

ElemTemplateElement midNode = (ElemTemplateElement) v.elementAt( ( lo0 + hi0 ) / 2 );
 while( (lo < hi0) && (((ElemTemplateElement) v.elementAt(lo)).compareTo(midNode) < 0) )
 while( (hi > lo0) && (((ElemTemplateElement) v.elementAt(hi)).compareTo(midNode) > 0) )          {
  --hi;
  ElemTemplateElement node = (ElemTemplateElement) v.elementAt(lo);
  v.setElementAt(v.elementAt(hi), lo);
  v.setElementAt(node, hi);

代码示例来源:origin: xalan/xalan

/**
 * NEEDSDOC Method replaceOrPushUserParam 
 *
 *
 * NEEDSDOC @param qname
 * NEEDSDOC @param xval
 */
private void replaceOrPushUserParam(QName qname, XObject xval)
{
 int n = m_userParams.size();
 for (int i = n - 1; i >= 0; i--)
 {
  Arg arg = (Arg) m_userParams.elementAt(i);
  if (arg.getQName().equals(qname))
  {
   m_userParams.setElementAt(new Arg(qname, xval, true), i);
   return;
  }
 }
 m_userParams.addElement(new Arg(qname, xval, true));
}

代码示例来源:origin: org.eobjects.metamodel-extras/MetaModel-extras-dbase

/**
 * set header information
 */
public void setHeader(String ID, String DBFName) {
  if (idVector.size() == 0) {
    idVector.addElement(ID);
    dataVector.addElement(DBFName);
  } else {
    idVector.setElementAt(ID, 0);
    dataVector.setElementAt(DBFName, 0);
  }
  return;
}

相关文章

微信公众号

最新文章

更多