java.util.Vector

Here are the examples of the java api class java.util.Vector taken from open source projects.

1. ISOMultiFieldPackagerTest#testUnpackList()

Project: jPOS
Source File: ISOMultiFieldPackagerTest.java
View license
public void testUnpackList() throws Exception {
    byte[] raw = new byte[] { (byte) 0xF0, (byte) 0xF4, (byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4 };
    Vector list = new Vector();
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFE_LLNUM(10, "Should be 041234"));
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    ISOMultiFieldPackager packager = new ISOMultiFieldPackager("A List choice", list);
    ISOField field = new ISOField();
    packager.unpack(field, raw, 0);
    assertEquals("1234", (String) field.getValue());
}

2. WebApplicationDefinitionImpl#preBuild()

View license
/* (non-Javadoc)
     * @see org.apache.cocoon.portal.pluto.om.common.Support#preBuild(java.lang.Object)
     */
public void preBuild(Object parameter) throws Exception {
    Vector structure = (Vector) parameter;
    PortletApplicationDefinition portletApplication = (PortletApplicationDefinition) structure.get(0);
    String contextString = (String) structure.get(1);
    setContextRoot(contextString);
    HashMap servletMap = new HashMap(1);
    Vector structure2 = new Vector();
    structure2.add(this);
    structure2.add(servletMappings);
    structure2.add(servletMap);
    ((Support) servlets).preBuild(structure2);
    Vector structure3 = new Vector();
    structure3.add(contextString);
    structure3.add(this);
    structure3.add(servletMap);
    ((Support) portletApplication).preBuild(structure3);
}

3. VectorTest#test_override_size()

Project: j2objc
Source File: VectorTest.java
View license
public void test_override_size() throws Exception {
    Vector v = new Vector();
    Vector testv = new MockVector();
    // though size is overriden, it should passed without exception
    testv.add(1);
    testv.add(2);
    testv.clear();
    testv.add(1);
    testv.add(2);
    v.add(1);
    v.add(2);
    // RI's bug here
    assertTrue(testv.equals(v));
}

4. BuildConfig#initDefaultDefines()

Project: openjdk
Source File: BuildConfig.java
View license
void initDefaultDefines(Vector defines) {
    Vector sysDefines = new Vector();
    sysDefines.add("WIN32");
    sysDefines.add("_WINDOWS");
    sysDefines.add("HOTSPOT_BUILD_USER=\\\"" + System.getProperty("user.name") + "\\\"");
    sysDefines.add("HOTSPOT_BUILD_TARGET=\\\"" + get("Build") + "\\\"");
    sysDefines.add("INCLUDE_TRACE=1");
    sysDefines.add("_JNI_IMPLEMENTATION_");
    if (vars.get("PlatformName").equals("Win32")) {
        sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
    } else {
        sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
    }
    sysDefines.add("DEBUG_LEVEL=\\\"" + get("Build") + "\\\"");
    sysDefines.addAll(defines);
    put("Define", sysDefines);
}

5. DirectoryScanner#clearResults()

Project: gocd
Source File: DirectoryScanner.java
View license
/**
     * Clear the result caches for a scan.
     */
protected synchronized void clearResults() {
    filesIncluded = new Vector();
    filesNotIncluded = new Vector();
    filesExcluded = new Vector();
    filesDeselected = new Vector();
    dirsIncluded = new Vector();
    dirsNotIncluded = new Vector();
    dirsExcluded = new Vector();
    dirsDeselected = new Vector();
    everythingIncluded = (basedir != null);
    scannedDirs.clear();
}

6. WinGammaPlatform#createAllConfigs()

Project: openjdk
Source File: WinGammaPlatform.java
View license
Vector createAllConfigs(String platform) {
    Vector allConfigs = new Vector();
    allConfigs.add(new C1DebugConfig());
    allConfigs.add(new C1FastDebugConfig());
    allConfigs.add(new C1ProductConfig());
    allConfigs.add(new TieredDebugConfig());
    allConfigs.add(new TieredFastDebugConfig());
    allConfigs.add(new TieredProductConfig());
    return allConfigs;
}

7. RuleColorizer#getDefaultColors()

Project: chainsaw
Source File: RuleColorizer.java
View license
public Vector getDefaultColors() {
    Vector vec = new Vector();
    vec.add(Color.white);
    vec.add(Color.black);
    //add default alternating color & search backgrounds (both foreground are black)
    vec.add(ChainsawConstants.COLOR_ODD_ROW_BACKGROUND);
    vec.add(ChainsawConstants.FIND_LOGGER_BACKGROUND);
    vec.add(new Color(255, 255, 225));
    vec.add(new Color(255, 225, 255));
    vec.add(new Color(225, 255, 255));
    vec.add(new Color(255, 225, 225));
    vec.add(new Color(225, 255, 225));
    vec.add(new Color(225, 225, 255));
    vec.add(new Color(225, 225, 183));
    vec.add(new Color(225, 183, 225));
    vec.add(new Color(183, 225, 225));
    vec.add(new Color(183, 225, 183));
    vec.add(new Color(183, 183, 225));
    vec.add(new Color(232, 201, 169));
    vec.add(new Color(255, 255, 153));
    vec.add(new Color(255, 153, 153));
    vec.add(new Color(189, 156, 89));
    vec.add(new Color(255, 102, 102));
    vec.add(new Color(255, 177, 61));
    vec.add(new Color(61, 255, 61));
    vec.add(new Color(153, 153, 255));
    vec.add(new Color(255, 153, 255));
    return vec;
}

8. CacheMap#placeInStorageCache()

Project: CodenameOne
Source File: CacheMap.java
View license
private void placeInStorageCache(int offset, Object key, long lastAccessed, Object value) {
    Vector v = new Vector();
    v.addElement(value);
    Long l = new Long(lastAccessed);
    v.addElement(l);
    v.addElement(key);
    Storage.getInstance().writeObject("$CACHE$" + cachePrefix + key.toString(), v);
    Vector storageCacheContent = getStorageCacheContent();
    if (storageCacheContent.size() > offset) {
        storageCacheContent.setElementAt(new Object[] { l, key }, offset);
    } else {
        storageCacheContent.insertElementAt(new Object[] { l, key }, offset);
    }
    Storage.getInstance().writeObject("$CACHE$Idx" + cachePrefix, storageCacheContent);
}

9. GitSSHXmlRpcClient#askPassword()

View license
/**
   * [email protected]}
   */
@Nullable
@SuppressWarnings("unchecked")
public String askPassword(String token, final String username, final boolean resetPassword, final String lastError) {
    if (myClient == null) {
        return null;
    }
    Vector parameters = new Vector();
    parameters.add(token);
    parameters.add(username);
    parameters.add(resetPassword);
    parameters.add(lastError);
    try {
        return adjustNull(((String) myClient.execute(methodName("askPassword"), parameters)));
    } catch (XmlRpcException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    } catch (IOException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    }
}

10. GitSSHXmlRpcClient#setLastSuccessful()

View license
@Override
@SuppressWarnings("unchecked")
public String setLastSuccessful(String token, String userName, String method, String error) {
    if (myClient == null) {
        return "";
    }
    Vector parameters = new Vector();
    parameters.add(token);
    parameters.add(userName);
    parameters.add(method);
    parameters.add(error);
    try {
        return (String) myClient.execute(methodName("setLastSuccessful"), parameters);
    } catch (XmlRpcException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    } catch (IOException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    }
}

11. VectorTest#test_toString()

Project: j2objc
Source File: VectorTest.java
View license
/**
     * @tests java.util.Vector#toString()
     */
public void test_toString() {
    // Ensure toString works with self-referencing elements.
    Vector<Object> vec = new Vector<Object>(3);
    vec.add(null);
    vec.add(new Object());
    vec.add(vec);
    assertNotNull(vec.toString());
    // Test for method java.lang.String java.util.Vector.toString()
    assertTrue("Incorrect String returned", tVector.toString().equals(vString));
    Vector v = new Vector();
    v.addElement("one");
    v.addElement(v);
    v.addElement("3");
    // test last element
    v.addElement(v);
    String result = v.toString();
    assertTrue("should contain self ref", result.indexOf("(this") > -1);
}

12. NaccacheSternKeyPairGenerator#permuteList()

View license
/**
     * Generates a permuted ArrayList from the original one. The original List
     * is not modified
     * 
     * @param arr
     *            the ArrayList to be permuted
     * @param rand
     *            the source of Randomness for permutation
     * @return a new ArrayList with the permuted elements.
     */
private static Vector permuteList(Vector arr, SecureRandom rand) {
    Vector retval = new Vector();
    Vector tmp = new Vector();
    for (int i = 0; i < arr.size(); i++) {
        tmp.addElement(arr.elementAt(i));
    }
    retval.addElement(tmp.elementAt(0));
    tmp.removeElementAt(0);
    while (tmp.size() != 0) {
        retval.insertElementAt(tmp.elementAt(0), getInt(rand, retval.size() + 1));
        tmp.removeElementAt(0);
    }
    return retval;
}

13. NaccacheSternKeyPairGenerator#permuteList()

View license
/**
     * Generates a permuted ArrayList from the original one. The original List
     * is not modified
     * 
     * @param arr
     *            the ArrayList to be permuted
     * @param rand
     *            the source of Randomness for permutation
     * @return a new ArrayList with the permuted elements.
     */
