當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。