Construct a FastStr instance from a collection of characters
@param col the character collection
@return a FastStr instance
160156
public static FastStr of(Collection<Character> col) {
        int sz = col.size();
        if (0 == sz) return EMPTY_STR;
        char[] buf = new char[sz];
        Iterator<Character> itr = col.iterator();
        int i = 0;
        while (itr.hasNext()) {
            buf[i++] = itr.next();
        }
        return new FastStr(buf, 0, sz);
    }
335196
public static Type toType(String columnDef) {
		if ("BIGINT".equalsIgnoreCase(columnDef))
			return Type.BIGINT;
		if ("BINARY".equalsIgnoreCase(columnDef))
			return Type.BINARY;
		if ("BIT".equalsIgnoreCase(columnDef))
			return Type.BIT;
		if ("BLOB".equalsIgnoreCase(columnDef))
			return Type.BLOB;
		if ("BOOLEAN".equalsIgnoreCase(columnDef))
			return Type.BOOLEAN;
		if ("CHAR".equalsIgnoreCase(columnDef))
			return Type.CHAR;
		if ("CLOB".equalsIgnoreCase(columnDef))
			return Type.CLOB;
		if ("DATE".equalsIgnoreCase(columnDef))
			return Type.DATE;
		if ("DECIMAL".equalsIgnoreCase(columnDef))
			return Type.DECIMAL;
		if ("DOUBLE".equalsIgnoreCase(columnDef))
			return Type.DOUBLE;
		if ("FLOAT".equalsIgnoreCase(columnDef))
			return Type.FLOAT;
		if ("INTEGER".equalsIgnoreCase(columnDef))
			return Type.INTEGER;
		if ("JAVA_OBJECT".equalsIgnoreCase(columnDef))
			return Type.JAVA_OBJECT;
		if ("LONGNVARCHAR".equalsIgnoreCase(columnDef))
			return Type.LONGNVARCHAR;
		if ("LONGVARBINARY".equalsIgnoreCase(columnDef))
			return Type.LONGVARBINARY;
		if ("LONGVARCHAR".equalsIgnoreCase(columnDef))
			return Type.LONGVARCHAR;
		if ("NCHAR".equalsIgnoreCase(columnDef))
			return Type.NCHAR;
		if ("NCLOB".equalsIgnoreCase(columnDef))
			return Type.NCLOB;
		if ("NUMERIC".equalsIgnoreCase(columnDef))
			return Type.NUMERIC;
		if ("NVARCHAR".equalsIgnoreCase(columnDef))
			return Type.NVARCHAR;
		if ("OTHER".equalsIgnoreCase(columnDef))
			return Type.OTHER;
		if ("REAL".equalsIgnoreCase(columnDef))
			return Type.REAL;
		if ("SMALLINT".equalsIgnoreCase(columnDef))
			return Type.SMALLINT;
		if ("TIME".equalsIgnoreCase(columnDef))
			return Type.TIME;
		if ("TIMESTAMP".equalsIgnoreCase(columnDef))
			return Type.TIMESTAMP;
		if ("TINYINT".equalsIgnoreCase(columnDef))
			return Type.TINYINT;
		if ("VARBINARY".equalsIgnoreCase(columnDef))
			return Type.VARBINARY;
		if ("VARCHAR".equalsIgnoreCase(columnDef))
			return Type.VARCHAR;
		// @formatter:on
		throw new DialectException("'" + columnDef + "' is not a legal SQL column definition name");
	}
371235
private static String transColumnNameToFieldName(String colName) {
		if (StrUtils.isEmpty(colName))
			return colName;
		if (!colName.contains("_"))
			return StrUtils.toLowerCaseFirstOne(colName);
		StringBuilder sb = new StringBuilder();
		char[] chars = colName.toLowerCase().toCharArray();
		for (int i = 0; i < chars.length; i++) {
			char c = chars[i];
			if (c == '_')
				continue;
			if ((i > 0) && (chars[i - 1]) == '_' && sb.length() > 0)
				sb.append(Character.toUpperCase(c));
			else
				sb.append(c);
		}
		return sb.toString();
	}
931362
protected TableColumnHeader createTableColumnHeader(TableColumnBase col) {
        return col.getColumns().isEmpty() ?
            new JFXTableColumnHeader(getTableViewSkin(), col) :
            new NestedTableColumnHeader(getTableViewSkin(), col);
    }
586555
public static String utf2string(byte[] src, int sindex, int len) {
        char dst[] = new char[len];
        int len1 = utf2chars(src, sindex, dst, 0, len);
        return new String(dst, 0, len1);
    }
562786
public static String generateCharsSymbolsString(int lenght) {
        StringBuffer buf = new StringBuffer(lenght);
        SecureRandom rand = new SecureRandom();
        for (int i = 0; i < lenght; i++) {
            buf.append(charsSymbols[rand.nextInt(charsSymbols.length)]);
        }
        return buf.toString();
    }
594935
function (column) {
            if (column.fixed) {
                return ["char(", column.size || 255, ")"].join("");
            } else if (column.text === false || column.size) {
                return ["varchar(", column.size || 255, ")"].join("");
            } else {
                return 'text';
            }

        }
