Vector elements - 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 elements method.

This code example shows how to use the following methods:elements
		_names = new Vector<String>();
	} 
 
	@Override 
	public Enumeration<String> propertyNames() {
		return _names.elements();
	} 
 
	@Override 
	public Object put(Object key, Object value) { 
		if (_names.contains(key)) {
			_names.remove(key);
		} 
 
		_names.add((String)key);
 
		return super.put(key, value); 
	} 
 
	@Override 
7
CodeRank
This code example shows how to use the following methods:clone, elements
     * and cannot alter.  The list is cloned because the caller 
     * might use it 
     * for removing children from the container. 
     */ 
    public Enumeration getChildList() {
        return ((Vector) children.clone()).elements();
    } 
     
    /** 
     * Returns the number of children in the container. 
     */ 
    public int getChildCount() { 
        return children.size();
    } 
     
    /** 
     * Adds a child. 
     */ 
    public void add(AttributeManager child) {
        if (child != null && !children.contains(child)) {
7
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:elements
        return (DEREncodable)pkcs12Attributes.get(oid);
    } 
 
    public Enumeration getBagAttributeKeys()
    { 
        return pkcs12Ordering.elements();
    } 
 
    int size() 
    { 
        return pkcs12Ordering.size();
    } 
 
    Hashtable getAttributes()
    { 
        return pkcs12Attributes;
    } 
 
    Vector getOrdering()
    { 
6
CodeRank
This code example shows how to use the following methods:elements
import java.util.Vector;
 
class CollectionIter { 
    PyObject findCollection(Object object) { 
        if (object instanceof Vector) {
            return new EnumerationIter(((Vector) object).elements());
        } 
        if (object instanceof Enumeration) {
            return new EnumerationIter(((Enumeration) object));
        } 
        if (object instanceof Dictionary) {
            return new EnumerationIter(((Dictionary) object).keys());
        } 
 
        return null; 
    } 
 
} 
 
class EnumerationIter extends PyIterator { 
6
CodeRank
This code example shows how to use the following methods:add, elements
  public Enumeration findResources (String name) throws IOException
  { 
    URL url = findResource(name);
    if (url == null)
      return null; 
    Vector v = new Vector(1);
    v.add(url);
    return v.elements();
  } 
 
  /** The helper that does the work for us.  */ 
  SharedLibHelper helper;
} 
6
CodeRank
This code example shows how to use the following methods:elements
        throw new IllegalArgumentException("unknown object in getInstance: " + obj.getClass().getName());
    } 
 
    public Enumeration getObjects()
    { 
        return seq.elements();
    } 
 
    public ASN1SequenceParser parser() 
    { 
        final ASN1Sequence outer = this;
 
        return new ASN1SequenceParser() 
        { 
            private final int max = size();
 
            private int index;
 
            public DEREncodable readObject() throws IOException
6
CodeRank
This code example shows how to use the following methods:addElement, elements
   * Returns an enumeration describing the available options. 
   * 
   * @return 		an enumeration of all the available options. 
   */ 
  public Enumeration listOptions() {
    Vector result = new Vector();
 
    result.addElement(new Option(
	"\tRandom number seed.\n" 
	+ "\t(default " + m_SeedDefault + ")",
	"S", 1, "-S <num>")); 
 
    return result.elements();
  } 
 
  /** 
   * Parses a given list of options. Valid options are:<p> 
   * 
   * @param options 	the list of options as an array of strings 
   * @throws Exception 	if an option is not supported 
6
CodeRank
This code example shows how to use the following methods:add, clear, elements
 
    Mockito.when(hrequest.getMethod()).thenReturn("POST");
    Mockito.when(hrequest.getScheme()).thenReturn("http");
    Mockito.when(hrequest.getServerName()).thenReturn("localhost");
    Mockito.when(hrequest.getServerPort()).thenReturn(8080);
    Vector<String> referers = new Vector<String>();
    referers.add("a");
    referers.add("hacker");
    Mockito.when(hrequest.getHeaders("Referer")).thenReturn(referers.elements());
    Assert.assertFalse(serverProtectionService.isMethodSafe(hrequest, hresponse));
    Mockito.verify(hresponse, Mockito.times(n400++)).sendError(Mockito.eq(400), Mockito.anyString());
 
    Mockito.when(hrequest.getMethod()).thenReturn("POST");
    Mockito.when(hrequest.getScheme()).thenReturn("http");
    Mockito.when(hrequest.getServerName()).thenReturn("localhost");
    Mockito.when(hrequest.getServerPort()).thenReturn(8080);
    referers.clear();
    Mockito.when(hrequest.getHeaders("Referer")).thenReturn(referers.elements());
    Assert.assertFalse(serverProtectionService.isMethodSafe(hrequest, hresponse));
    Mockito.verify(hresponse, Mockito.times(n400++)).sendError(Mockito.eq(400), Mockito.anyString());

6
CodeRank
This code example shows how to use the following methods:add, elements
public class InclusiveByteRangeTest 
{ 
    @SuppressWarnings("unchecked") 
    private void assertInvalidRange(String rangeString)
    { 
        Vector strings = new Vector();
        strings.add(rangeString);
 
        List ranges = InclusiveByteRange.satisfiableRanges(strings.elements(),200);
        assertNull("Invalid Range [" + rangeString + "] should result in no satisfiable ranges",ranges);
    } 
 
    private void assertRange(String msg, int expectedFirst, int expectedLast, int size, InclusiveByteRange actualRange)
    { 
        assertEquals(msg + " - first",expectedFirst,actualRange.getFirst(size));
        assertEquals(msg + " - last",expectedLast,actualRange.getLast(size));
        String expectedHeader = String.format("bytes %d-%d/%d",expectedFirst,expectedLast,size);
        assertEquals(msg + " - header range string",expectedHeader,actualRange.toHeaderRangeString(size));
    } 
 
6
CodeRank

Related Vector elements Questions & Answers:

elements Method Overview
Returns an enumeration of the components of this vector.
See Code Examples for other Java 8 Vector Methods: