Vector addElement - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Vector addElement method.

This code example shows how to use the following methods:addElement
    /** 
     * Adds a new string/int pair to the internal hashtable. 
     */ 
    public void add(int value, String name) {
        Integer I = new Integer(value);
        names.addElement(name);
        keyedByString.put(name, I);
        keyedByInteger.put(I, name);
    } 
     
    /** 
     * Returns true if the choice is valid for this enum type. 
     */ 
    public boolean isValid(int choice) {
        return (keyedByInteger.containsKey(new Integer(choice)));
    } 
     
    /** 
     * Returns true if the choice is valid for this enum type. 
     */ 
7
CodeRank
This code example shows how to use the following methods:addElement
    public void addCRLEntry( 
        ASN1Sequence crlEntry)
    { 
        if (crlentries == null)
        { 
            crlentries = new Vector();
        } 
         
        crlentries.addElement(crlEntry);
    } 
 
    public void addCRLEntry(DERInteger userCertificate, DERUTCTime revocationDate, int reason)
    { 
        addCRLEntry(userCertificate, new Time(revocationDate), reason);
    } 
 
    public void addCRLEntry(DERInteger userCertificate, Time revocationDate, int reason)
    { 
        addCRLEntry(userCertificate, revocationDate, reason, null);
    } 
7
CodeRank
This code example shows how to use the following methods:addElement, removeAllElements
	/** 
	 * Adds a new element to download. 
	 */ 
	public void enqueue(RequestedResource resource, BrowserContent referrer) {
		if (browser != referrer) {
			queue.removeAllElements();
			browser = referrer;
		} 
		queue.addElement(resource);
	} 
 
	/** 
	 * Downloads all queued resources. 
	 */ 
	public void run() { 
		if (!queue.isEmpty()) processResource();
		main.invokeLater(this, queue.isEmpty() ? 250 : 1, false);
	} 
 
	private void processResource() { 
7
CodeRank
This code example shows how to use the following methods:addElement, elementAt
 
  /** 
   */ 
  public TransportAddress stringToAddr(String s) throws ICPException {
    Vector  addressFields = parseURL(s);
    String protocol = (String) addressFields.elementAt(0);
 
    if (!NAME.equals(protocol)) {
      throw new ICPException("Unexpected protocol \""+protocol+"\" when \""+NAME+"\" was expected.");
    }  
 
    String host = (String) addressFields.elementAt(1);
    String port = (String) addressFields.elementAt(2);
    String file = (String) addressFields.elementAt(3);
    String anchor = (String) addressFields.elementAt(4);
 
    return new HTTPAddress(host, port, file, anchor);
  }  
 
  /** 

6
CodeRank
This code example shows how to use the following methods:addElement
    } 
     
    public void add( 
        DEREncodable   obj)
    { 
        v.addElement(obj);
    } 
 
    public DEREncodable get( 
        int i)
    { 
        return (DEREncodable)v.elementAt(i);
    } 
 
    public int size() 
    { 
        return v.size();
    } 
} 
7
CodeRank
This code example shows how to use the following methods:addElement, set
     * of creating many small RTFs. 
     */ 
    private void alloc() { 
	_attributes = new Hashtable();
	_names  = new Vector();
	_values = new Vector();
	_qnames = new Vector();
	_uris   = new Vector();        
    } 
 
    /** 
     * SAX2: Return the number of attributes in the list.  
     */ 
    public int getLength() { 
	return(_length);
    } 
 
    /** 
     * SAX2: Look up an attribute's Namespace URI by index. 
     */ 

6
CodeRank
This code example shows how to use the following methods:pop, push, addElement
		cm.publish(taintedElement);
	} 
 
	public void concreteWriteReadStackPopTest() { 
		String tainted = TelephonyManager.getDeviceId();
		Stack<String> stack = new Stack<String>();
		stack.addElement("neutral");
		stack.push(tainted);
 
		String taintedElement3 = stack.pop();
 
		ConnectionManager cm = new ConnectionManager();
		cm.publish(taintedElement3);
	} 
 
	public void concreteWriteReadStackNegativeTest() { 
		String tainted = TelephonyManager.getDeviceId();
		Stack<String> stack = new Stack<String>();
		Stack<String> stack2 = new Stack<String>();
		stack.addElement("neutral");
6
CodeRank
This code example shows how to use the following methods:addElement, elements
  /** 
   * Returns an enumeration of the additional measure names 
   * @return an enumeration of the measure names 
   */ 
  public Enumeration enumerateMeasures() {
    Vector newVector = new Vector(3);
    newVector.addElement("measureTreeSize");
    newVector.addElement("measureNumLeaves");
    newVector.addElement("measureNumRules");
    return newVector.elements();
  } 
   
  /** 
   * Returns the revision string. 
   *  
   * @return		the revision 
   */ 
  public String getRevision() {
    return RevisionUtils.extract("$Revision: 1.10 $"); 
  } 
6
CodeRank
This code example shows how to use the following methods:addElement
        if (extensions.containsKey(oid))
        { 
            throw new IllegalArgumentException("extension " + oid + " already added");
        } 
 
        extOrdering.addElement(oid);
        extensions.put(oid, new X509Extension(critical, new DEROctetString(value)));
    } 
 
    /** 
     * Return true if there are no extension present in this generator. 
     * 
     * @return true if empty, false otherwise 
     */ 
    public boolean isEmpty() 
    { 
        return extOrdering.isEmpty();
    } 
 
    /** 
7
CodeRank
This code example shows how to use the following methods:addElement
Hashtable attrs = new Hashtable();
 
        attrs.put(oid, value);
 
        Vector order = new Vector();
 
        order.addElement(oid);
         
        X509Name name = new X509Name(order, attrs);
 
        ASN1Sequence seq = (ASN1Sequence)name.toASN1Primitive();
        ASN1Set set = (ASN1Set)seq.getObjectAt(0);
        seq = (ASN1Sequence)set.getObjectAt(0);
 
        return seq.getObjectAt(1);
    } 
 
    private ASN1Encodable createEntryValueFromString(DERObjectIdentifier oid, String value)
    { 
6
CodeRank

Related Vector addElement Questions & Answers:

addElement Method Overview
Adds the specified component to the end of this vector, increasing its size by one.
See Code Examples for other Java 8 Vector Methods: