當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。