本文整理汇总了Java中org.yaml.snakeyaml.scanner.Constant类的典型用法代码示例。如果您正苦于以下问题:Java Constant类的具体用法?Java Constant怎么用?Java Constant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Constant类属于org.yaml.snakeyaml.scanner包,在下文中一共展示了Constant类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: forward
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
/**
* read the next length characters and move the pointer.
*
* @param length
*/
public void forward(int length) {
if (this.pointer + length + 1 >= this.buffer.length()) {
update();
}
char ch = 0;
for (int i = 0; i < length; i++) {
ch = this.buffer.charAt(this.pointer);
this.pointer++;
this.index++;
if (Constant.LINEBR.has(ch) || (ch == '\r' && buffer.charAt(pointer) != '\n')) {
this.line++;
this.column = 0;
} else if (ch != '\uFEFF') {
this.column++;
}
}
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:23,代码来源:StreamReader.java
示例2: forward
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
/**
* read the next length characters and move the pointer.
* if the last character is high surrogate one more character will be read
*
* @param length amount of characters to move forward
*/
public void forward(int length) {
int c;
for (int i = 0; i < length; i++) {
if (this.pointer == this.buffer.length()) {
update();
}
if (this.pointer == this.buffer.length()) {
break;
}
c = this.buffer.codePointAt(this.pointer);
this.pointer += Character.charCount(c);
this.index += Character.charCount(c);
if (Constant.LINEBR.has(c) || (c == '\r' && buffer.charAt(pointer) != '\n')) {
this.line++;
this.column = 0;
} else if (c != 0xFEFF) {
this.column++;
}
}
if (this.pointer == this.buffer.length()) {
update();
}
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:32,代码来源:StreamReader.java
示例3: determineBlockHints
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
private String determineBlockHints(String text)
{
StringBuilder hints = new StringBuilder();
// if (Constant.LINEBR.has(text.charAt(0), " ")) disabled, always add indent marker to prevent formatting problems.
{
hints.append(this.bestIndent);
}
char ch1 = text.charAt(text.length() - 1);
if (Constant.LINEBR.hasNo(ch1))
{
hints.append("-");
}
else if ((text.length() == 1) || Constant.LINEBR.has(text.charAt(text.length() - 2)))
{
hints.append("+");
}
return hints.toString();
}
开发者ID:Diorite,项目名称:Diorite,代码行数:19,代码来源:Emitter.java
示例4: forward
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
/**
* read the next length characters and move the pointer.
*
*/
public void forward(final int length) {
if (this.pointer + length + 1 >= this.buffer.length()) {
update();
}
char ch = 0;
for (int i = 0; i < length; i++) {
ch = this.buffer.charAt(this.pointer);
this.pointer++;
this.index++;
if (Constant.LINEBR.has(ch) || (ch == '\r' && buffer.charAt(pointer) != '\n')) {
this.line++;
this.column = 0;
} else if (ch != '\uFEFF') {
this.column++;
}
}
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:22,代码来源:StreamReader.java
示例5: determineBlockHints
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
private String determineBlockHints(String text) {
StringBuilder hints = new StringBuilder();
if (Constant.LINEBR.has(text.charAt(0), " ")) {
hints.append(bestIndent);
}
char ch1 = text.charAt(text.length() - 1);
if (Constant.LINEBR.hasNo(ch1)) {
hints.append("-");
} else if (text.length() == 1 || Constant.LINEBR.has(text.charAt(text.length() - 2))) {
hints.append("+");
}
return hints.toString();
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:14,代码来源:Emitter.java
示例6: isLineBreak
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
private boolean isLineBreak(char ch) {
return Constant.NULL_OR_LINEBR.has(ch);
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:4,代码来源:Mark.java
示例7: writeLiteral
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
void writeLiteral(String text) throws IOException {
String hints = determineBlockHints(text);
writeIndicator("|" + hints, true, false, false);
if (hints.length() > 0 && (hints.charAt(hints.length() - 1)) == '+') {
openEnded = true;
}
writeLineBreak(null);
boolean breaks = true;
int start = 0, end = 0;
while (end <= text.length()) {
char ch = 0;
if (end < text.length()) {
ch = text.charAt(end);
}
if (breaks) {
if (ch == 0 || Constant.LINEBR.hasNo(ch)) {
String data = text.substring(start, end);
for (char br : data.toCharArray()) {
if (br == '\n') {
writeLineBreak(null);
} else {
writeLineBreak(String.valueOf(br));
}
}
if (ch != 0) {
writeIndent();
}
start = end;
}
} else {
if (ch == 0 || Constant.LINEBR.has(ch)) {
stream.write(text, start, end - start);
if (ch == 0) {
writeLineBreak(null);
}
start = end;
}
}
if (ch != 0) {
breaks = Constant.LINEBR.has(ch);
}
end++;
}
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:45,代码来源:Emitter.java
示例8: isLineBreak
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
private boolean isLineBreak(int c) {
return Constant.NULL_OR_LINEBR.has(c);
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:4,代码来源:Mark.java
示例9: writeLiteral
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
void writeLiteral(String text) throws IOException
{
String hints = this.determineBlockHints(text);
this.writeIndicator("|" + hints, true, false, false);
if (! hints.isEmpty() && ((hints.charAt(hints.length() - 1)) == '+'))
{
this.openEnded = true;
}
this.writeLineBreak(null);
boolean breaks = true;
int start = 0, end = 0;
while (end <= text.length())
{
char ch = 0;
if (end < text.length())
{
ch = text.charAt(end);
}
if (breaks)
{
if ((ch == 0) || Constant.LINEBR.hasNo(ch))
{
String data = text.substring(start, end);
for (char br : data.toCharArray())
{
if (br == '\n')
{
this.writeLineBreak(null);
}
else
{
this.writeLineBreak(String.valueOf(br));
}
}
if (ch != 0)
{
this.writeIndent();
}
start = end;
}
}
else
{
if ((ch == 0) || Constant.LINEBR.has(ch))
{
this.stream.write(text, start, end - start);
if (ch == 0)
{
this.writeLineBreak(null);
}
start = end;
}
}
if (ch != 0)
{
breaks = Constant.LINEBR.has(ch);
}
end++;
}
}
开发者ID:Diorite,项目名称:Diorite,代码行数:61,代码来源:Emitter.java
示例10: writeLiteral
import org.yaml.snakeyaml.scanner.Constant; //导入依赖的package包/类
void writeLiteral(String text) throws IOException {
String hints = determineBlockHints(text);
writeIndicator("|" + hints, true, false, false);
if (hints.length() > 0 && (hints.charAt(hints.length() - 1)) == '+') {
openEnded = true;
}
writeLineBreak(null);
boolean breaks = true;
int start = 0, end = 0;
while (end <= text.length()) {
char ch = 0;
if (end < text.length()) {
ch = text.charAt(end);
}
if (breaks) {
if (ch == 0 || Constant.LINEBR.hasNo(ch)) {
String data = text.substring(start, end);
for (char br : data.toCharArray()) {
if (br == '\n') {
writeLineBreak(null);
} else {
writeLineBreak(String.valueOf(br));
}
}
if (ch != 0) {
writeIndent();
}
start = end;
}
} else {
if (ch == 0 || Constant.LINEBR.has(ch)) {
stream.write(text, start, end - start);
if (ch == 0) {
writeLineBreak(null);
}
start = end;
}
}
if (ch != 0) {
breaks = (Constant.LINEBR.has(ch));
}
end++;
}
}
开发者ID:timvisee,项目名称:TestTheTeacher,代码行数:45,代码来源:Emitter.java
注:本文中的org.yaml.snakeyaml.scanner.Constant类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论