Checks symbol content.
@return not null
483817
public static SymbolToken newSymbolToken(SymbolTable symtab,
                                             String text)
    {
        // TODO amzn/ion-java/issues/21 symtab should not be null
        text.getClass(); // quick null check

        SymbolToken tok = (symtab == null ? null : symtab.find(text));
        if (tok == null)
        {
            tok = new SymbolTokenImpl(text, UNKNOWN_SYMBOL_ID);
        }
        return tok;
    }
1329124
@Requires("nextToken == null")
  @Ensures("result == (nextToken != null)")
  protected boolean lex() throws IOException {
    int startOffset = currentOffset;
    StringBuilder buffer = new StringBuilder();
    int c = readChar(true);
    if (c == -1) {
      return false;
    }
    buffer.append((char) c);
    switch (c) {
      case '/':
        /* Comments. */
        c = readChar(true);
        switch (c) {
          case '/':
            buffer.append((char) c);
            do {
              c = readChar(false);
              buffer.append((char) c);
            } while (c != '\n');
            nextToken = new Token(TokenKind.COMMENT, buffer.toString(),
                                  startOffset);
            break;
          case '*':
            buffer.append((char) c);
            for (;;) {
              c = readChar(false);
              buffer.append((char) c);
              if (c == '*') {
                c = readChar(false);
                buffer.append((char) c);
                if (c == '/') {
                  break;
                }
              }
            }
            nextToken = new Token(TokenKind.COMMENT, buffer.toString(),
                                  startOffset);
            break;
          default:
            unreadChar(c);
            nextToken = new Token(TokenKind.SYMBOL, buffer.toString(),
                                  startOffset);
        }
        break;

      case '\'':
      case '"':
        /* Quoted strings. */
        int delim = c;
        for (;;) {
          c = readChar(false);
          buffer.append((char) c);
          if (c == delim) {
            break;
          }
          if (c == '\\') {
            buffer.append((char) readChar(false));
          }
        }
        nextToken = new Token(TokenKind.QUOTE, buffer.toString(), startOffset);
        break;

      default:
        if (Character.isJavaIdentifierStart(c)) {
          /* Identifiers. */
          while ((c = readChar(true)) != -1
                 && Character.isJavaIdentifierPart(c)) {
            buffer.append((char) c);
          }
          unreadChar(c);
          nextToken = new Token(TokenKind.WORD, buffer.toString(), startOffset);
        } else if (Character.isWhitespace(c)) {
          /* White space. */
          while ((c = readChar(true)) != -1 && Character.isWhitespace(c)) {
            buffer.append((char) c);
          }
          unreadChar(c);
          nextToken = new Token(TokenKind.SPACE, buffer.toString(),
                                startOffset);
        } else {
          /* Symbol. */
          nextToken = new Token(TokenKind.SYMBOL, buffer.toString(),
                                startOffset);
        }
    }
    return true;
  }
584519
public static String getChemicalSeries(String symbol) {
        Elements e = Elements.ofString(symbol);
        for (Series s : Series.values())
            if (s.contains(e)) return s.name();
        return null;
    }
1374036
public String content() {
		String s = (String) annotationAttributes.get(CONTENT);
		if (s == null)
			s = "";
		return s;
	}
413990
public boolean isEmpty() {
		return (content.toString().trim().length() == 0)
				&& (content.toString().indexOf("\n") == -1)
				&& (attributes == null);
	}
511792
public static function isSymbol($str)
    {
        if (strlen($str) === 0) {
            return null;
        }
        if ($str[0] === '@') {
            return Token::FLAG_SYMBOL_VARIABLE;
        } elseif ($str[0] === '`') {
            return Token::FLAG_SYMBOL_BACKTICK;
        } elseif ($str[0] === ':') {
            return Token::FLAG_SYMBOL_PARAMETER;
        }

        return null;
    }
358274
static boolean isMatchSymbol(final Symbol symbol) {
        if (!(symbol instanceof BasisSymbol)) {
            return false;
        }
        BasisSymbol basisSymbol = (BasisSymbol) symbol;
        Set<Symbol> uniqueSymbols = new HashSet<Symbol>();
        for (Object o : basisSymbol.getSymbols()) {
            Symbol s = (Symbol) o;
            if (isGapSymbol(s)) {
                return false;
            }
            uniqueSymbols.add((Symbol) o);
        }
        return (uniqueSymbols.size() == 1);
    }