private static Vector permuteList(Vector arr, SecureRandom rand) {
    Vector retval = new Vector();
    Vector tmp = new Vector();
    for (int i = 0; i < arr.size(); i++) {
        tmp.addElement(arr.elementAt(i));
    }
    retval.addElement(tmp.elementAt(0));
    tmp.removeElementAt(0);
    while (tmp.size() != 0) {
        retval.insertElementAt(tmp.elementAt(0), getInt(rand, retval.size() + 1));
        tmp.removeElementAt(0);
    }
    return retval;
}

14. PortletApplicationDefinitionImpl#preBuild()

View license
/* (non-Javadoc)
     * @see org.apache.cocoon.portal.pluto.om.common.Support#preBuild(java.lang.Object)
     */
public void preBuild(Object parameter) throws Exception {
    Vector structure = (Vector) parameter;
    String contextRoot = (String) structure.get(0);
    WebApplicationDefinition webApplication = (WebApplicationDefinition) structure.get(1);
    Map servletMap = (Map) structure.get(2);
    this.setContextRoot(contextRoot);
    setWebApplicationDefinition(webApplication);
    Vector structure2 = new Vector();
    structure2.add(this);
    structure2.add(servletMap);
    ((Support) portlets).preBuild(structure2);
}

15. ISOMultiFieldPackagerTest#testPackList()

Project: jPOS
Source File: ISOMultiFieldPackagerTest.java
View license
public void testPackList() throws Exception {
    Vector list = new Vector();
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFE_LLNUM(10, "Should be 041234"));
    list.add(new IFB_LLNUM(10, "The one to pack", true));
    ISOMultiFieldPackager packager = new ISOMultiFieldPackager("Should be 041234", list);
    packager.hint("The one to pack");
    ISOField field = new ISOField(12, "1234");
    TestUtils.assertEquals(new byte[] { (byte) 0x04, (byte) 0x12, (byte) 0x34 }, packager.pack(field));
}

16. XmlRpcResourceManagerClient#submitJob()

View license
public boolean submitJob(Job exec, JobInput in, URL hostUrl) throws JobExecutionException {
    Vector argList = new Vector();
    argList.add(XmlRpcStructFactory.getXmlRpcJob(exec));
    argList.add(in.write());
    argList.add(hostUrl.toString());
    boolean success;
    try {
        success = (Boolean) client.execute("resourcemgr.handleJob", argList);
    } catch (XmlRpcException e) {
        throw new JobExecutionException(e.getMessage(), e);
    } catch (IOException e) {
        throw new JobExecutionException(e.getMessage(), e);
    }
    return success;
}

17. XmlRpcWorkflowManagerClient#getWorkflowInstancesByStatus()

View license
public List getWorkflowInstancesByStatus(String status) throws XmlRpcException, IOException {
    Vector argList = new Vector();
    argList.add(status);
    Vector insts;
    Vector instsUnpacked;
    insts = (Vector) client.execute("workflowmgr.getWorkflowInstancesByStatus", argList);
    if (insts != null) {
        instsUnpacked = new Vector(insts.size());
        for (Object inst1 : insts) {
            Map hWinst = (Map) inst1;
            WorkflowInstance inst = XmlRpcStructFactory.getWorkflowInstanceFromXmlRpc(hWinst);
            instsUnpacked.add(inst);
        }
        return instsUnpacked;
    } else {
        return null;
    }
}

18. TestVectorNull#test()

Project: pluotsorbet
Source File: TestVectorNull.java
View license
public void test(TestHarness th) {
    Vector a = new Vector();
    // Add a null element
    a.addElement(null);
    th.check(a.size(), 1);
    // Add a null value returned by a native
    a.addElement(nativeThatReturnsNull());
    th.check(a.size(), 2);
    // Add a null value from an array
    Object[] array = new Object[7];
    th.check(array[0], null);
    a.addElement(array[0]);
    th.check(a.size(), 3);
}

19. StyleMapEditor#parseStyleList()

Project: uima-uimaj
Source File: StyleMapEditor.java
View license
public ArrayList parseStyleList(String aStyleMapXml) {
    StyleMapXmlParser smxp = new StyleMapXmlParser(aStyleMapXml);
    // System.out.println(aStyleMapXml );
    Vector annotType_SME = smxp.annotType;
    Vector styleLabel_SME = smxp.styleLabel;
    Vector featureValue_SME = smxp.featureValue;
    Vector styleColor_SME = smxp.styleColor;
    ColorParser cp = new ColorParser();
    colorNameMap = cp.getColorNameMap();
    for (int i = 0; i < annotType_SME.size(); i++) {
        String typeName = ((String) annotType_SME.elementAt(i));
        String labelString = ((String) styleLabel_SME.elementAt(i));
        String featureValue = ((String) featureValue_SME.elementAt(i));
        String styleColor = styleColor_SME.elementAt(i).toString();
        StyleMapEntry e = cp.parseAndAssignColors(typeName, featureValue, labelString, styleColor);
        styleList.add(e);
    }
    return styleList;
}

20. TestArrayListConversions#testArrayConversion()

View license
public void testArrayConversion() throws Exception {
    Call call = new Call(new Service());
    call.setTransport(transport);
    Vector v = new Vector();
    v.addElement("Hi there!");
    v.addElement("This'll be a SOAP Array");
    call.setOperationName(new QName(SERVICE_NAME, "echoArray"));
    Object ret = call.invoke(new Object[] { v });
    if (!equals(v, ret))
        assertEquals("Echo Array mangled the result.  Result is underneath\n" + ret, v, ret);
}

21. TestDeser#testArray()

Project: axis1-java
Source File: TestDeser.java
View license
public void testArray() throws Exception {
    Vector v = new Vector();
    v.addElement("abc");
    v.addElement("def");
    deserialize(HEAD + "<result xsi:type=\"soapenc:Array\" " + "soapenc:itemType=\"xsd:string\" soapenc:arraySize=\"2\"> " + "<item xsi:type=\"xsd:string\">abc</item>" + "<item xsi:type=\"xsd:string\">def</item>" + "</result>" + TAIL, v, true);
}

22. MockDTLSServer#getCertificateRequest()

Project: bc-java
Source File: MockDTLSServer.java
View license
public CertificateRequest getCertificateRequest() throws IOException {
    short[] certificateTypes = new short[] { ClientCertificateType.rsa_sign, ClientCertificateType.dss_sign, ClientCertificateType.ecdsa_sign };
    Vector serverSigAlgs = null;
    if (TlsUtils.isSignatureAlgorithmsExtensionAllowed(serverVersion)) {
        serverSigAlgs = TlsUtils.getDefaultSupportedSignatureAlgorithms();
    }
    Vector certificateAuthorities = new Vector();
    certificateAuthorities.addElement(TlsTestUtils.loadCertificateResource("x509-ca.pem").getSubject());
    return new CertificateRequest(certificateTypes, serverSigAlgs, certificateAuthorities);
}

23. MockTlsServer#getCertificateRequest()

Project: bc-java
Source File: MockTlsServer.java
View license
public CertificateRequest getCertificateRequest() throws IOException {
    short[] certificateTypes = new short[] { ClientCertificateType.rsa_sign, ClientCertificateType.dss_sign, ClientCertificateType.ecdsa_sign };
    Vector serverSigAlgs = null;
    if (TlsUtils.isSignatureAlgorithmsExtensionAllowed(serverVersion)) {
        serverSigAlgs = TlsUtils.getDefaultSupportedSignatureAlgorithms();
    }
    Vector certificateAuthorities = new Vector();
    certificateAuthorities.addElement(TlsTestUtils.loadCertificateResource("x509-ca.pem").getSubject());
    return new CertificateRequest(certificateTypes, serverSigAlgs, certificateAuthorities);
}

24. TlsTestServerImpl#getCertificateRequest()

Project: bc-java
Source File: TlsTestServerImpl.java
View license
public CertificateRequest getCertificateRequest() throws IOException {
    if (config.serverCertReq == TlsTestConfig.SERVER_CERT_REQ_NONE) {
        return null;
    }
    short[] certificateTypes = new short[] { ClientCertificateType.rsa_sign, ClientCertificateType.dss_sign, ClientCertificateType.ecdsa_sign };
    Vector serverSigAlgs = null;
    if (TlsUtils.isSignatureAlgorithmsExtensionAllowed(serverVersion)) {
        serverSigAlgs = config.serverCertReqSigAlgs;
        if (serverSigAlgs == null) {
            serverSigAlgs = TlsUtils.getDefaultSupportedSignatureAlgorithms();
        }
    }
    Vector certificateAuthorities = new Vector();
    certificateAuthorities.addElement(TlsTestUtils.loadCertificateResource("x509-ca.pem").getSubject());
    return new CertificateRequest(certificateTypes, serverSigAlgs, certificateAuthorities);
}

25. StringUtilsTest#testGetCommaListFromVector()

Project: commons-bsf
Source File: StringUtilsTest.java
View license
public void testGetCommaListFromVector() {
    String result;
    Vector vector = new Vector();
    vector.add(new Character('a'));
    vector.add(new Character('b'));
    result = StringUtils.getCommaListFromVector(vector);
    assertTrue(result.equals(new String("a, b")));
    result = StringUtils.getCommaListFromVector(new Vector());
    assertTrue(result.equals(new String("")));
}

26. MixedModelTest#testIterateVector()

Project: commons-jxpath
Source File: MixedModelTest.java
View license
public void testIterateVector() {
    Map map = new HashMap();
    Vector vec = new Vector();
    vec.add(new HashMap());
    vec.add(new HashMap());
    map.put("vec", vec);
    JXPathContext context = JXPathContext.newContext(map);
    assertXPathPointerIterator(context, "/vec", list("/.[@name='vec'][1]", "/.[@name='vec'][2]"));
}

