Hashtable size - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:size
        Assert.assertTrue(embeddedRoot.exists());
    } 
 
    @Test 
    public void testNoSpecialConfig() throws Exception { 
        Properties props = new Properties();
        EmbeddedStandAloneServerFactory.setupCleanDirectories(standardJBossHome, props);
        Assert.assertEquals(0, props.size());
    } 
 
    @Test 
    public void testEmbeddedRootNoOverrides() throws Exception { 
        Properties props = new Properties();
        props.setProperty(EmbeddedStandAloneServerFactory.JBOSS_EMBEDDED_ROOT, embeddedRoot.getAbsolutePath());
        EmbeddedStandAloneServerFactory.setupCleanDirectories(standardJBossHome, props);
 
        Assert.assertEquals(4, props.size());
        Assert.assertEquals(embeddedRoot.getAbsolutePath(), props.getProperty(EmbeddedStandAloneServerFactory.JBOSS_EMBEDDED_ROOT));
        assertPropertyAndEmbeddedRootFile(props, ServerEnvironment.SERVER_BASE_DIR, -1);
        assertPropertyAndEmbeddedRootFile(props, ServerEnvironment.SERVER_DATA_DIR, 1);
8
CodeRank
This code example shows how to use the following methods:size
        } 
        return String.format("WildFly %s \"%s\"", version1, version2);
    } 
 
    private void setSystemProperties(final Properties propConfProps, final Map providedProperties) {
        if (propConfProps.size() == 0) {
            return; 
        } 
 
        PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
            @Override 
            public Void run() {
                for (Map.Entry<Object, Object> entry : propConfProps.entrySet()) {
                    String key = (String)entry.getKey();
                    if (!key.equals("slot") && System.getProperty(key) == null) {
                        //Only set the property if it was not defined by other means 
                        //System properties defined in standalone.xml, domain.xml or host.xml will overwrite 
                        //this as specified in https://issues.jboss.org/browse/AS7-6380 
 
                        System.setProperty(key, (String)entry.getValue());
7
CodeRank
This code example shows how to use the following methods:size, getProperty
		} 
 
		Properties serviceBuilderProperties =
			serviceBuilderPropertiesConfiguration.getProperties();
 
		if (serviceBuilderProperties.size() == 0) {
			return; 
		} 
 
		String buildNamespace = GetterUtil.getString(
			serviceBuilderProperties.getProperty("build.namespace"));
		long buildNumber = GetterUtil.getLong(
			serviceBuilderProperties.getProperty("build.number"));
		long buildDate = GetterUtil.getLong(
			serviceBuilderProperties.getProperty("build.date"));
		boolean buildAutoUpgrade = GetterUtil.getBoolean(
			serviceBuilderProperties.getProperty("build.auto.upgrade"), true);
 
		if (_log.isDebugEnabled()) {
			_log.debug("Build namespace " + buildNamespace);
6
CodeRank
This code example shows how to use the following methods:size
        return temp;
    } 
 
    public int size() 
    { 
        return usageTable.size();
    } 
     
    public DERObject toASN1Object() 
    { 
        return seq;
    } 
} 
6
CodeRank
This code example shows how to use the following methods:keySet, size, load
     * @see java.util.prefs.AbstractPreferences#keysSpi() 
     */ 
    protected String[] keysSpi() throws BackingStoreException {
        checkLoaded(); 
        return prefs == null ? EMPTY_STRING_ARRAY : (String[])
            prefs.keySet().toArray(new String[prefs.size()]);
    } 
 
    /* (non-Javadoc) 
     * @see java.util.prefs.AbstractPreferences#putSpi(java.lang.String, java.lang.String) 
     */ 
    protected void putSpi(String key, String value) {
        checkLoaded(); 
        if(prefs == null) {
            prefs = new Properties();
        } 
        prefs.setProperty(key, value);
    } 
 
    /* (non-Javadoc) 
6
CodeRank
This code example shows how to use the following methods:keySet, size
            return getSchema(ServerDescriptorDAOImpl.this.serverProperties.getProperty("version.schema"));
        } 
 
        public String[] getDescriptorKeys()
        { 
            final String[] keys = new String[ServerDescriptorDAOImpl.this.serverProperties.size()];
            ServerDescriptorDAOImpl.this.serverProperties.keySet().toArray(keys);
            return keys;
        } 
 
        public String getDescriptor(final String key)
        { 
            return ServerDescriptorDAOImpl.this.serverProperties.getProperty(key, "");
        } 
 
        @Override 
        public LicenseMode getLicenseMode() 
        { 
            return LicenseMode.UNKNOWN; 
        } 
6
CodeRank
This code example shows how to use the following methods:get, size
    "<meta name=\"keywords\" content=\"this is a test\" />" + 
    "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />" + 
    "</head><body>foobar</body></html>"; 
    HTMLParser parser = new HTMLParser(new StringReader(text));
    Properties tags = parser.getMetaTags();
    assertEquals(4, tags.size());
    assertEquals("1", tags.get("a"));
    assertEquals("2", tags.get("b"));
    assertEquals("this is a test", tags.get("keywords"));
    assertEquals("text/html;charset=utf-8", tags.get("content-type"));
  } 
   
  public void testTitle() throws Exception { 
    String text = "<html><head><TITLE>foo</TITLE><head><body>bar</body></html>";
    HTMLParser parser = new HTMLParser(new StringReader(text));
    assertEquals("foo", parser.getTitle());
  } 
   
  public void testSummary() throws Exception { 
    String text = "<html><head><TITLE>foo</TITLE><head><body>" + 
6
CodeRank
This code example shows how to use the following methods:get, size, load
        artifactLocations.put("other-classifier", OTHER_ARTIFACT);
 
        P2MetadataMojo.writeArtifactLocations(testFile, artifactLocations);
 
        Properties result = loadProperties(testFile);
        assertEquals(3, result.size());
        assertEquals(MAIN_ARTIFACT.getCanonicalFile(), getFileEntry("artifact.main", result));
        assertEquals(SOURCE_ARTIFACT.getCanonicalFile(), getFileEntry("artifact.attached.source", result));
        assertEquals(OTHER_ARTIFACT.getCanonicalFile(), getFileEntry("artifact.attached.other-classifier", result));
    } 
 
    @Test 
    public void testWriteOnlyAttachedArtifactLocation() throws Exception { 
        Map<String, File> artifactLocations = new HashMap<String, File>();
        artifactLocations.put("other-classifier", OTHER_ARTIFACT);
 
        P2MetadataMojo.writeArtifactLocations(testFile, artifactLocations);
 
        Properties result = loadProperties(testFile);
        assertEquals(1, result.size());

6
CodeRank
This code example shows how to use the following methods:put, size
package edu.harvard.i2b2.crc.loader.util.security; 
 
import java.util.Hashtable; 
 
public class Cipher { 
 
	 
	public static String encryptMRN(String key, String mrn, String company) throws Exception
	{ 
		 
		Hashtable htemp = new Hashtable();
		htemp.put("a", key);
		HighEncryption highEnc =new HighEncryption("a", htemp);		
		return  highEnc.mrn_encrypt(mrn, true, company);		
	} 
	 
	public static String decryptMRN(String key, String mrn) throws Exception
	{ 
		Hashtable htemp = new Hashtable();
		htemp.put("a", key);

6
CodeRank
This code example shows how to use the following methods:elements, size
   *  as keys.  
   */ 
  protected Hashtable _all = new Hashtable(11);
 
  /** Access to all elements of the set. */ 
  public Enumeration all() {return _all.elements();}
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ 
 
  /** Cached hashcode for this set. */ 
  protected Integer hashcode_cache = null;
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ 
 
  /** Size of the set */ 
  public int size() {return _all.size();}
 
  /*-----------------------------------------------------------*/ 
  /*--- Set Operation Methods ---------------------------------*/ 
  /*-----------------------------------------------------------*/ 
 
6
CodeRank
size Method Overview
Returns the number of keys in this hashtable.
See Code Examples for other Java 8 Hashtable Methods: