Home / Function/ getLocalTimes() — netty Function Reference

getLocalTimes() — netty Function Reference

Architecture documentation for the getLocalTimes() function in WorldClockClientHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  638d6878_76c7_50fe_ddfc_9df919b7d3e2["getLocalTimes()"]
  a0ad04a6_4b11_c1bd_e15e_95329df45e15["WorldClockClientHandler"]
  638d6878_76c7_50fe_ddfc_9df919b7d3e2 -->|defined in| a0ad04a6_4b11_c1bd_e15e_95329df45e15
  style 638d6878_76c7_50fe_ddfc_9df919b7d3e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/worldclock/WorldClockClientHandler.java lines 47–89

    public List<String> getLocalTimes(Collection<String> cities) {
        Locations.Builder builder = Locations.newBuilder();

        for (String c: cities) {
            String[] components = DELIM.split(c);
            builder.addLocation(Location.newBuilder().
                setContinent(Continent.valueOf(components[0].toUpperCase())).
                setCity(components[1]).build());
        }

        channel.writeAndFlush(builder.build());

        LocalTimes localTimes;
        boolean interrupted = false;
        for (;;) {
            try {
                localTimes = answer.take();
                break;
            } catch (InterruptedException ignore) {
                interrupted = true;
            }
        }

        if (interrupted) {
            Thread.currentThread().interrupt();
        }

        List<String> result = new ArrayList<String>();
        for (LocalTime lt: localTimes.getLocalTimeList()) {
            result.add(
                    new Formatter().format(
                            "%4d-%02d-%02d %02d:%02d:%02d %s",
                            lt.getYear(),
                            lt.getMonth(),
                            lt.getDayOfMonth(),
                            lt.getHour(),
                            lt.getMinute(),
                            lt.getSecond(),
                            lt.getDayOfWeek().name()).toString());
        }

        return result;
    }

Domain

Subdomains

Frequently Asked Questions

What does getLocalTimes() do?
getLocalTimes() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/worldclock/WorldClockClientHandler.java.
Where is getLocalTimes() defined?
getLocalTimes() is defined in example/src/main/java/io/netty/example/worldclock/WorldClockClientHandler.java at line 47.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free