27. ZaurusEditor#resetTableForms()

Project: h-store
Source File: ZaurusEditor.java
View license
// reset  everything after changes in the database
private void resetTableForms() {
    lForm.show(pForm, "search");
    lButton.show(pButton, "search");
    Vector vAllTables = getAllTables();
    // fill the drop down list again
    // get all table names and show a drop down list of them in cTables
    cTables.removeAll();
    for (Enumeration e = vAllTables.elements(); e.hasMoreElements(); ) {
        cTables.addItem((String) e.nextElement());
    }
    // remove all form panels from pForm
    for (Enumeration e = vHoldForms.elements(); e.hasMoreElements(); ) {
        pForm.remove((ZaurusTableForm) e.nextElement());
    }
    // end of while (Enumeration e = vHoldForms.elements(); e.hasMoreElements();)
    // initialize a new list for the table names which have a form in pForm
    vHoldTableNames = new Vector(20);
    vHoldForms = new Vector(20);
}

28. GitAskPassXmlRpcClient#askUsername()

View license
// Obsolete collection usage because of the XmlRpcClientLite API
@SuppressWarnings({ "UseOfObsoleteCollectionType", "unchecked" })
String askUsername(String token, @NotNull String url) {
    Vector parameters = new Vector();
    parameters.add(token);
    parameters.add(url);
    try {
        return (String) myClient.execute(methodName("askUsername"), parameters);
    } catch (XmlRpcException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    } catch (IOException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    }
}

29. GitAskPassXmlRpcClient#askPassword()

View license
// Obsolete collection usage because of the XmlRpcClientLite API
@SuppressWarnings({ "UseOfObsoleteCollectionType", "unchecked" })
String askPassword(String token, @NotNull String url) {
    Vector parameters = new Vector();
    parameters.add(token);
    parameters.add(url);
    try {
        return (String) myClient.execute(methodName("askPassword"), parameters);
    } catch (XmlRpcException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    } catch (IOException e) {
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    }
}

30. GitSSHXmlRpcClient#getLastSuccessful()

View license
/**
   * [email protected]}
   */
@Override
@SuppressWarnings("unchecked")
public String getLastSuccessful(String token, String userName) {
    if (myClient == null) {
        return "";
    }
    Vector parameters = new Vector();
    parameters.add(token);
    parameters.add(userName);
    try {
        return (String) myClient.execute(methodName("getLastSuccessful"), parameters);
    } catch (XmlRpcException e) {
        log("getLastSuccessful failed. token: " + token + ", userName: " + userName + ", client: " + myClient.getURL());
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    } catch (IOException e) {
        log("getLastSuccessful failed. token: " + token + ", userName: " + userName + ", client: " + myClient.getURL());
        throw new RuntimeException("Invocation failed " + e.getMessage(), e);
    }
}

31. ArrayListTest#test_trimToSize()

Project: j2objc
Source File: ArrayListTest.java
View license
/**
     * @tests java.util.ArrayList#trimToSize()
     */
public void test_trimToSize() {
    // Test for method void java.util.ArrayList.trimToSize()
    for (int i = 99; i > 24; i--) alist.remove(i);
    ((ArrayList) alist).trimToSize();
    assertEquals("Returned incorrect size after trim", 25, alist.size());
    for (int i = 0; i < alist.size(); i++) assertTrue("Trimmed list contained incorrect elements", alist.get(i) == objArray[i]);
    Vector v = new Vector();
    v.add("a");
    v.add("b");
    ArrayList al = new ArrayList(v);
    al.remove("a");
    Iterator it = al.iterator();
    al.trimToSize();
    try {
        it.next();
        fail("should throw a ConcurrentModificationException");
    } catch (ConcurrentModificationException ioobe) {
    }
}

32. VectorTest#test_Constructor()

Project: j2objc
Source File: VectorTest.java
View license
/**
	 * @tests java.util.Vector#Vector()
	 */
public void test_Constructor() {
    // Test for method java.util.Vector()
    Vector tv = new Vector(100);
    for (int i = 0; i < 100; i++) tv.addElement(new Integer(i));
    new Support_ListTest("", tv).runTest();
    tv = new Vector(200);
    for (int i = -50; i < 150; i++) tv.addElement(new Integer(i));
    new Support_ListTest("", tv.subList(50, 150)).runTest();
    Vector v = new Vector();
    assertEquals("Vector creation failed", 0, v.size());
    assertEquals("Wrong capacity", 10, v.capacity());
}

33. VectorTest#test_removeElementLjava_lang_Object()

Project: j2objc
Source File: VectorTest.java
View license
/**
	 * @tests java.util.Vector#removeElement(java.lang.Object)
	 */
public void test_removeElementLjava_lang_Object() {
    // Test for method boolean
    // java.util.Vector.removeElement(java.lang.Object)
    Vector v = vectorClone(tVector);
    v.removeElement("Test 98");
    assertEquals("Element not removed", "Test 99", ((String) v.elementAt(98)));
    assertTrue("Vector is wrong size after removal: " + v.size(), v.size() == 99);
    tVector.addElement(null);
    v.removeElement(null);
    assertTrue("Vector is wrong size after removing null: " + v.size(), v.size() == 99);
}

34. XPointerFactory#select()

Project: lenya
Source File: XPointerFactory.java
View license
/**
     * Select nodes by xpointer
     *
     * @param node Document Node
     * @param reference xmls(...)xpointer(...)
     *
     * @return nodes
     *
     * @exception Exception ...
     */
public Vector select(Node node, String reference) throws Exception {
    Vector xpaths = new Vector();
    Vector namespaces = new Vector();
    parse(reference, xpaths, namespaces);
    Vector nodes = new Vector();
    for (int i = 0; i < xpaths.size(); i++) {
        Vector n = xpointer.select(node, (String) xpaths.elementAt(i), namespaces);
        for (int j = 0; j < n.size(); j++) {
            nodes.addElement(n.elementAt(j));
        }
    }
    return nodes;
}

35. CoreConfidenceTests#testNestedMethod1()

Project: mvel
Source File: CoreConfidenceTests.java
View license
public void testNestedMethod1() {
    Vector vectorA = new Vector();
    Vector vectorB = new Vector();
    vectorA.add("Foo244");
    Map map = new HashMap();
    map.put("vecA", vectorA);
    map.put("vecB", vectorB);
    testCompiledSimple("vecB.add(vecA.remove(0)); vecA.add('Foo244');", null, map);
    assertEquals("Foo244", vectorB.get(0));
}

36. TestAbstractLdLinker#testAddLibrarySetDirSwitch()

View license
public void testAddLibrarySetDirSwitch() {
    final AbstractLdLinker linker = getLinker();
    final CCTask task = new CCTask();
    final LibrarySet[] sets = new LibrarySet[] { new LibrarySet() };
    /* throws an Exception in setLibs otherwise */
    sets[0].setProject(new org.apache.tools.ant.Project());
    sets[0].setDir(new File("/foo"));
    sets[0].setLibs(new CUtil.StringArrayBuilder("bart,cart,dart"));
    final Vector preargs = new Vector();
    final Vector midargs = new Vector();
    final Vector endargs = new Vector();
    final String[] rc = linker.addLibrarySets(task, sets, preargs, midargs, endargs);
    final String libdirSwitch = (String) endargs.elementAt(0);
    assertEquals(libdirSwitch.substring(0, 2), "-L");
    //
    // can't have space after -L or will break Mac OS X
    //
    assertTrue(!libdirSwitch.substring(2, 3).equals(" "));
    assertEquals(libdirSwitch.substring(libdirSwitch.length() - 3), "foo");
}

37. TestAbstractLdLinker#testAddLibrarySetLibSwitch()

View license
public void testAddLibrarySetLibSwitch() {
    final AbstractLdLinker linker = getLinker();
    final CCTask task = new CCTask();
    final LibrarySet[] sets = new LibrarySet[] { new LibrarySet() };
    /* throws an Exception in setLibs otherwise */
    sets[0].setProject(new org.apache.tools.ant.Project());
    sets[0].setDir(new File("/foo"));
    sets[0].setLibs(new CUtil.StringArrayBuilder("bart,cart,dart"));
    final Vector preargs = new Vector();
    final Vector midargs = new Vector();
    final Vector endargs = new Vector();
    final String[] rc = linker.addLibrarySets(task, sets, preargs, midargs, endargs);
    assertEquals("-lbart", (String) endargs.elementAt(1));
    assertEquals("-lcart", (String) endargs.elementAt(2));
    assertEquals("-ldart", (String) endargs.elementAt(3));
    assertEquals(endargs.size(), 4);
}

38. TestAbstractLdLinker#testLibReturnValue()

View license
public void testLibReturnValue() {
    final AbstractLdLinker linker = getLinker();
    final CCTask task = new CCTask();
    final LibrarySet[] sets = new LibrarySet[] { new LibrarySet() };
    /* throws an Exception in setLibs otherwise */
    sets[0].setProject(new org.apache.tools.ant.Project());
    sets[0].setDir(new File("/foo"));
    sets[0].setLibs(new CUtil.StringArrayBuilder("bart,cart,dart"));
    final Vector preargs = new Vector();
    final Vector midargs = new Vector();
    final Vector endargs = new Vector();
    final String[] rc = linker.addLibrarySets(task, sets, preargs, midargs, endargs);
    assertEquals(3, rc.length);
    assertEquals("bart", rc[0]);
    assertEquals("cart", rc[1]);
    assertEquals("dart", rc[2]);
}

