当前位置: 首页>>代码示例>>Java>>正文


Java IString类代码示例

本文整理汇总了Java中org.eclipse.imp.pdb.facts.IString的典型用法代码示例。如果您正苦于以下问题:Java IString类的具体用法?Java IString怎么用?Java IString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IString类属于org.eclipse.imp.pdb.facts包,在下文中一共展示了IString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: eval

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
public IString eval(IString s) {
	EvalUtilities util = new EvalUtilities();

	IExpr result;

	try {
		StringBufferWriter buf = new StringBufferWriter();
		result = util.evaluate(s.getValue());
		OutputFormFactory.get().convert(buf, result);
		String output = buf.toString();
		return values.string(output);
	} catch (final Exception e) {
		System.err.printf(e.getMessage());
	} finally {
		ComputerThreads.terminate();
	}
	return s;
}
 
开发者ID:pieterhijma,项目名称:mcl,代码行数:19,代码来源:Evaluate.java

示例2: newString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
static IString newString(String value, boolean fullUnicode) {
	if (value ==null) value = "";
	if (fullUnicode) {
		return new FullUnicodeString(value);
	}
	return new SimpleUnicodeString(value);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:8,代码来源:StringValue.java

示例3: concat

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
@Override
public IString concat(IString other){
	StringBuilder buffer = new StringBuilder();
	buffer.append(value);
	buffer.append(other.getValue());
	
	return StringValue.newString(buffer.toString(), true);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:9,代码来源:StringValue.java

示例4: compare

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
@Override
public int compare(IString other){
	int result = value.compareTo(other.getValue());
	
	if(result > 0) return 1;
	if(result < 0) return -1;
	
	return 0;
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:10,代码来源:StringValue.java

示例5: string

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
@Override
public IString string(int[] chars) {
	StringBuilder b = new StringBuilder(chars.length);
	for (int ch : chars) {
		b.appendCodePoint(ch);
	}
	return string(b.toString());
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:9,代码来源:AbstractPrimitiveValueFactory.java

示例6: writeString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
private void writeString(IString string) throws IOException{
	out.write(STRING_HEADER);
	
	String theString = string.getValue();
	
	byte[] stringData = theString.getBytes(CharEncoding);
	printInteger(stringData.length);
	out.write(stringData);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:10,代码来源:BinaryWriter.java

示例7: readString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
private IString readString() throws IOException{
	int size = parseInteger();
	
	byte[] data = new byte[size];
	for(int i = 0; i< size; i++){
		data[i] = (byte) read();
	}
	
	return valueFactory.string(new String(data, BinaryWriter.CharEncoding));
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:11,代码来源:BinaryReader.java

示例8: visitString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
public IValue visitString(IString o) throws IOException {
	// TODO optimize this implementation and finish all escapes
	append('\"');
    append(o.getValue().replaceAll("\"", "\\\"").replaceAll("\n","\\\\n"));
    append('\"');
    return o;
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:8,代码来源:ATermWriter.java

示例9: readFixed

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
private void readFixed(Type expected, char end, List<IValue> arr, Map<String,IValue> kwParams) throws IOException {
	current = stream.read();
	
	for (int i = 0; current != end; i++) {
	  Type exp = expected.isFixedWidth() ? expected.getFieldType(i) : types.valueType();
	  IValue elem = readValue(exp);

	  if (current == '=') {
	    String label = ((IString) elem).getValue();
	    current = stream.read();
	    if (expected.isConstructor() && expected.hasField(label)) {
	      kwParams.put(label, readValue(expected.getFieldType(label)));
	    }
	    else {
	      kwParams.put(label, readValue(types.valueType()));
	    }
	  }
	  else {
	    arr.add(elem);
	  }

	  if (current != ',' || current == end) {
	    break; // no more elements, so expecting a 'end', or '='
	  }
	  current = stream.read();
	}
	
	checkAndRead(end);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:30,代码来源:StandardTextReader.java

示例10: visitString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
public T visitString(IString o) throws E {
	return fVisitor.visitString(o);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:4,代码来源:VisitorAdapter.java

示例11: visitString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
public T visitString(IString o)  throws E{
	return null;
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:4,代码来源:NullVisitor.java

示例12: visitString

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
public IValue visitString(IString o)  throws E{
	return o;
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:4,代码来源:IdentityVisitor.java

示例13: reverse

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
@Override
public IString reverse() {
	StringBuilder b = new StringBuilder(value);
	return newString(b.reverse().toString(), true);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:6,代码来源:StringValue.java

示例14: substring

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
@Override
public IString substring(int start, int end) {
	 return newString(value.substring(value.offsetByCodePoints(0, start),value.offsetByCodePoints(0, end)));
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:5,代码来源:StringValue.java

示例15: string

import org.eclipse.imp.pdb.facts.IString; //导入依赖的package包/类
public IString string(String s) {
	return adapted.string(s);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:4,代码来源:AbstractValueFactoryAdapter.java


注:本文中的org.eclipse.imp.pdb.facts.IString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。