This repository has been archived by the owner on May 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
async_when | async_while | async_loop_times | async_loop_till | async…
…_loop_times_w | async_loop_till_w | removed some redundant code
- Loading branch information
1 parent
6e16e3c
commit a38d182
Showing
18 changed files
with
494 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package pisi.unitedmeows.meowlib.async.states; | ||
|
||
@FunctionalInterface | ||
public interface IState { | ||
|
||
boolean state(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
package pisi.unitedmeows.meowlib.clazz; | ||
|
||
public class IProperty { | ||
public interface IProperty<X> { | ||
|
||
void set(X value); | ||
X get(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,39 @@ | ||
package pisi.unitedmeows.meowlib.clazz; | ||
|
||
public class onion { | ||
import pisi.unitedmeows.meowlib.memory.MMemory; | ||
|
||
public class onion<X> { | ||
|
||
private int pointer; | ||
|
||
public onion() { | ||
pointer = -1; | ||
} | ||
|
||
public onion(X value) { | ||
set(value); | ||
} | ||
|
||
public void set(X value) { | ||
if (pointer == -1) { | ||
pointer = MMemory.write(value); | ||
} else { | ||
MMemory.write(pointer, value); | ||
} | ||
} | ||
|
||
public X get() { | ||
if (pointer == -1) { | ||
return null; | ||
} | ||
|
||
return MMemory.read(pointer); | ||
} | ||
|
||
public void remove() { | ||
if (pointer != -1) { | ||
MMemory.remove(pointer); | ||
pointer = -1; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
package pisi.unitedmeows.meowlib.clazz; | ||
|
||
public class prop { | ||
import pisi.unitedmeows.meowlib.async.Promise; | ||
|
||
public class prop<X> implements IProperty<X> { | ||
|
||
protected X value; /* change this to some optional variable */ | ||
|
||
public prop() { } | ||
|
||
public prop(X _startObject) { | ||
value = _startObject; | ||
} | ||
|
||
@Override | ||
public void set(X value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public X get() { | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,44 @@ | ||
package pisi.unitedmeows.meowlib.clazz; | ||
|
||
public class type { | ||
|
||
public static boolean is_type(Object object, Class<?> ... types) { | ||
for (Class<?> type : types) { | ||
if (!type.isInstance(object)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public static <X> X cast(Object object) { | ||
return (X) object; | ||
} | ||
|
||
public static boolean same_type(Object object, Object... objects) { | ||
Class<?> type = typeof(object); | ||
for (Object obj : objects) { | ||
if (typeof(obj) != type) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public static Class<?>[] type_array(Object... objects) { | ||
Class<?> types[] = new Class<?>[objects.length]; | ||
int i = 0; | ||
for (Object parameter : objects) { | ||
types[i++] = type.typeof(parameter); | ||
} | ||
return types; | ||
} | ||
|
||
public static Class<?> typeof(Object object) { | ||
return object.getClass(); | ||
} | ||
|
||
public static String toString(Object object) { | ||
return object.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,35 @@ | ||
package pisi.unitedmeows.meowlib.encryption.memory; | ||
|
||
public class MString { | ||
import java.util.Arrays; | ||
|
||
/** | ||
* memory safe strings | ||
*/ | ||
public class MString implements Comparable<MString> { | ||
|
||
private char[] value; | ||
|
||
public MString(String input) { | ||
|
||
final String encrypted = input; | ||
|
||
value = new char[encrypted.length()]; | ||
int i = 0; | ||
for (char c : encrypted.toCharArray()) { | ||
value[i] = c; | ||
i++; | ||
} | ||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
// decrypt | ||
return value.toString(); | ||
} | ||
|
||
@Override | ||
public int compareTo(MString o) { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package pisi.unitedmeows.meowlib.etc; | ||
|
||
public class Filtere { | ||
public interface IFilter<X> { | ||
|
||
boolean check(X object); | ||
} |
Oops, something went wrong.