39. XmlRpcBatchMgrProxy#run()

Project: oodt
Source File: XmlRpcBatchMgrProxy.java
View license
public void run() {
    client = new XmlRpcClient(remoteHost.getIpAddr());
    Vector argList = new Vector();
    argList.add(XmlRpcStructFactory.getXmlRpcJob(jobSpec.getJob()));
    argList.add(jobSpec.getIn().write());
    boolean result;
    try {
        parent.jobExecuting(jobSpec);
        result = (Boolean) client.execute("batchstub.executeJob", argList);
        if (result) {
            parent.jobSuccess(jobSpec);
        } else {
            throw new Exception("batchstub.executeJob returned false");
        }
    } catch (Exception e) {
        LOG.log(Level.SEVERE, "Job execution failed for jobId '" + jobSpec.getJob().getId() + "' : " + e.getMessage(), e);
        parent.jobFailure(jobSpec);
    } finally {
        parent.notifyMonitor(remoteHost, jobSpec);
    }
}

40. XmlRpcResourceManagerClient#submitJob()

View license
public String submitJob(Job exec, JobInput in) throws JobExecutionException {
    Vector argList = new Vector();
    argList.add(XmlRpcStructFactory.getXmlRpcJob(exec));
    argList.add(in.write());
    LOG.log(Level.FINEST, argList.toString());
    String jobId;
    try {
        jobId = (String) client.execute("resourcemgr.handleJob", argList);
    } catch (XmlRpcException e) {
        throw new JobExecutionException(e.getMessage(), e);
    } catch (IOException e) {
        throw new JobExecutionException(e.getMessage(), e);
    }
    return jobId;
}

41. XmlRpcWorkflowManagerClient#executeDynamicWorkflow()

View license
public String executeDynamicWorkflow(List<String> taskIds, Metadata metadata) throws XmlRpcException, IOException {
    Vector argList = new Vector();
    Vector<String> taskIdVector = new Vector<String>();
    taskIdVector.addAll(taskIds);
    String instId;
    argList.add(taskIdVector);
    argList.add(metadata.getHashTable());
    instId = (String) client.execute("workflowmgr.executeDynamicWorkflow", argList);
    return instId;
}

42. XmlRpcWorkflowManagerClient#paginateWorkflowInstances()

View license
public WorkflowInstancePage paginateWorkflowInstances(int pageNum, String status) throws XmlRpcException, IOException {
    Vector argList = new Vector();
    argList.add(pageNum);
    argList.add(status);
    Map pageHash;
    pageHash = (Map) client.execute("workflowmgr.paginateWorkflowInstances", argList);
    return XmlRpcStructFactory.getWorkflowInstancePageFromXmlRpc(pageHash);
}

43. XmlRpcWorkflowManagerClient#getWorkflowsByEvent()

View license
public List getWorkflowsByEvent(String eventName) throws XmlRpcException, IOException, RepositoryException {
    List workflows = new Vector();
    Vector workflowVector;
    Vector argList = new Vector();
    argList.add(eventName);
    workflowVector = (Vector) client.execute("workflowmgr.getWorkflowsByEvent", argList);
    if (workflowVector != null) {
        for (Object aWorkflowVector : workflowVector) {
            Map workflowHash = (Map) aWorkflowVector;
            Workflow w = XmlRpcStructFactory.getWorkflowFromXmlRpc(workflowHash);
            workflows.add(w);
        }
    }
    return workflows;
}

44. XmlRpcWorkflowManagerClient#setWorkflowInstanceCurrentTaskStartDateTime()

View license
public synchronized boolean setWorkflowInstanceCurrentTaskStartDateTime(String wInstId, String startDateTimeIsoStr) throws XmlRpcException, IOException {
    Vector argList = new Vector();
    argList.add(wInstId);
    argList.add(startDateTimeIsoStr);
    return (Boolean) client.execute("workflowmgr.setWorkflowInstanceCurrentTaskStartDateTime", argList);
}

45. XmlRpcWorkflowManagerClient#setWorkflowInstanceCurrentTaskEndDateTime()

View license
public synchronized boolean setWorkflowInstanceCurrentTaskEndDateTime(String wInstId, String endDateTimeIsoStr) throws XmlRpcException, IOException {
    Vector argList = new Vector();
    argList.add(wInstId);
    argList.add(endDateTimeIsoStr);
    return (Boolean) client.execute("workflowmgr.setWorkflowInstanceCurrentTaskEndDateTime", argList);
}

46. XmlRpcWorkflowManagerClient#getWorkflows()

View license
public List getWorkflows() throws XmlRpcException, IOException, RepositoryException {
    Vector argList = new Vector();
    Vector works;
    Vector workflows;
    works = (Vector) client.execute("workflowmgr.getWorkflows", argList);
    if (works != null) {
        workflows = new Vector(works.size());
        for (Object work : works) {
            Map workflw = (Map) work;
            Workflow w = XmlRpcStructFactory.getWorkflowFromXmlRpc(workflw);
            workflows.add(w);
        }
        return workflows;
    } else {
        return null;
    }
}

47. XmlRpcWorkflowManagerClient#getWorkflowInstances()

View license
public List getWorkflowInstances() throws XmlRpcException, IOException {
    Vector argList = new Vector();
    Vector insts;
    Vector instsUnpacked;
    insts = (Vector) client.execute("workflowmgr.getWorkflowInstances", argList);
    if (insts != null) {
        instsUnpacked = new Vector(insts.size());
        for (Object inst1 : insts) {
            Map hWinst = (Map) inst1;
            WorkflowInstance inst = XmlRpcStructFactory.getWorkflowInstanceFromXmlRpc(hWinst);
            instsUnpacked.add(inst);
        }
        return instsUnpacked;
    } else {
        return null;
    }
}

48. RemoteType#initialize()

Project: openjdk
Source File: RemoteType.java
View license
/**
     * Initialize this instance.
     */
private boolean initialize(boolean quiet, ContextStack stack) {
    boolean result = false;
    // Go check it out and gather up the info we need...
    Vector directInterfaces = new Vector();
    Vector directMethods = new Vector();
    Vector directConstants = new Vector();
    if (isConformingRemoteInterface(directInterfaces, directMethods, directConstants, quiet, stack)) {
        // We're ok, so pass 'em up...
        result = initialize(directInterfaces, directMethods, directConstants, stack, quiet);
    }
    return result;
}

49. Parser_Topas#splitLine()

Project: pGraph
Source File: Parser_Topas.java
View license
/*
	 * Input line is a set of tokens delimited by '/' character and finally '=' character.
	 * Create a Vector containing the ordered set of String tokens.
	 */
@SuppressWarnings("unchecked")
private Vector splitLine(String s) {
    Vector result = new Vector();
    // first token's char 
    int begin = 0;
    // last token's char
    int end;
    // Get all tokens that end with '/'
    while ((end = s.indexOf('/', begin)) >= 0) {
        result.add(s.substring(begin, end));
        begin = end + 1;
    }
    // Manage variable name and value
    end = s.indexOf('=', begin);
    if (end < 0 || end == begin)
        // invalid line: it has no value or no label
        return null;
    result.add(s.substring(begin, end));
    result.add(new Float(s.substring(end + 1)));
    return result;
}

50. ToDoListImpl#items()

Project: pluotsorbet
Source File: ToDoListImpl.java
View license
/**
     * Gets an Enumeration of the items in the list.
     * @param field identifier of field
     * @param startDate beginning of range
     * @param endDate end of range
     * @return Enumeration of matching events
     */
public Enumeration items(int field, long startDate, long endDate) throws PIMException {
    if (getFieldDataType(field) != PIMItem.DATE) {
        throw new IllegalArgumentException("Not a DATE field");
    }
    if (endDate < startDate) {
        throw new IllegalArgumentException("Start date" + " must precede end date");
    }
    Vector results = new Vector();
    Vector keys = new Vector();
    for (Enumeration e = items(); e.hasMoreElements(); ) {
        ToDo item = (ToDo) e.nextElement();
        int indices = item.countValues(field);
        for (int i = 0; i < indices; i++) {
            long date = item.getDate(field, i);
            if (date >= startDate && date <= endDate) {
                // include result
                KeySortUtility.store(keys, results, date, item);
                break;
            }
        }
    }
    return results.elements();
}

51. ZaurusEditor#resetTableForms()

Project: voltdb
Source File: ZaurusEditor.java
View license
// reset  everything after changes in the database
private void resetTableForms() {
    lForm.show(pForm, "search");
    lButton.show(pButton, "search");
    Vector vAllTables = getAllTables();
    // fill the drop down list again
    // get all table names and show a drop down list of them in cTables
    cTables.removeAll();
    for (Enumeration e = vAllTables.elements(); e.hasMoreElements(); ) {
        cTables.addItem((String) e.nextElement());
    }
    // remove all form panels from pForm
    for (Enumeration e = vHoldForms.elements(); e.hasMoreElements(); ) {
        pForm.remove((ZaurusTableForm) e.nextElement());
    }
    // end of while (Enumeration e = vHoldForms.elements(); e.hasMoreElements();)
    // initialize a new list for the table names which have a form in pForm
    vHoldTableNames = new Vector(20);
    vHoldForms = new Vector(20);
}

52. JavaTypeWriter#getBeanWriter()

Project: axis1-java
Source File: JavaTypeWriter.java
View license
/**
     * getBeanWriter
     * 
     * @param emitter    
     * @param type       
     * @param base       
     * @return 
     */
protected JavaWriter getBeanWriter(Emitter emitter, TypeEntry type, TypeEntry base) {
    // CONTAINED_ELEM_AND_ATTR
    Vector elements = type.getContainedElements();
    Vector attributes = type.getContainedAttributes();
    // class
    if (Utils.isFaultComplex(type)) {
        return new JavaBeanFaultWriter(emitter, type, elements, base, attributes, getBeanHelperWriter(emitter, type, elements, base, attributes, true));
    }
    return new JavaBeanWriter(emitter, type, elements, base, attributes, getBeanHelperWriter(emitter, type, elements, base, attributes, false));
}

53. WSDDElement#getChildElements()

Project: axis1-java
Source File: WSDDElement.java
View license
public Element[] getChildElements(Element e, String name) {
    NodeList nl = e.getChildNodes();
    Vector els = new Vector();
    for (int i = 0; i < nl.getLength(); i++) {
        Node thisNode = nl.item(i);
        if (!(thisNode instanceof Element))
            continue;
        Element el = (Element) thisNode;
        if (el.getLocalName().equals(name)) {
            els.add(el);
        }
    }
    Element[] elements = new Element[els.size()];
    els.toArray(elements);
    return elements;
}

54. VectorDeserializer#setChildValue()

Project: axis1-java
Source File: VectorDeserializer.java
View license
/**
     * The registerValueTarget code above causes this set function to be invoked when
     * each value is known.
     * @param value is the value of an element
     * @param hint is an Integer containing the index
     */
public void setChildValue(Object value, Object hint) throws SAXException {
    if (log.isDebugEnabled()) {
        log.debug(Messages.getMessage("gotValue00", "VectorDeserializer", "" + value));
    }
    int offset = ((Integer) hint).intValue();
    Vector v = (Vector) this.value;
    // If the vector is too small, grow it 
    if (offset >= v.size()) {
        v.setSize(offset + 1);
    }
    v.setElementAt(value, offset);
}

55. MessageElement#getVisibleNamespacePrefixes()

Project: axis1-java
Source File: MessageElement.java
View license
/**
     * get an iterator over visible prefixes. This includes all declared in
     * parent elements
     * @return an iterator.
     */
public Iterator getVisibleNamespacePrefixes() {
    Vector prefixes = new Vector();
    // Add all parents namespace definitions
    if (parent != null) {
        Iterator parentsPrefixes = ((MessageElement) parent).getVisibleNamespacePrefixes();
        if (parentsPrefixes != null) {
            while (parentsPrefixes.hasNext()) {
                prefixes.add(parentsPrefixes.next());
            }
        }
    }
    Iterator mine = getNamespacePrefixes();
    if (mine != null) {
        while (mine.hasNext()) {
            prefixes.add(mine.next());
        }
    }
    return prefixes.iterator();
}

56. MessageElement#getAllAttributes()

Project: axis1-java
Source File: MessageElement.java
View license
/**
     * Get an interator to all the attributes of the node.
     * The iterator is over a static snapshot of the node names; if attributes
     * are added or deleted during the iteration, this iterator will be not
     * be updated to follow the changes.
     * @return an iterator of the attributes.
     * @see javax.xml.soap.SOAPElement#getAllAttributes()
     */
public Iterator getAllAttributes() {
    int num = attributes.getLength();
    Vector attrs = new Vector(num);
    for (int i = 0; i < num; i++) {
        String q = attributes.getQName(i);
        String prefix = "";
        if (q != null) {
            int idx = q.indexOf(":");
            if (idx > 0) {
                prefix = q.substring(0, idx);
            } else {
                prefix = "";
            }
        }
        attrs.add(new PrefixedQName(attributes.getURI(i), attributes.getLocalName(i), prefix));
    }
    return attrs.iterator();
}

57. MessageElement#getChildElements()

Project: axis1-java
Source File: MessageElement.java
View license
/**
     * get an iterator over child elements
     * @param qname namespace/element name of parts to find.
     * This iterator is not (currently) susceptible to change in the element
     * list during its lifetime, though changes in the contents of the elements
     * are picked up.
     * @return an iterator.
     */
public Iterator getChildElements(QName qname) {
    initializeChildren();
    int num = children.size();
    Vector c = new Vector(num);
    for (int i = 0; i < num; i++) {
        MessageElement child = (MessageElement) children.get(i);
        Name cname = child.getElementName();
        if (cname.getURI().equals(qname.getNamespaceURI()) && cname.getLocalName().equals(qname.getLocalPart())) {
            c.add(child);
        }
    }
    return c.iterator();
}

58. SOAPHeader#examineMustUnderstandHeaderElements()

Project: axis1-java
Source File: SOAPHeader.java
View license
public Iterator examineMustUnderstandHeaderElements(String actor) {
    if (actor == null)
        return null;
    Vector result = new Vector();
    List headers = getChildren();
    if (headers != null) {
        for (int i = 0; i < headers.size(); i++) {
            SOAPHeaderElement she = (SOAPHeaderElement) headers.get(i);
            if (she.getMustUnderstand()) {
                String candidate = she.getActor();
                if (actor.equals(candidate)) {
                    result.add(headers.get(i));
                }
            }
        }
    }
    return result.iterator();
}

59. TestRoundTrip#checkRoundTrip()

Project: axis1-java
Source File: TestRoundTrip.java
View license
protected void checkRoundTrip(String xml1) throws Exception {
    Message message = new Message(xml1);
    message.setMessageContext(new MessageContext(server));
    SOAPEnvelope envelope = (SOAPEnvelope) message.getSOAPEnvelope();
    RPCElement body = (RPCElement) envelope.getFirstBody();
    Vector arglist = body.getParams();
    Object ret1 = ((RPCParam) arglist.get(0)).getObjectValue();
    String xml2 = message.getSOAPPartAsString();
    Message message2 = new Message(xml2);
    message2.setMessageContext(new MessageContext(server));
    SOAPEnvelope envelope2 = (SOAPEnvelope) message2.getSOAPEnvelope();
    RPCElement body2 = (RPCElement) envelope2.getFirstBody();
    Vector arglist2 = body2.getParams();
    Object ret2 = ((RPCParam) arglist2.get(0)).getObjectValue();
    if (!equals(ret1, ret2)) {
        assertEquals("The result is not what is expected.", ret1, ret2);
    }
}

60. CPWSImplServiceTestCase#testCPWebServicesWSDL()

View license
/** Test case for Bug 25161
	  	Axis 1.2 alpha WSDL xsd types problem prevent .Net integration */
public void testCPWebServicesWSDL() throws Exception {
    URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.xsd.CPWSImplServiceLocator().getCPWebServicesAddress());
    Parser wsdlParser = new Parser();
    System.out.println("Reading WSDL document from '" + url + "?WSDL'");
    wsdlParser.run(url + "?WSDL");
    SymbolTable symbolTable = wsdlParser.getSymbolTable();
    Vector v = symbolTable.getSymbols(new QName("http://datatypes.cs.amdocs.com", "CSText"));
    DefinedType type = (DefinedType) v.get(0);
    assertNotNull(type);
    Vector v2 = SchemaUtils.getContainedElementDeclarations(type.getNode(), symbolTable);
    ElementDecl element = (ElementDecl) v2.get(0);
    assertNotNull(element);
    assertEquals(Constants.XSD_STRING, element.getType().getQName());
}

61. CodeGenerationUtility#convertToSchemaArray()

View license
/**
     * Converts a given vector of schemaDocuments to XmlBeans processable schema objects. One
     * drawback we have here is the non-inclusion of untargeted namespaces
     *
     * @param vec
     * @return schema array
     */
private static SchemaDocument.Schema[] convertToSchemaArray(List vec) {
    SchemaDocument[] schemaDocuments = (SchemaDocument[]) vec.toArray(new SchemaDocument[vec.size()]);
    //remove duplicates
    Vector uniqueSchemas = new Vector(schemaDocuments.length);
    Vector uniqueSchemaTns = new Vector(schemaDocuments.length);
    SchemaDocument.Schema s;
    for (int i = 0; i < schemaDocuments.length; i++) {
        s = schemaDocuments[i].getSchema();
        if (!uniqueSchemaTns.contains(s.getTargetNamespace())) {
            uniqueSchemas.add(s);
            uniqueSchemaTns.add(s.getTargetNamespace());
        } else if (s.getTargetNamespace() == null) {
            uniqueSchemas.add(s);
        }
    }
    return (SchemaDocument.Schema[]) uniqueSchemas.toArray(new SchemaDocument.Schema[uniqueSchemas.size()]);
}

62. ECNamedCurveTable#getNames()

Project: bc-java
Source File: ECNamedCurveTable.java
View license
/**
     * return an enumeration of the names of the available curves.
     *
     * @return an enumeration of the names of the available curves.
     */
public static Enumeration getNames() {
    Vector v = new Vector();
    addEnumeration(v, X962NamedCurves.getNames());
    addEnumeration(v, SECNamedCurves.getNames());
    addEnumeration(v, NISTNamedCurves.getNames());
    addEnumeration(v, TeleTrusTNamedCurves.getNames());
    addEnumeration(v, ANSSINamedCurves.getNames());
    return v.elements();
}

63. X509NameTest#createEntryValue()

Project: bc-java
Source File: X509NameTest.java
View license
private ASN1Encodable createEntryValue(ASN1ObjectIdentifier oid, String value) {
    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);
}

64. X509NameTest#createEntryValueFromString()