371824
public boolean hasNext()
	{
		try {
			if (result != null && result.next()) {
				return true;
			}

			if (this.statement != null) {
				this.statement.close();
			}
			if (this.result != null) {
				this.result.close();
			}

			return query();

		}
		catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
381741
private static boolean isSanitizedContentOfKind(
      SoyValue value, SanitizedContent.ContentKind kind) {
    return value instanceof SanitizedContent && kind == ((SanitizedContent) value).getContentKind();
  }
1095486
public boolean hasNextToken() {
    if (this.nextToken == null) {
      try {
        this.nextToken = this.jlexer.yylex();
      } catch (final IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return this.nextToken != null;
  }
573479
protected boolean isSignMessageURI(String uri) {
    LoaEnum loa = LoaEnum.parse(uri);
    return (loa != null && loa.isSignatureMessageUri());
  }
109430
def _check_symbols(self, symbols):
        """"""
        if len(symbols) != self.size:
            raise TypeError("The number of symbols in the graph does not "
                "match the length of the atomic numbers array.")
        for symbol in symbols:
            if not isinstance(symbol, str):
                raise TypeError("All symbols must be strings.")
465785
def check_trademark_symbol(text):
    """"""
    err = "typography.symbols.trademark"
    msg = u"(TM) is a goofy alphabetic approximation, use the symbol ™."
    regex = "\(TM\)"

    return existence_check(
        text, [regex], err, msg, max_errors=3, require_padding=False)
1005630
static String getCharsetFromContentType(String contentType) {
        if (contentType == null) return null;
        Matcher m = charsetPattern.matcher(contentType);
        if (m.find()) {
            String charset = m.group(1).trim();
            charset = charset.replace("charset=", "");
            return validateCharset(charset);
        }
        return null;
    }
601088
private Token scanToken()
  {
    Token token = _token;
    
    if (token != null) {
      _token = null;
      
      return token;
    }

    int sign = 1;
    int ch;

    for (ch = read(); Character.isWhitespace((char) ch); ch = read()) {
    }

    switch (ch) {
    case -1:
      return Token.EOF;
      
    case '(':
      return Token.LPAREN;
    case ')':
      return Token.RPAREN;
    case ',':
      return Token.COMMA;
    case '*':
      return Token.STAR;
    case '-':
      return Token.MINUS;
    case '+':
      return Token.PLUS;
    case '/':
      return Token.DIV;
    case '%':
      return Token.MOD;
    case '.':
      return Token.DOT;
    case '?':
      return Token.QUESTION_MARK;
      /*
    case '/':
    case '%':
    case '?':
      return ch;
      */

      /*
    case '+':
      if ((ch = read()) >= '0' && ch <= '9')
        break;
      else {
        unread(ch);
        return '+';
      }

    case '-':
      if ((ch = read()) >= '0' && ch <= '9') {
        sign = -1;
        break;
      }
      else {
        unread(ch);
        return '-';
      }
      */

    case '=':
      return Token.EQ;

    case '<':
      if ((ch = read()) == '=')
        return Token.LE;
      else if (ch == '>')
        return Token.NE;
      else {
        unread(ch);
        return Token.LT;
      }

    case '>':
      if ((ch = read()) == '=')
        return Token.GE;
      else {
        unread(ch);
        return Token.GT;
      }

      /*
    case '|':
      if ((ch = read()) == '|')
        return CONCAT;
      else {
        throw error(L.l("'|' expected at {0}", charName(ch)));
      }

      // @@ is useless?
    case '@':
      if ((ch = read()) != '@')
        throw error(L.l("`@' expected at {0}", charName(ch)));
      return scanToken();
    */
    }

    if (Character.isJavaIdentifierStart((char) ch) || ch == ':') {
      CharBuffer cb = _cb;
      cb.clear();

      for (; ch > 0 && isIdentifierPart((char) ch); ch = read()) {
        cb.append((char) ch);
      }

      unread(ch);

      _lexeme = cb.toString();
      String lower = _lexeme.toLowerCase(Locale.ENGLISH);

      token = _reserved.get(lower);

      if (token != null)
        return token;
      else
        return Token.IDENTIFIER;
    }
    else if (ch >= '0' && ch <= '9') {
      CharBuffer cb = _cb;
      cb.clear();

      Token type = Token.INTEGER;

      if (sign < 0)
        cb.append('-');

      for (; ch >= '0' && ch <= '9'; ch = read())
        cb.append((char) ch);

      if (ch == '.') {
        type = Token.DOUBLE;

        cb.append('.');
        for (ch = read(); ch >= '0' && ch <= '9'; ch = read())
          cb.append((char) ch);
      }

      if (ch == 'e' || ch == 'E') {
        type = Token.DOUBLE;

        cb.append('e');
        if ((ch = read()) == '+' || ch == '-') {
          cb.append((char) ch);
          ch = read();
        }

        if (! (ch >= '0' && ch <= '9'))
          throw error(L.l("exponent needs digits at {0}",
                          charName(ch)));

        for (; ch >= '0' && ch <= '9'; ch = read())
          cb.append((char) ch);
      }

      if (ch == 'F' || ch == 'D')
        type = Token.DOUBLE;
      else if (ch == 'L') {
        type = Token.LONG;
      }
      else
        unread(ch);

      _lexeme = cb.toString();

      return type;
    }
    else if (ch == '\'') {
      CharBuffer cb = _cb;
      cb.clear();

      for (ch = read(); ch >= 0; ch = read()) {
        if (ch == '\'') {
          if ((ch = read()) == '\'')
            cb.append('\'');
          else {
            unread(ch);
            break;
          }
        }
        else if (ch == '\\') {
          ch = read();

          if (ch >= 0)
            cb.append(ch);
        }
        else
          cb.append((char) ch);
      }

      _lexeme = cb.toString();

      return Token.STRING;
    }
    else if (ch == '#') {
      // skip comment
      while ((ch = read()) >= 0 && ch != '\n' && ch != '\r') {
      }

      // XXX: cleanup to avoid recursion
      return scanToken();
    }

    throw error(L.l("unexpected char at {0} ({1})", "" + (char) ch,
                    String.valueOf(ch)));
  }
528933
public String getCharacterEncoding() {

		if (this.message.getContentEncoding() != null) {
			return this.message.getContentEncoding().getEncoding();
		} else {
			ContentTypeHeader cth = (ContentTypeHeader)
				this.message.getHeader(ContentTypeHeader.NAME);
			if(cth == null) return null;
			return cth.getParameter("charset");
		}
	}
937316
public boolean contentEquals(CharSequence a) {
        if (a == null || a.length() != length()) {
            return false;
        }
        if (a.getClass() == AsciiString.class) {
            return equals(a);
        }

        for (int i = arrayOffset(), j = 0; j < a.length(); ++i, ++j) {
            if (b2c(value[i]) != a.charAt(j)) {
                return false;
            }
        }
        return true;
    }