Home / Function/ tryParseYear() — netty Function Reference

tryParseYear() — netty Function Reference

Architecture documentation for the tryParseYear() function in DateFormatter.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  666b38f7_c194_b05c_4873_e01012dd6749["tryParseYear()"]
  868307e6_8dd7_9eb3_bb13_ca685c4d59cf["DateFormatter"]
  666b38f7_c194_b05c_4873_e01012dd6749 -->|defined in| 868307e6_8dd7_9eb3_bb13_ca685c4d59cf
  ccbf0bfc_8853_892e_8582_30ad6041b06a["parseToken()"]
  ccbf0bfc_8853_892e_8582_30ad6041b06a -->|calls| 666b38f7_c194_b05c_4873_e01012dd6749
  f6218a9b_85e0_505c_17e2_64f08857d3eb["isDigit()"]
  666b38f7_c194_b05c_4873_e01012dd6749 -->|calls| f6218a9b_85e0_505c_17e2_64f08857d3eb
  c92994fa_0cd5_d7c9_02dd_596787c21993["getNumericalValue()"]
  666b38f7_c194_b05c_4873_e01012dd6749 -->|calls| c92994fa_0cd5_d7c9_02dd_596787c21993
  style 666b38f7_c194_b05c_4873_e01012dd6749 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/main/java/io/netty/handler/codec/DateFormatter.java lines 308–334

    private boolean tryParseYear(CharSequence txt, int tokenStart, int tokenEnd) {
        int len = tokenEnd - tokenStart;

        if (len == 2) {
            char c0 = txt.charAt(tokenStart);
            char c1 = txt.charAt(tokenStart + 1);
            if (isDigit(c0) && isDigit(c1)) {
                year = getNumericalValue(c0) * 10 + getNumericalValue(c1);
                return true;
            }

        } else if (len == 4) {
            char c0 = txt.charAt(tokenStart);
            char c1 = txt.charAt(tokenStart + 1);
            char c2 = txt.charAt(tokenStart + 2);
            char c3 = txt.charAt(tokenStart + 3);
            if (isDigit(c0) && isDigit(c1) && isDigit(c2) && isDigit(c3)) {
                year = getNumericalValue(c0) * 1000 +
                        getNumericalValue(c1) * 100 +
                        getNumericalValue(c2) * 10 +
                        getNumericalValue(c3);
                return true;
            }
        }

        return false;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does tryParseYear() do?
tryParseYear() is a function in the netty codebase, defined in codec-base/src/main/java/io/netty/handler/codec/DateFormatter.java.
Where is tryParseYear() defined?
tryParseYear() is defined in codec-base/src/main/java/io/netty/handler/codec/DateFormatter.java at line 308.
What does tryParseYear() call?
tryParseYear() calls 2 function(s): getNumericalValue, isDigit.
What calls tryParseYear()?
tryParseYear() is called by 1 function(s): parseToken.

Analyze Your Own Codebase

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

Try Supermodel Free