Project: bc-java
Source File: X509NameTest.java
View license
private ASN1Encodable createEntryValueFromString(ASN1ObjectIdentifier oid, String value) {
    Hashtable attrs = new Hashtable();
    attrs.put(oid, value);
    Vector order = new Vector();
    order.addElement(oid);
    X509Name name = new X509Name(new X509Name(order, attrs).toString());
    ASN1Sequence seq = (ASN1Sequence) name.toASN1Primitive();
    ASN1Set set = (ASN1Set) seq.getObjectAt(0);
    seq = (ASN1Sequence) set.getObjectAt(0);
    return seq.getObjectAt(1);
}

65. NetCDFServiceImpl#setFile()

Project: bioformats
Source File: NetCDFServiceImpl.java
View license
/* (non-Javadoc)
   * @see loci.formats.NetCDFService#setFile(java.lang.String)
   */
@Override
public void setFile(String file) throws IOException {
    this.currentFile = file;
    init();
    attributeList = new Vector<String>();
    variableList = new Vector<String>();
    List<Group> groups = new ArrayList<Group>();
    groups.add(root);
    parseAttributesAndVariables(groups);
}

66. FullCycleDBTest#getRelevantEventsFromVA()

Project: chainsaw
Source File: FullCycleDBTest.java
View license
Vector getRelevantEventsFromVA(VectorAppender va, long startTime) {
    assertNotNull(va);
    Vector v = va.getVector();
    Vector r = new Vector();
    // remove all elements older than startTime
    for (Iterator i = v.iterator(); i.hasNext(); ) {
        LoggingEvent event = (LoggingEvent) i.next();
        if (startTime > event.getTimeStamp()) {
            System.out.println("***Removing event with timestamp " + event.getTimeStamp());
        } else {
            System.out.println("***Keeping event with timestamo" + event.getTimeStamp());
            r.add(event);
        }
    }
    return r;
}

67. WebDAVSource#getSourceProperty()

Project: cocoon
Source File: WebDAVSource.java
View license
/**
     * Returns a property from a source.
     *
     * @param namespace Namespace of the property
     * @param name Name of the property
     *
     * @return Property of the source.
     *
     * @throws SourceException If an exception occurs.
     */
public SourceProperty getSourceProperty(String namespace, String name) throws SourceException {
    initResource(WebdavResource.NOACTION, DepthSupport.DEPTH_0);
    Vector propNames = new Vector(1);
    propNames.add(new PropertyName(namespace, name));
    Enumeration props = null;
    org.apache.webdav.lib.Property prop = null;
    try {
        Enumeration responses = this.resource.propfindMethod(0, propNames);
        while (responses.hasMoreElements()) {
            ResponseEntity response = (ResponseEntity) responses.nextElement();
            props = response.getProperties();
            if (props.hasMoreElements()) {
                prop = (Property) props.nextElement();
                return new SourceProperty(prop.getElement());
            }
        }
    } catch (Exception e) {
        throw new SourceException("Error getting property: " + name, e);
    }
    return null;
}

68. WebDAVUtil#getProperty()

Project: cocoon
Source File: WebDAVUtil.java
View license
/**
     * get a property 
     * 
     * @param uri  the URI to get the property from
     * @param name  the name of the property
     * @param namespace  the namespace of the property
     * @throws HttpException
     * @throws IOException
     */
public static SourceProperty getProperty(String uri, String name, String namespace) throws HttpException, IOException {
    Vector propNames = new Vector(1);
    propNames.add(new PropertyName(namespace, name));
    Enumeration props = null;
    Property prop = null;
    WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
    Enumeration responses = resource.propfindMethod(0, propNames);
    while (responses.hasMoreElements()) {
        ResponseEntity response = (ResponseEntity) responses.nextElement();
        props = response.getProperties();
        if (props.hasMoreElements()) {
            prop = (Property) props.nextElement();
            return new SourceProperty(prop.getElement());
        }
    }
    return null;
}

69. MultipartParser#parseInlinePart()

Project: cocoon
Source File: MultipartParser.java
View license
/**
     * Parse an inline part
     *
     * @param in
     * @param headers
     *
     * @throws IOException
     */
private void parseInlinePart(TokenStream in, Hashtable headers) throws IOException {
    // Buffer incoming bytes for proper string decoding (there can be multibyte chars)
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    while (in.getState() == TokenStream.STATE_READING) {
        int c = in.read();
        if (c != -1)
            bos.write(c);
    }
    String field = (String) headers.get("name");
    Vector v = (Vector) this.parts.get(field);
    if (v == null) {
        v = new Vector();
        this.parts.put(field, v);
    }
    v.add(new String(bos.toByteArray(), this.characterEncoding));
}

70. CacheMap#getKeysInCache()

Project: CodenameOne
Source File: CacheMap.java
View license
/**
     * Returns the keys for all the objects currently in cache, this is useful
     * to traverse all the objects and refresh them without actually deleting
     * the cache and fetching them from scratch.<br>
     * <b>Important</b> this vector is a copy of a current state, keys might 
     * not exist anymore or might change, others might be added in the interim.
     * 
     * @return a vector containing a snapshot of the current elements within the 
     * cache.
     */
public Vector getKeysInCache() {
    Vector r = new Vector();
    Enumeration en = memoryCache.keys();
    while (en.hasMoreElements()) {
        r.addElement(en.nextElement());
    }
    Vector storageCacheContent = getStorageCacheContent();
    for (int iter = 0; iter < storageCacheContent.size(); iter++) {
        Object[] o = (Object[]) storageCacheContent.elementAt(iter);
        if (!r.contains(o[1])) {
            r.addElement(o[1]);
        }
    }
    return r;
}

71. Util#split()

Project: CodenameOne
Source File: Util.java
View license
/**
     * Provides a utility method breaks a given String to array of String according 
     * to the given separator
     * @param original the String to break
     * @param separator the pattern to look in the original String
     * @return array of Strings from the original String
     */
public static String[] split(String original, String separator) {
    Vector nodes = new Vector();
    int index = original.indexOf(separator);
    while (index >= 0) {
        nodes.addElement(original.substring(0, index));
        original = original.substring(index + separator.length());
        index = original.indexOf(separator);
    }
    nodes.addElement(original);
    String[] ret = new String[nodes.size()];
    for (int i = 0; i < nodes.size(); i++) {
        ret[i] = (String) nodes.elementAt(i);
    }
    return ret;
}

72. CSSEngine#setWrapText()

Project: CodenameOne
Source File: CSSEngine.java
View license
/**
     * Replaces an unwrapped text with a wrapped version, while copying the style of the original text.
     * 
     * @param label The current label that contains the unwrapped text
     * @param words A vector containing one word of the text (without white spaces) in each element
     * @param element The text element
     */
private void setWrapText(Label label, Vector words, HTMLElement element, HTMLComponent htmlC) {
    Style selectedStyle = label.getSelectedStyle();
    Style unselectedStyle = label.getUnselectedStyle();
    Vector ui = new Vector();
    label.setText((String) words.elementAt(0) + ' ');
    HTMLLink link = null;
    if (label instanceof HTMLLink) {
        link = (HTMLLink) label;
    }
    ui.addElement(label);
    for (int i = 1; i < words.size(); i++) {
        Label word = null;
        if (link != null) {
            word = new HTMLLink((String) words.elementAt(i) + ' ', link.link, htmlC, link, link.linkVisited);
        } else {
            word = new Label((String) words.elementAt(i) + ' ');
        }
        word.setSelectedStyle(selectedStyle);
        word.setUnselectedStyle(unselectedStyle);
        label.getParent().addComponent(word);
        ui.addElement(word);
    }
    element.setAssociatedComponents(ui);
    label.getParent().revalidate();
}

73. UIBuilder#get()

Project: CodenameOne
Source File: UIBuilder.java
View license
public Form get(Object... args) {
    String n = parent.getPreviousFormName(f);
    final Form f = parent.createForm((Form) parent.createContainer(parent.fetchResourceFile(), n));
    ;
    if (h != null) {
        parent.setFormState(f, h);
        parent.setBackCommand(f, backCommand);
    }
    f.addShowListener(new ActionListener() {

        public void actionPerformed(ActionEvent evt) {
            parent.postShow(f);
        }
    });
    Vector formNavigationStack = parent.baseFormNavigationStack;
    formNavigationStack.remove(formNavigationStack.size() - 1);
    parent.beforeShow(f);
    return f;
}

74. TorrentLog#execute()

View license
public void execute(String commandName, ConsoleInput ci, List<String> args) {
    mode = MODE_ON;
    Vector newargs = new Vector(args);
    if (newargs.isEmpty()) {
        mode = MODE_FLIP;
    } else if (newargs.contains("off")) {
        newargs.removeElement("off");
        mode = MODE_OFF;
    } else if (!newargs.contains("on")) {
        mode = MODE_FLIP;
    }
    super.execute(commandName, ci, args);
}

75. CmdLineParser#addValue()

View license
private void addValue(Option opt, Object value) {
    String lf = opt.longForm();
    Vector v = (Vector) values.get(lf);
    if (v == null) {
        v = new Vector();
        values.put(lf, v);
    }
    v.addElement(value);
}

76. EnumerationDeserializer#readList()

Project: dubbo
Source File: EnumerationDeserializer.java
View license
public Object readList(AbstractHessianInput in, int length) throws IOException {
    Vector list = new Vector();
    in.addRef(list);
    while (!in.isEnd()) list.add(in.readObject());
    in.readEnd();
    return list.elements();
}

