When several subdomains are available, get subdomain pointed by internal cycle counter on subdomains and increment this counter
@return	the subdomain string associated to current counter value.
559920
public synchronized String getSubDomain()
	{
		if(m_imageUrlSubdomains==null || m_imageUrlSubdomains.length<=0) {
			return null;
		}

		final String result = m_imageUrlSubdomains[m_subdomainsCounter];
		if(m_subdomainsCounter<m_imageUrlSubdomains.length-1) {
			m_subdomainsCounter++;
		} else {
			m_subdomainsCounter=0;
		}

		return result;
	}
306266
public int getSameNameSiblingIndex() {
        int snsIndex = 1;
        if (this.parent == null) {
            return snsIndex;
        }
        // Go through all the children ...
        for (AstNode sibling : this.parent.getChildren()) {
            if (sibling == this) {
                break;
            }
            if (sibling.getName().equals(this.name)) {
                ++snsIndex;
            }
        }
        return snsIndex;
    }
1283247
public final int getRemaining()
    {
        int rem = 0;
        for (int ii=0;ii<length;ii++)
        {
            rem += srcs[offset+ii].remaining();
        }
        return rem;
    }
442187
public CompanyDomain currentDomain() {
		Criteria criteria = this.dao.newCriteria(CompanyDomain.class)
				.add(Restrictions.eq("host", this.request.getHeader("Host")));
		return (CompanyDomain) criteria.uniqueResult();
	}
566837
public String getSubscriberID()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "getSubscriberID");
            SibTr.exit(this, tc, "getSubscriberID", subscriptionID);
        }

        return subscriptionID;
    }
351618
public String getDomains() {
		StringWriter sw = new StringWriter();
		JsonGenerator generator;
		if (this.prettyFormat != Format.NONE) {
			JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
			generator = gf.createGenerator(sw);
		} else
			generator = Json.createGenerator(sw);
		
		generator.writeStartArray();
		List<String> doms = DomainInformation.availableDomains(dbAccess);
		for (String dom : doms) {
			generator.write(dom);
		}
		generator.writeEnd();

		generator.flush();
		return sw.toString();
	}
789698
public String getCurrentSessionId() {
        String currentId = null;
        Hashtable ht = (Hashtable) currentThreadSacHashtable.get();
        if (ht != null) {
            SessionAffinityContext sac = (SessionAffinityContext) ht.get(_smc.getSessionAffinityContextKey());
            if (sac != null) {
                currentId = _sam.getInUseSessionID(null, sac);
                // Make sure this is set if nothing was passed in.
                if (currentId == null) {
                    currentId = "NONE";
                }
            }
        }
        // If null is returned, this is considered to be a user spawned thread.
        return currentId;
    }
916330
protected long getCurrentPage() {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "getCurrentPage"
                            );

        long currentPage = sectorValidatedInputStream.currentPage;

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "getCurrentPage"
                       , "returns =" + currentPage + "(long)"
                            );
        return currentPage;
    }
175155
public static function getDomain()
	{
		if (!isset(self::$RCACHE)) static::cacheReqData();

		//decide if tld needs to be joined
		if (self::$RCACHE['numParts'] > 1) {
			return self::$RCACHE['hostParts'][1] . '.' . static::getTld();
		} else {
			return self::$RCACHE['hostParts'][0];
		}
	}
474267
@VisibleForTesting
  String countersToString() {
    StringBuilder sb = new StringBuilder();
    sb.append("\n");
    double numNanoSecPerSec = TimeUnit.SECONDS.toNanos(1);
    String timeSuffix = "_TIME";
    for (Counter c : Counter.values()) {
      String name = c.toString();
      if (!name.endsWith(timeSuffix)) {
        // Log invocation counter.
        long count = counters.get(c).get();
        sb.append(String.format("%20s = %d calls\n", name, count));

        // Log duration counter.
        String timeCounterName = name + timeSuffix;
        double totalTime =
            counters.get(Enum.valueOf(Counter.class, timeCounterName)).get()
                / numNanoSecPerSec;
        sb.append(String.format("%20s = %.2f sec\n", timeCounterName, totalTime));

        // Compute and log average duration per call (== total duration / num invocations).
        String avgName = name + " avg.";
        double avg = totalTime / count;
        sb.append(String.format("%20s = %.2f sec / call\n\n", avgName, avg));
      }
    }
    return sb.toString();
  }
832524
public GetDomainStatisticsResponse getDomainStatistics(String domain) {
        GetDomainStatisticsRequest request = new GetDomainStatisticsRequest();
        request.setDomain(domain);
        return getDomainStatistics(request);
    }
1112970
def get_subdomains_count(db_path=None, zonefiles_dir=None):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        log.warn("Subdomain support is disabled")
        return None

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    db = SubdomainDB(db_path, zonefiles_dir)
    return db.get_subdomains_count()
1351706
public static String domainName() {
        List<String> words = new ArrayList<String>();
        words.add(fixUmlauts(domainWord()));
        words.add(domainSuffix());
        return StringUtils.join(words, ".");

    }
1339730
public function getDomainName(): string
    {
        return $this->myDomainParts[count($this->myDomainParts) - 1] . ($this->myTld !== null ? '.' . $this->myTld : '');
    }
619099
def list_subdomains(self, domain, limit=None, offset=None):
        
        # The commented-out uri is the official API, but it is
        # horribly slow.
#        uri = "/domains/%s/subdomains" % utils.get_id(domain)
        uri = "/domains?name=%s" % domain.name
        page_qs = self._get_pagination_qs(limit, offset)
        if page_qs:
            uri = "%s&%s" % (uri, page_qs[1:])
        return self._list_subdomains(uri, domain.id)
829588
public long getInvocationCacheMissCount()
  {
    LruCache<Object,I> invocationCache = _invocationCache;

    if (invocationCache != null) {
      return invocationCache.getMissCount();
    }
    else {
      return 0;
    }
  }
252259
private static SiteDomainInfo getDomainInfo(Collection<String> uris) {

        Set<String> rootDomains = Sets.newHashSet();
        Set<String> domains = Sets.newHashSet();
        boolean invalidPort = false;

        for (String uriStr : uris) {

            try {
                URI uri = new URI(uriStr);
                int port = uri.getPort();
                if (!((port == 80) || (port == 443) || (port == -1))) {
                    invalidPort = true;
                }
                String rootDomain = getDomainRoot(uri);
                if (rootDomain == null) {
                    LOG.warn("Host is not under public suffix, skipping it: " + uri);
                    continue;
                }
                domains.add(uri.getHost());
                rootDomains.add(rootDomain);
            } catch (URISyntaxException e) {
                LOG.warn("getDomainInfo: invalid URI " + uriStr, e);
                continue;
            }
        }
        String rootDomain = (rootDomains.size() == 1 ? rootDomains.iterator().next() : null);
        return new SiteDomainInfo(domains, rootDomain, invalidPort);
    }