private Size parseAtomicSize ( String token ) { String trimmedToken = token . trim ( ) ; if ( trimmedToken . startsWith ( "'" ) && trimmedToken . endsWith ( "'" ) ) { int length = trimmedToken . length ( ) ; if ( length < 2 ) { throw new IllegalArgumentException ( "Missing closing \"'\" for prototype." ) ; } return new PrototypeSize ( trimmedToken . substring ( 1 , length - 1 ) ) ; } Sizes . ComponentSize componentSize = Sizes . ComponentSize . valueOf ( trimmedToken ) ; if ( componentSize != null ) { return componentSize ; } return ConstantSize . valueOf ( trimmedToken , isHorizontal ( ) ) ; }
Decodes and returns an atomic size that is either a constant size or a component size .