77. Gray8ConnComp#getComponentPixels()

Project: gast-lib
Source File: Gray8ConnComp.java
View license
public Enumeration getComponentPixels(int n) throws Error {
    Rect r = getComponent(n);
    // build a Vector of all points in the component
    Vector vPoints = new Vector();
    short[] sData = this.imLabeled.getData();
    int nLabel = this.rSortedLabels[n].nLabel;
    for (int i = r.getTop(); i <= r.getBottom(); i++) {
        for (int j = r.getLeft(); j <= r.getRight(); j++) {
            if (sData[i * this.imLabeled.getWidth() + j] == nLabel) {
                vPoints.addElement(new Point(j, i));
            }
        }
    }
    return vPoints.elements();
}

78. ValidatePackSelections#addSpace()

View license
/*--------------------------------------------------------------------------*/
/**
     * Adds a dummy field to the list of UI elements to act as spacer.
     * 
     * @param spec a <code>XMLElement</code> containing other specifications. At present this
     * information is not used but might be in future versions.
     */
/*--------------------------------------------------------------------------*/
protected void addSpace(XMLElement spec) {
    Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS);
    Vector forOs = spec.getChildrenNamed(OS);
    JPanel panel = new JPanel();
    TwoColumnConstraints constraints = new TwoColumnConstraints();
    constraints.position = TwoColumnConstraints.BOTH;
    constraints.stretch = true;
    uiElements.add(new Object[] { null, null, SPACE_FIELD, null, constraints, panel, forPacks, forOs });
}

79. JavaTestFilter#filter()

Project: gocd
Source File: JavaTestFilter.java
View license
public String[] filter(String[] names) throws Throwable {
    Vector testCases = new Vector();
    for (int i = names.length; i-- > 0; ) {
        try {
            Class cls = _loader.loadClass(names[i]);
            if (isTest(cls)) {
                testCases.add(names[i]);
            }
        } catch (Throwable e) {
            System.err.println("JavaTestFilter: Unable to load class " + names[i] + " to determine testing ability");
            throw e;
        }
    }
    String[] result = new String[testCases.size()];
    testCases.toArray(result);
    return result;
}

80. XMLUtilities#getSimplesFromCollection()

View license
/**
	 *
	 * @param name
	 *            the name of the collection to extract the simples from.
	 * @param element
	 *            the Element to extract from
	 * @return an array of Elements objects that represent the simples
	 * @throws MobyException
	 */
public static Element[] getSimplesFromCollection(String name, Element element) throws MobyException {
    Element e = (Element) element.clone();
    // exception thrown if not found
    Element collection = getCollection(name, e);
    List list = collection.getChildren("Simple");
    if (list.isEmpty())
        list = collection.getChildren("Simple", MOBY_NS);
    if (list.isEmpty())
        return new Element[] {};
    Vector vector = new Vector();
    for (Iterator it = list.iterator(); it.hasNext(); ) {
        Object o = it.next();
        if (o instanceof Element) {
            ((Element) o).setAttribute("articleName", name, MOBY_NS);
            if (((Element) o).getChildren().size() > 0)
                vector.add(o);
        }
    }
    Element[] elements = new Element[vector.size()];
    vector.copyInto(elements);
    return elements;
}

81. XMLUtilities#getSimplesFromCollection()

View license
/**
	 *
	 * @param name
	 *            the name of the collection to extract the simples from.
	 * @param element
	 *            the Element to extract from
	 * @return an array of Elements objects that represent the 'unwrapped'
	 *         simples
	 * @throws MobyException
	 */
public static Element[] getSimplesFromCollection(Element element) throws MobyException {
    Element e = (Element) element.clone();
    Element mobyData = extractMobyData(e);
    Element collection = mobyData.getChild("Collection");
    if (collection == null)
        collection = mobyData.getChild("Collection", MOBY_NS);
    List list = collection.getChildren("Simple");
    if (list.isEmpty())
        list = collection.getChildren("Simple", MOBY_NS);
    if (list.isEmpty())
        return new Element[] {};
    Vector vector = new Vector();
    for (Iterator it = list.iterator(); it.hasNext(); ) {
        vector.add(it.next());
    }
    Element[] elements = new Element[vector.size()];
    vector.copyInto(elements);
    return elements;
}

82. XMLUtilities#getWrappedSimplesFromCollection()

View license
/**
	 *
	 * @param name
	 *            the name of the collection to extract the simples from.
	 * @param element
	 *            the Element to extract from
	 * @return an array of Elements objects that represent the simples, with the
	 *         name of the collection
	 * @throws MobyException
	 *             MobyException if the collection doesnt exist or the xml is
	 *             invalid
	 */
public static Element[] getWrappedSimplesFromCollection(String name, Element element) throws MobyException {
    Element el = (Element) element.clone();
    String queryID = getQueryID(el);
    Element collection = getCollection(name, el);
    Element serviceNotes = getServiceNotes(el);
    List list = collection.getChildren("Simple");
    if (list.isEmpty())
        list = collection.getChildren("Simple", MOBY_NS);
    if (list.isEmpty())
        return new Element[] {};
    Vector vector = new Vector();
    for (Iterator it = list.iterator(); it.hasNext(); ) {
        Element e = (Element) it.next();
        e.setAttribute("articleName", name, MOBY_NS);
        e = createMobyDataElementWrapper(e, queryID + "_split" + queryCount++, serviceNotes);
        vector.add(e);
    }
    Element[] elements = new Element[vector.size()];
    vector.copyInto(elements);
    return elements;
}

83. JUnitStarter#main()

View license
public static void main(String[] args) throws IOException {
    Vector argList = new Vector();
    for (int i = 0; i < args.length; i++) {
        String arg = args[i];
        argList.addElement(arg);
    }
    final ArrayList listeners = new ArrayList();
    final String[] name = new String[1];
    String agentName = processParameters(argList, listeners, name);
    if (!canWorkWithJUnitVersion(System.err, agentName)) {
        System.exit(-3);
    }
    if (!checkVersion(args, System.err)) {
        System.exit(-3);
    }
    String[] array = new String[argList.size()];
    argList.copyInto(array);
    int exitCode = prepareStreamsAndStart(array, agentName, listeners, name[0]);
    System.exit(exitCode);
}

84. HashtableTest#setUp()

Project: j2objc
Source File: HashtableTest.java
View license
/**
     * Sets up the fixture, for example, open a network connection. This method
     * is called before a test is executed.
     */
protected void setUp() {
    ht10 = new Hashtable(10);
    ht100 = new Hashtable(100);
    htfull = new Hashtable(10);
    keyVector = new Vector(10);
    elmVector = new Vector(10);
    for (int i = 0; i < 10; i++) {
        ht10.put("Key " + i, "Val " + i);
        keyVector.addElement("Key " + i);
        elmVector.addElement("Val " + i);
    }
    for (int i = 0; i < 7; i++) htfull.put("FKey " + i, "FVal " + i);
}

85. VectorTest#test_equalsLjava_lang_Object()

Project: j2objc
Source File: VectorTest.java
View license
/**
	 * @tests java.util.Vector#equals(java.lang.Object)
	 */
public void test_equalsLjava_lang_Object() {
    // Test for method boolean java.util.Vector.equals(java.lang.Object)
    Vector v = new Vector();
    for (int i = 0; i < 100; i++) v.addElement("Test " + i);
    assertTrue("a) Equal vectors returned false", tVector.equals(v));
    v.addElement(null);
    assertTrue("b) UnEqual vectors returned true", !tVector.equals(v));
    tVector.addElement(null);
    assertTrue("c) Equal vectors returned false", tVector.equals(v));
    tVector.removeElementAt(22);
    assertTrue("d) UnEqual vectors returned true", !tVector.equals(v));
    assertTrue("e) Equal vectors returned false", tVector.equals(tVector));
    assertFalse("f) UnEqual vectors returned true", tVector.equals(new Object()));
    assertFalse("g) Unequal vectors returned true", tVector.equals(null));
}

86. VectorTest#test_lastIndexOfLjava_lang_Object()

Project: j2objc
Source File: VectorTest.java
View license
/**
	 * @tests java.util.Vector#lastIndexOf(java.lang.Object)
	 */
public void test_lastIndexOfLjava_lang_Object() {
    // Test for method int java.util.Vector.lastIndexOf(java.lang.Object)
    Vector v = new Vector(9);
    for (int i = 0; i < 9; i++) v.addElement("Test");
    v.addElement("z");
    assertEquals("Failed to return correct index", 8, v.lastIndexOf("Test"));
    tVector.setElementAt(null, 20);
    tVector.setElementAt(null, 40);
    assertTrue("Incorrect lastIndexOf returned for null: " + tVector.lastIndexOf(null), tVector.lastIndexOf(null) == 40);
}

87. RedundentExprEliminator#createGlobalPseudoVarDecl()

Project: j2objc
Source File: RedundentExprEliminator.java
View license
/**
   * Create a psuedo variable reference that will represent the 
   * shared redundent XPath, for a local reduction.
   * 
   * @param uniquePseudoVarName The name of the new variable.
   * @param stylesheetRoot The broadest scope of where the variable 
   *        should be inserted, which must be a StylesheetRoot element in this case.
   * @param lpi The LocationPathIterator that the variable should represent.
   * @return null if the decl was not created, otherwise the new Pseudo var  
   *              element.
   */
