当前位置: 首页>>代码示例>>Java>>正文


Java Vector.toString方法代码示例

本文整理汇总了Java中java.util.Vector.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Vector.toString方法的具体用法?Java Vector.toString怎么用?Java Vector.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Vector的用法示例。


在下文中一共展示了Vector.toString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRequestString

import java.util.Vector; //导入方法依赖的package包/类
public String getRequestString(Context context) {
	if (context != null) {
		String requestString = context.projectName + " " + context.transactionName;
		Document doc = context.inputDocument;
		if (doc != null) {
			NodeList list = doc.getElementsByTagName("variable");
			Vector<String> vVariables = new Vector<String>(list.getLength());
			for (int i=0; i<list.getLength(); i++) {
				Element elt = (Element)list.item(i);
				String name = elt.getAttribute("name");
				String value = elt.getAttribute("value");
				vVariables.add(name + "=" + value);
			}
			QuickSort quickSort = new QuickSort(vVariables);
			vVariables = GenericUtils.cast(quickSort.perform(true));
	
			requestString += " " + vVariables.toString();
		}
		return requestString;
	}
	return null;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:23,代码来源:CicsTransaction.java

示例2: isUnique

import java.util.Vector; //导入方法依赖的package包/类
/**
 * This method will check if the given string can be expanded to the
 * unique string.  If it can be expanded to mutiple files, SftpException
 * will be thrown.
 * @return the returned string is unquoted.
 */
private String isUnique(String path) throws SftpException, Exception{
  Vector v=glob_remote(path);
  if(v.size()!=1){
    throw new SftpException(SSH_FX_FAILURE, path+" is not unique: "+v.toString());
  }
  return (String)(v.elementAt(0));
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:14,代码来源:ChannelSftp.java

示例3: put

import java.util.Vector; //导入方法依赖的package包/类
public void put(InputStream src, String dst, 
  SftpProgressMonitor monitor, int mode) throws SftpException{
  try{
    dst=remoteAbsolutePath(dst);

    Vector v=glob_remote(dst);
    int vsize=v.size();
    if(vsize!=1){
      if(vsize==0){
        if(isPattern(dst))
          throw new SftpException(SSH_FX_FAILURE, dst);
        else
          dst=Util.unquote(dst);
      }
      throw new SftpException(SSH_FX_FAILURE, v.toString());
    }
    else{
      dst=(String)(v.elementAt(0));
    }

    if(isRemoteDir(dst)){
      throw new SftpException(SSH_FX_FAILURE, dst+" is a directory");
    }

    _put(src, dst, monitor, mode);
  }
  catch(Exception e){
    if(e instanceof SftpException) throw (SftpException)e;
    if(e instanceof Throwable)
      throw new SftpException(SSH_FX_FAILURE, e.toString(), (Throwable)e);
    throw new SftpException(SSH_FX_FAILURE, e.toString());
  }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:ChannelSftp.java

示例4: put

import java.util.Vector; //导入方法依赖的package包/类
/**
 * Sends data from the input stream <code>src</code> to <code>dst</code> file.
 * The <code>mode</code> should be <code>OVERWRITE</code>,
 * <code>RESUME</code> or <code>APPEND</code>.
 *
 * @param src input stream
 * @param dst destination file
 * @param monitor progress monitor
 * @param mode how data should be added to dst
 */
public void put(InputStream src, String dst, 
  SftpProgressMonitor monitor, int mode) throws SftpException{
  try{
    ((MyPipedInputStream)io_in).updateReadSide();

    dst=remoteAbsolutePath(dst);

    Vector v=glob_remote(dst);
    int vsize=v.size();
    if(vsize!=1){
      if(vsize==0){
        if(isPattern(dst))
          throw new SftpException(SSH_FX_FAILURE, dst);
        else
          dst=Util.unquote(dst);
      }
      throw new SftpException(SSH_FX_FAILURE, v.toString());
    }
    else{
      dst=(String)(v.elementAt(0));
    }

    if(monitor!=null){
      monitor.init(SftpProgressMonitor.PUT, 
                   "-", dst,
                   SftpProgressMonitor.UNKNOWN_SIZE);
    }

    _put(src, dst, monitor, mode);
  }
  catch(Exception e){
    if(e instanceof SftpException) {
      if(((SftpException)e).id == SSH_FX_FAILURE &&
         isRemoteDir(dst)) {
        throw new SftpException(SSH_FX_FAILURE, dst+" is a directory");
      }
      throw (SftpException)e;
    }
    if(e instanceof Throwable)
      throw new SftpException(SSH_FX_FAILURE, e.toString(), (Throwable)e);
    throw new SftpException(SSH_FX_FAILURE, e.toString());
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:54,代码来源:ChannelSftp.java

示例5: rename

import java.util.Vector; //导入方法依赖的package包/类
public void rename(String oldpath, String newpath) throws SftpException{
   if(server_version<2){
     throw new SftpException(SSH_FX_OP_UNSUPPORTED, 
                             "The remote sshd is too old to support rename operation.");
   }

   try{
     ((MyPipedInputStream)io_in).updateReadSide();

     oldpath=remoteAbsolutePath(oldpath);
     newpath=remoteAbsolutePath(newpath);

     oldpath=isUnique(oldpath);

     Vector v=glob_remote(newpath);
     int vsize=v.size();
     if(vsize>=2){
       throw new SftpException(SSH_FX_FAILURE, v.toString());
     }
     if(vsize==1){
       newpath=(String)(v.elementAt(0));
     }
     else{  // vsize==0
       if(isPattern(newpath))
         throw new SftpException(SSH_FX_FAILURE, newpath);
       newpath=Util.unquote(newpath);
     }

     sendRENAME(Util.str2byte(oldpath, fEncoding),
                Util.str2byte(newpath, fEncoding));

     Header header=new Header();
     header=header(buf, header);
     int length=header.length;
     int type=header.type;

     fill(buf, length);

     if(type!=SSH_FXP_STATUS){
       throw new SftpException(SSH_FX_FAILURE, "");
     }

     int i=buf.getInt();
     if(i==SSH_FX_OK) return;
     throwStatusError(buf, i);
  }
  catch(Exception e){
    if(e instanceof SftpException) throw (SftpException)e;
    if(e instanceof Throwable)
      throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
    throw new SftpException(SSH_FX_FAILURE, "");
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:54,代码来源:ChannelSftp.java

示例6: resolveDependencies

import java.util.Vector; //导入方法依赖的package包/类
/**
 * This method returns a vector with variables/params and keys in the
 * order in which they are to be compiled for initialization. The order
 * is determined by analyzing the dependencies between them. The XSLT 1.0
 * spec does not allow a key to depend on a variable. However, for
 * compatibility with Xalan interpretive, that type of dependency is
 * allowed and, therefore, consider to determine the partial order.
 */
private Vector resolveDependencies(Vector input) {
    /* DEBUG CODE - INGORE
    for (int i = 0; i < input.size(); i++) {
        final TopLevelElement e = (TopLevelElement) input.elementAt(i);
        System.out.println("e = " + e + " depends on:");
        Vector dep = e.getDependencies();
        for (int j = 0; j < (dep != null ? dep.size() : 0); j++) {
            System.out.println("\t" + dep.elementAt(j));
        }
    }
    System.out.println("=================================");
    */

    Vector result = new Vector();
    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;
            }
            else {
                i++;
            }
        }

        // If nothing was changed in this pass then we have a circular ref
        if (!changed) {
            ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR,
                                        input.toString(), this);
            getParser().reportError(Constants.ERROR, err);
            return(result);
        }
    }

    /* DEBUG CODE - INGORE
    System.out.println("=================================");
    for (int i = 0; i < result.size(); i++) {
        final TopLevelElement e = (TopLevelElement) result.elementAt(i);
        System.out.println("e = " + e);
    }
    */

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:57,代码来源:Stylesheet.java

示例7: rename

import java.util.Vector; //导入方法依赖的package包/类
public void rename(String oldpath, String newpath) throws SftpException{
   if(server_version<2){
     throw new SftpException(SSH_FX_OP_UNSUPPORTED, 
                             "The remote sshd is too old to support rename operation.");
   }

   try{
     oldpath=remoteAbsolutePath(oldpath);
     newpath=remoteAbsolutePath(newpath);

     oldpath=isUnique(oldpath);

     Vector v=glob_remote(newpath);
     int vsize=v.size();
     if(vsize>=2){
       throw new SftpException(SSH_FX_FAILURE, v.toString());
     }
     if(vsize==1){
       newpath=(String)(v.elementAt(0));
     }
     else{  // vsize==0
       if(isPattern(newpath))
         throw new SftpException(SSH_FX_FAILURE, newpath);
       newpath=Util.unquote(newpath);
     }

     sendRENAME(Util.str2byte(oldpath, fEncoding),
                Util.str2byte(newpath, fEncoding));

     Header header=new Header();
     header=header(buf, header);
     int length=header.length;
     int type=header.type;

     fill(buf, length);

     if(type!=SSH_FXP_STATUS){
       throw new SftpException(SSH_FX_FAILURE, "");
     }

     int i=buf.getInt();
     if(i==SSH_FX_OK) return;
     throwStatusError(buf, i);
  }
  catch(Exception e){
    if(e instanceof SftpException) throw (SftpException)e;
    if(e instanceof Throwable)
      throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
    throw new SftpException(SSH_FX_FAILURE, "");
  }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:52,代码来源:ChannelSftp.java


注:本文中的java.util.Vector.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。