本文整理汇总了Java中java.lang.System类的典型用法代码示例。如果您正苦于以下问题:Java System类的具体用法?Java System怎么用?Java System使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System类属于java.lang包,在下文中一共展示了System类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAuxVerb2
import java.lang.System; //导入依赖的package包/类
public static boolean checkAuxVerb2(byte[] Verb) /****new*****/
{
byte ththu[]={20,20,5},nththu[]={21,20,5},nthth[]={21,20},thu[]={20,5},aamal[]={2,23,1,26};
byte e[]={3},y[]={24},yy[]={24,24},va[]={27,1},th[]={20},pp[]={22,22},kk[]={14,14},k[]={14},r[]={25};
if((Verb.length > kond.length)&&ByteMeth.endsWith(Verb,kond))
{
System.out.println("Auxverb2");
byte auxVerb[]=ByteMeth.subArray(Verb,Verb.length-kond.length,Verb.length);
auxVerb = ByteMeth.addArray(auxVerb,u);
byte mainVerb[]=ByteMeth.subArray(Verb,0,(Verb.length-kond.length));
s.push("\n"+tabconvert2.revert(auxVerb)+" (�������)");
if(ByteMeth.endsWith(mainVerb,k))
mainVerb = ByteMeth.subArray(mainVerb,0,mainVerb.length-1);
checkVbp(mainVerb);
return true;
}
else
return false;
}
示例2: checkVidu
import java.lang.System; //导入依赖的package包/类
public static boolean checkVidu(byte[] byteVerb) /****new*****/
{
if((byteVerb.length > vidu.length)&&ByteMeth.endsWith(byteVerb,vidu))
{
System.out.println("checkVidu");
byte auxVerb[]=ByteMeth.subArray(byteVerb,byteVerb.length-vidu.length,byteVerb.length);
byte mainVerb[]=ByteMeth.subArray(byteVerb,0,(byteVerb.length-vidu.length));
s.push("\n"+tabconvert2.revert(auxVerb)+" (�������)");
checkVbp(mainVerb);
checkAuxTheer();
checkAuxKattu();
return true;
}
else
return false;
}
示例3: checkTheer
import java.lang.System; //导入依赖的package包/类
public static boolean checkTheer(byte[] str) /****new*****/
{
byte th[]={20};
if((str.length > theer.length)&&ByteMeth.endsWith(str,theer))
{
System.out.println("checkTheer");
byte auxVerb[]=ByteMeth.subArray(str,str.length-theer.length,str.length);
byte mainVerb[]=ByteMeth.subArray(str,0,(str.length-theer.length));
s.push("\n"+tabconvert2.revert(auxVerb)+" (�������)");
if(ByteMeth.endsWith(mainVerb,th))
mainVerb = ByteMeth.subArray(mainVerb,0,mainVerb.length-1);
checkVbp(mainVerb);
return true;
}
else
return false;
}
示例4: checkKattu
import java.lang.System; //导入依赖的package包/类
public static boolean checkKattu(byte[] str) /****new*****/
{
byte k[]={14};
if((str.length > kattu.length)&&ByteMeth.endsWith(str,kattu))
{
System.out.println("checkKattu");
byte auxVerb[]=ByteMeth.subArray(str,str.length-kattu.length,str.length);
byte mainVerb[]=ByteMeth.subArray(str,0,(str.length-kattu.length));
s.push("\n"+tabconvert2.revert(auxVerb)+" (�������)");
if(ByteMeth.endsWith(mainVerb,k))
mainVerb = ByteMeth.subArray(mainVerb,0,mainVerb.length-1);
checkVbp(mainVerb);
return true;
}
else
return false;
}
示例5: check_akku
import java.lang.System; //导入依赖的package包/类
public static boolean check_akku(byte h1[])
{
String spchk;
if(h1.length < akku.length)
return false;
if(ByteMeth.endsWith(h1,akku))
{
System.out.println("akku_ok");
byte r[]=ByteMeth.subArray(h1,h1.length-akku.length,h1.length);
byte a[]=ByteMeth.subArray(h1,0,(h1.length-akku.length));
s.push("\n"+tabconvert2.revert(r)+"<case>");
s.push("\n"+tabconvert2.revert(a)+"(noun)");
return(true);
}
else
return(false);
}
示例6: check_odu1
import java.lang.System; //导入依赖的package包/类
public static boolean check_odu1(byte h1[])
{
String spchk;
if(h1.length < odu1.length)
return false;
if(ByteMeth.endsWith(h1,odu1))
{
System.out.println("odu1_ok");
byte r[]=ByteMeth.subArray(h1,h1.length-3,h1.length);
byte a[]=ByteMeth.subArray(h1,0,(h1.length-odu1.length));
s.push("\n"+tabconvert2.revert(r)+"<case>");
plural(a);
if(!splitCompletedInPlural)
checkdata(a,odu1);
/*if(ByteMeth.endsWith(a,thth)||ByteMeth.endsWith(a,tt)||ByteMeth.endsWith(a,in)||ByteMeth.endsWith(a,iv)||ByteMeth.endsWith(a,y))
System.out.println("sorry");
else
s.push("\n"+" "+tabconvert2.revert(a)+" <noun>");*/
return(true);
}
else
return(false);
}
示例7: main
import java.lang.System; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
boolean endResult = true;
if (!arePaddedPairwise(R1.class, "int1", "int2")) {
System.err.println("R1 failed");
endResult &= false;
}
if (!arePaddedPairwise(R2.class, "int1", "int2")) {
System.err.println("R2 failed");
endResult &= false;
}
if (!arePaddedPairwise(R3.class, "int1", "int2")) {
System.err.println("R3 failed");
endResult &= false;
}
System.out.println(endResult ? "Test PASSES" : "Test FAILS");
if (!endResult) {
throw new Error("Test failed");
}
}
示例8: wrapperPublicPriviteKeyTest
import java.lang.System; //导入依赖的package包/类
private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms)
throws NoSuchAlgorithmException, InvalidKeyException,
NoSuchPaddingException, IllegalBlockSizeException,
InvalidAlgorithmParameterException {
for (String algo : algorithms) {
// Key pair generated
System.out.println("Generate key pair (algorithm: " + algo
+ ", provider: " + p.getName() + ")");
KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo);
kpg.initialize(512);
KeyPair kp = kpg.genKeyPair();
// key generated
String algoWrap = "DES";
KeyGenerator kg = KeyGenerator.getInstance(algoWrap, p);
Key key = kg.generateKey();
wrapTest(algo, algoWrap, key, kp.getPrivate(), Cipher.PRIVATE_KEY,
false);
wrapTest(algo, algoWrap, key, kp.getPublic(), Cipher.PUBLIC_KEY,
false);
}
}
示例9: testStreamZip
import java.lang.System; //导入依赖的package包/类
@Test
public void testStreamZip() throws IOException {
try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), "input.zip"))) {
zf.stream().forEach(e -> assertTrue(e instanceof ZipEntry));
zf.stream().forEach(e -> assertEquals(e.toString(), "ReadZip.java"));
Object elements[] = zf.stream().toArray();
assertEquals(1, elements.length);
assertEquals(elements[0].toString(), "ReadZip.java");
}
}
示例10: readyToConnect
import java.lang.System; //导入依赖的package包/类
/**
* Check whether we can connect, according to our policies.
* Currently, checks that we've waited TIME_BETWEEN_EXCHANGES_MILLIS
* milliseconds since the last exchange and that we're not already connecting.
*
* @return Whether or not we're ready to connect to a peer.
* @see TIME_BETWEEN_EXCHANGES_MILLIS
* @see getConnecting
*/
private boolean readyToConnect() {
long now = System.currentTimeMillis();
long lastExchangeMillis = mStore.getLong(LAST_EXCHANGE_TIME_KEY, -1);
boolean timeSinceLastOK;
if (lastExchangeMillis == -1) {
timeSinceLastOK = true;
} else if (now - lastExchangeMillis < TIME_BETWEEN_EXCHANGES_MILLIS) {
timeSinceLastOK = false;
} else {
timeSinceLastOK = true;
}
Log.v(TAG, "Ready to connect? " + (timeSinceLastOK && !getConnecting()));
Log.v(TAG, "Connecting: " + getConnecting());
Log.v(TAG, "timeSinceLastOK: " + timeSinceLastOK);
return timeSinceLastOK && !getConnecting();
}
示例11: success
import java.lang.System; //导入依赖的package包/类
@Override
public void success(Exchange exchange) {
// Latency of communication: Stop timer here.
long exchangeStopTimeMillis = System.currentTimeMillis();
// Latency of communication: Calculate RTT from # of round trips in exchange.
// In this case, we're using a NonceEchoExchange, which includes one round-trip,
// so the RTT time is just the time between the start and end of the exchange.
long rttMillis = exchangeStopTimeMillis - exchangeStartTimeMillis;
// Latency of communication: Record RTT and any other parameters.
// TODO(lerner): Record time.
String init = exchange.asInitiator ? "initiator" : "listener";
Log.i(TAG, String.format("Exchange complete as %s, took %d milliseconds", init, rttMillis));
BluetoothSocket activeSocket = (mSocket != null) ? mSocket : mBluetoothSpeaker.mSocket;
RangzenService.this.logEventToCSV(new String[] {
activeSocket.getRemoteDevice().getAddress(),
init,
Long.toString(System.currentTimeMillis()),
Long.toString(rttMillis)
});
RangzenService.this.cleanupAfterExchange();
}
示例12: if
import java.lang.System; //导入依赖的package包/类
/***************************************************************
function: print_set
**************************************************************/
void print_set
(
Vector nfa_set
)
{
int size;
int elem;
CNfa nfa;
size = nfa_set.size();
if (0 == size)
{
System.out.print("empty ");
}
for (elem = 0; elem < size; ++elem)
{
nfa = (CNfa) nfa_set.elementAt(elem);
/*System.out.print(m_spec.m_nfa_states.indexOf(nfa) + " ");*/
System.out.print(nfa.m_label + " ");
}
}
示例13: importStaticDynamic
import java.lang.System; //导入依赖的package包/类
@Ignore("addStaticImport doesn't support members with $L")
@Test
public void importStaticDynamic()
{
JavaFile source = JavaFile.builder("com.squareup.tacos",
TypeSpec.classBuilder("Taco")
.addMethod(MethodSpec.methodBuilder("main")
.addStatement("$T.$L.println($S)", System.class, "out", "hello")
.build())
.build())
.addStaticImport(System.class, "out")
.build();
assertThat(source.toString()).isEqualTo(""
+ "package com.squareup.tacos;\n"
+ "\n"
+ "import static java.lang.System.out;\n"
+ "\n"
+ "class Taco {\n"
+ " void main() {\n"
+ " out.println(\"hello\");\n"
+ " }\n"
+ "}\n");
}
示例14: importStaticUsingWildcards
import java.lang.System; //导入依赖的package包/类
@Test
public void importStaticUsingWildcards()
{
assertThat(JavaFile.builder("readme", importStaticTypeSpec("Util"))
.addStaticImport(TimeUnit.class, "*")
.addStaticImport(System.class, "*")
.build().toString()).isEqualTo(""
+ "package readme;\n"
+ "\n"
+ "import static java.lang.System.*;\n"
+ "import static java.util.concurrent.TimeUnit.*;\n"
+ "\n"
+ "class Util {\n"
+ " public static long minutesToSeconds(long minutes) {\n"
+ " gc();\n"
+ " return SECONDS.convert(minutes, MINUTES);\n"
+ " }\n"
+ "}\n");
}
示例15: defaultPackage
import java.lang.System; //导入依赖的package包/类
@Test
public void defaultPackage()
throws Exception
{
String source = JavaFile.builder("",
TypeSpec.classBuilder("HelloWorld")
.addMethod(MethodSpec.methodBuilder("main")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.addParameter(String[].class, "args")
.addCode("$T.out.println($S);\n", System.class, "Hello World!")
.build())
.build())
.build()
.toString();
assertThat(source).isEqualTo(""
+ "import java.lang.String;\n"
+ "import java.lang.System;\n"
+ "\n"
+ "class HelloWorld {\n"
+ " public static void main(String[] args) {\n"
+ " System.out.println(\"Hello World!\");\n"
+ " }\n"
+ "}\n");
}