protected ElemVariable createGlobalPseudoVarDecl(QName uniquePseudoVarName, StylesheetRoot stylesheetRoot, LocPathIterator lpi) throws org.w3c.dom.DOMException {
    ElemVariable psuedoVar = new ElemVariable();
    psuedoVar.setIsTopLevel(true);
    XPath xpath = new XPath(lpi);
    psuedoVar.setSelect(xpath);
    psuedoVar.setName(uniquePseudoVarName);
    Vector globalVars = stylesheetRoot.getVariablesAndParamsComposed();
    psuedoVar.setIndex(globalVars.size());
    globalVars.addElement(psuedoVar);
    return psuedoVar;
}

88. SnmpMibTable#removeNotificationListener()

Project: jdk7u-jdk
Source File: SnmpMibTable.java
View license
/**
     * Enable to remove an SNMP entry listener from this
     * <CODE>SnmpMibTable</CODE>.
     *
     * @param listener The listener object which will handle the
     *    notifications emitted by the registered MBean.
     *    This method will remove all the information related to this
     *    listener.
     *
     * @exception ListenerNotFoundException The listener is not registered
     *    in the MBean.
     */
public synchronized void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException {
    // looking for listener in handbackTable
    //
    java.util.Vector handbackList = (java.util.Vector) handbackTable.get(listener);
    java.util.Vector filterList = (java.util.Vector) filterTable.get(listener);
    if (handbackList == null) {
        throw new ListenerNotFoundException("listener");
    }
    // If handback is null, remove the listener entry
    //
    handbackTable.remove(listener);
    filterTable.remove(listener);
}

89. LdapCtx#extractURLs()

Project: jdk7u-jdk
Source File: LdapCtx.java
View license
/*
     * Extract URLs from a string. The format of the string is:
     *
     *     <urlstring > ::= "Referral:" <ldapurls>
     *     <ldapurls>   ::= <separator> <ldapurl> | <ldapurls>
     *     <separator>  ::= ASCII linefeed character (0x0a)
     *     <ldapurl>    ::= LDAP URL format (RFC 1959)
     */
private static Vector extractURLs(String refString) {
    int separator = 0;
    int urlCount = 0;
    // count the number of URLs
    while ((separator = refString.indexOf('\n', separator)) >= 0) {
        separator++;
        urlCount++;
    }
    Vector referrals = new Vector(urlCount);
    int iURL;
    int i = 0;
    separator = refString.indexOf('\n');
    iURL = separator + 1;
    while ((separator = refString.indexOf('\n', iURL)) >= 0) {
        referrals.addElement(refString.substring(iURL, separator));
        iURL = separator + 1;
    }
    referrals.addElement(refString.substring(iURL));
    return referrals;
}

90. Area#equals()

Project: jdk7u-jdk
Source File: Area.java
View license
/**
     * Tests whether the geometries of the two <code>Area</code> objects
     * are equal.
     * This method will return false if the argument is null.
     * @param   other  the <code>Area</code> to be compared to this
     *          <code>Area</code>
     * @return  <code>true</code> if the two geometries are equal;
     *          <code>false</code> otherwise.
     * @since 1.2
     */
public boolean equals(Area other) {
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}

91. Menu#shortcuts()

Project: jdk7u-jdk
Source File: Menu.java
View license
synchronized Enumeration shortcuts() {
    Vector shortcuts = new Vector();
    int nitems = getItemCount();
    for (int i = 0; i < nitems; i++) {
        MenuItem mi = getItem(i);
        if (mi instanceof Menu) {
            Enumeration e = ((Menu) mi).shortcuts();
            while (e.hasMoreElements()) {
                shortcuts.addElement(e.nextElement());
            }
        } else {
            MenuShortcut ms = mi.getShortcut();
            if (ms != null) {
                shortcuts.addElement(ms);
            }
        }
    }
    return shortcuts.elements();
}

92. Message#setHeaderField()

Project: jpexs-decompiler
Source File: Message.java
View license
public void setHeaderField(String name, String value, int index) {
    Vector v;
    Key key = new Key(name);
    if (headers.containsKey(key)) {
        v = (Vector) headers.get(key);
    } else {
        v = new Vector();
        if (index == 0) {
            v.addElement("");
        }
        headers.put(key, v);
    }
    v.setElementAt(value, index);
}

93. Request#addLogEntry()

Project: jpexs-decompiler
Source File: Request.java
View license
public synchronized void addLogEntry(String header, String message) {
    if (log == null) {
        log = new Hashtable();
        logHeaders = new Vector();
    }
    Vector v = (Vector) log.get(header);
    if (log.get(header) == null) {
        v = new Vector();
        log.put(header, v);
        logHeaders.addElement(header);
    }
    v.addElement(message);
}

94. DirPoll#setPriorities()

Project: jPOS
Source File: DirPoll.java
View license
/**
     * @param priorities blank separated list of extensions
     */
public void setPriorities(String priorities) {
    StringTokenizer st = new StringTokenizer(priorities);
    Vector v = new Vector();
    while (st.hasMoreTokens()) {
        String ext = st.nextToken();
        v.addElement(ext.equals("*") ? "" : ext);
    }
    if (v.isEmpty())
        v.addElement("");
    synchronized (this) {
        prio = v;
    }
}

95. GenericValidatingPackagerTest#testGenericValidatorContentHandlerMakeMsgValidatorArray()

View license
@SuppressWarnings("unchecked")
@Test
public void testGenericValidatorContentHandlerMakeMsgValidatorArray() throws Throwable {
    GenericValidatingPackager.GenericValidatorContentHandler genericValidatorContentHandler = new GenericValidatingPackager().new GenericValidatorContentHandler();
    Vector vector = new Vector();
    vector.add(null);
    Hashtable tab = new Hashtable(100);
    tab.put(Integer.valueOf(-3), vector);
    ISOBaseValidator[] result = genericValidatorContentHandler.makeMsgValidatorArray(tab);
    assertEquals("result.length", 1, result.length);
    assertNull("result[0]", result[0]);
}

96. RCML#getEntries()

Project: lenya
Source File: RCML.java
View license
/**
     * get all check in and check out
     *
     * @return Vector of all check out and check in entries in this RCML-file
     *
     * @throws Exception if an error occurs
     */
public Vector getEntries() throws Exception {
    XPointerFactory xpf = new XPointerFactory();
    Vector entries = xpf.select(document.getDocumentElement(), "xpointer(/XPSRevisionControl/CheckOut|/XPSRevisionControl/CheckIn)");
    Vector RCMLEntries = new Vector();
    for (int i = 0; i < entries.size(); i++) {
        Element elem = (Element) entries.get(i);
        String time = elem.getElementsByTagName("Time").item(0).getFirstChild().getNodeValue();
        String identity = elem.getElementsByTagName("Identity").item(0).getFirstChild().getNodeValue();
        if (elem.getTagName().equals("CheckOut")) {
            RCMLEntries.add(new CheckOutEntry(identity, Long.parseLong(time)));
        } else {
            RCMLEntries.add(new CheckInEntry(identity, Long.parseLong(time)));
        }
    }
    return RCMLEntries;
}

97. Area#equals()

Project: LGame
Source File: Area.java
View license
/**
	 * Tests whether the geometries of the two <code>Area</code> objects are
	 * equal. This method will return false if the argument is null.
	 * 
	 * @param other
	 *            the <code>Area</code> to be compared to this <code>Area</code>
	 * @return <code>true</code> if the two geometries are equal;
	 *         <code>false</code> otherwise.
	 * @since 1.2
	 */
public boolean equals(Area other) {
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}

98. Hierarchy#getCurrentLoggers()

Project: log4j
Source File: Hierarchy.java
View license
/**
     Returns all the currently defined categories in this hierarchy as
     an [email protected] java.util.Enumeration Enumeration}.

     <p>The root logger is <em>not</em> included in the returned
     [email protected] Enumeration}.
     @return enumerator of current loggers
   */
public Enumeration getCurrentLoggers() {
    // The accumlation in v is necessary because not all elements in
    // ht are Logger objects as there might be some ProvisionNodes
    // as well.
    Vector v = new Vector(ht.size());
    Enumeration elems = ht.elements();
    while (elems.hasMoreElements()) {
        Object o = elems.nextElement();
        if (o instanceof Logger) {
            v.addElement(o);
        }
    }
    return v.elements();
}

99. FullCycleDBTest#getRelevantEventsFromVA()

Project: log4j
Source File: FullCycleDBTest.java
View license
Vector getRelevantEventsFromVA(VectorAppender va, long startTime) {
    assertNotNull(va);
    Vector v = va.getVector();
    Vector r = new Vector();
    // remove all elements older than startTime
    for (Iterator i = v.iterator(); i.hasNext(); ) {
        LoggingEvent event = (LoggingEvent) i.next();
        if (startTime > event.getTimeStamp()) {
            System.out.println("***Removing event with timestamp " + event.getTimeStamp());
        } else {
            System.out.println("***Keeping event with timestamo" + event.getTimeStamp());
            r.add(event);
        }
    }
    return r;
}

100. LogCapture#getMessage()

Project: log4j-extras
Source File: LogCapture.java
View license
/**
     * Get message.
     * @return rendered message, null if no logging event captured.
     */
public String getMessage() {
    Vector vector = appender.getVector();
    String msg = null;
    switch(vector.size()) {
        case 0:
            break;
        case 1:
            LoggingEvent event = (LoggingEvent) vector.elementAt(0);
            Assert.assertNotNull(event);
            Assert.assertEquals(level, event.getLevel());
            msg = event.getRenderedMessage();
            break;
        default:
            Assert.fail("More than one request captured");
    }
    return msg;
}