1359339
private char nextChar() throws IOException {
		if (missedChar != null) {
			// RETURNS THE PREVIOUS PARSED CHAR
			c = missedChar.charValue();
			missedChar = null;

		} else {
			c = (char) in.read();

			if (c == '\\') {
				char c2 = (char) in.read();
				if (c2 == 'u') {
					// DECODE UNICODE CHAR
					final StringBuilder buff = new StringBuilder();
					for (int i = 0; i < 4; ++i)
						buff.append((char) in.read());

					cursor += 6;

					return (char) Integer.parseInt(buff.toString(), 16);
				} else {
					// REMEMBER THE CURRENT CHAR TO RETURN NEXT TIME
					missedChar = c2;
				}
			}
		}

		cursor++;

		if (c == NEW_LINE) {
			++lineNumber;
			columnNumber = 0;
		} else
			++columnNumber;

		return c;
	}

	public char lastChar() {
		return c;
	}

	public String getValue() {
		return value;
	}

	public int getLineNumber() {
		return lineNumber;
	}

	public int getColumnNumber() {
		return columnNumber;
	}

	public boolean hasNext() throws IOException {
		return in.ready();
	}
}
39318
def column_converter(string):
    
    column = string.strip(',')
    if '-' in column:
        column_range = map(int, column.split('-'))
        # For decreasing ranges, increment the larger value, reverse the
        # passing to range (so it will accept the input), and finally
        # reverse the output ([::-1])
        if column_range[0] > column_range[1]:
            column_range[0] += 1
            return [i for i in range(*column_range[::-1])][::-1]
        # For normal ranges, increment the larger value.
        column_range[1] += 1
        return [i for i in range(*column_range)]
    if ',' in column:
        columns = column.split(',')
        return map(int, columns)
    return [int(column)]
362649
public void addColumn(FastTrackColumn column)
   {
      FastTrackField type = column.getType();
      Object[] data = column.getData();
      for (int index = 0; index < data.length; index++)
      {
         MapRow row = getRow(index);
         row.getMap().put(type, data[index]);
      }
   }
1149623
private String translateColumnName(String srcColumnName, DataMediaPair dataMediaPair,
                                       Multimap<String, String> translateDict) {
        if (dataMediaPair.getColumnPairMode().isExclude() || CollectionUtils.isEmpty(dataMediaPair.getColumnPairs())) {
            return srcColumnName; // 默认同名
        }

        Collection<String> tColumnNames = translateDict.get(srcColumnName);
        if (CollectionUtils.isEmpty(tColumnNames)) {
            throw new TransformException(srcColumnName + " is not found in column pairs: " + translateDict.toString());
        }
        String columnName = tColumnNames.iterator().next();

        return columnName;
    }
860177
public static List<FastaSequence> readFasta(final InputStream inStream)
		throws IOException {
	final List<FastaSequence> seqs = new ArrayList<FastaSequence>();

	final BufferedReader infasta = new BufferedReader(
		new InputStreamReader(inStream, "UTF8"), 16000);
	final Pattern pattern = Pattern.compile("//s+");

	String line;
	String sname = "", seqstr = null;
	do {
		line = infasta.readLine();
		if ((line == null) || line.startsWith(">")) {
		if (seqstr != null) {
			seqs.add(new FastaSequence(sname.substring(1), seqstr));
		}
		sname = line; // remove >
		seqstr = "";
		} else {
		final String subseq = pattern.matcher(line).replaceAll("");
		seqstr += subseq;
		}
	} while (line != null);

	infasta.close();
	return seqs;
	}
955154
public static FastStr of(char[] ca) {
        if (ca.length == 0) return EMPTY_STR;
        char[] newArray = new char[ca.length];
        System.arraycopy(ca, 0, newArray, 0, ca.length);
        return new FastStr(ca);
    }
948703
@Override
    public FastStr replace(char oldChar, char newChar) {
        if (oldChar != newChar) {
            char[] val = this.buf; /* avoid getfield opcode */
            int len = length();
            int i = begin - 1;

            while (++i < end) {
                if (val[i] == oldChar) {
                    break;
                }
            }
            if (i < end) {
                char buf[] = new char[len];
                for (int j = begin; j < i; j++) {
                    buf[j - begin] = val[j];
                }
                while (i < end) {
                    char c = val[i];
                    buf[i - begin] = (c == oldChar) ? newChar : c;
                    i++;
                }
                return new FastStr(buf, 0, len);
            }
        }
        return this;
    }
659705
private Object getColumnTranslatedToJDBC( String columnName ) throws SQLException {
        notClosed();
        isRowSet();

        Value value = null;
        this.currentValue = null;

        try {
            value = row.getValue(columnName);
        } catch (javax.jcr.PathNotFoundException pnf) {
            // do nothing
        } catch (RepositoryException e) {
            throw new SQLException(e.getLocalizedMessage(), e);
        }

        if (value == null) return null;

        this.currentValue = JcrType.translateValueToJDBC(value);
        return this.currentValue;
    }
680647
public StringBuilder process(StringBuilder source) {
        CharSequence result = process((CharSequence) source);
        if (result instanceof StringBuilder) {
            return (StringBuilder) result;
        } else {
            return new StringBuilder(result);
        }
    }
526598
public static String colorToString(int col) {
    final char[] buf = new char[] { '#', 'X', 'X', 'X', 'X', 'X', 'X' };
    for(int i = 6; i > 0; i--) {
      final int v = (col & 0xF);
      buf[i] = (char) ((v < 10) ? ('0' + v) : ('a' + v - 10));
      col >>>= 4;
    }
    return new String(buf);
  }