MCPcopy Create free account
hub / github.com/davidgiven/luje / isValidIP4Word

Method isValidIP4Word

lib/java/net/URI.java:791–806  ·  view source on GitHub ↗
(String word)

Source from the content-addressed store, hash-verified

789 }
790
791 private boolean isValidIP4Word(String word) {
792 char c;
793 if (word.length() < 1 || word.length() > 3) {
794 return false;
795 }
796 for (int i = 0; i < word.length(); i++) {
797 c = word.charAt(i);
798 if (!(c >= '0' && c <= '9')) {
799 return false;
800 }
801 }
802 if (Integer.parseInt(word) > 255) {
803 return false;
804 }
805 return true;
806 }
807
808 private boolean isValidHexChar(char c) {
809

Callers 1

isValidIP6AddressMethod · 0.95

Calls 3

parseIntMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected