This commit is contained in:
Robert Vokac 2024-12-20 20:22:27 +01:00
parent 0c825f6b5f
commit bc60a8f561
Signed by: robertvokac
GPG Key ID: FB9CE8E20AADA55F
20 changed files with 214 additions and 21 deletions

View File

@ -19,6 +19,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@AdditionalClassForDotNetSimulation
public @interface Const {
public @interface const_ {
String description() default "";
}

View File

@ -8,13 +8,13 @@ package com.openeggbert.jdotnet.JDotNet.CSharpKeyWords;
*
* @author robertvokac
*/
public class Default_ {
public class default_ {
private Default_() {
private default_() {
//Not meant to be instantiated.
}
public static <T extends Struct<T>> T default_(T instance) {
public static <T extends struct<T>> T default_(T instance) {
instance.reset();
return instance;
}

View File

@ -0,0 +1,24 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.JDotNet.CSharpKeyWords;
import com.openeggbert.jdotnet.JDotNet.AdditionalClassForDotNetSimulation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* @author robertvokac
* Simulates the C# key word internal.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR})
@AdditionalClassForDotNetSimulation
public @interface internal {
String description() default "";
}

View File

@ -19,6 +19,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@AdditionalClassForDotNetSimulation
public @interface Namespace {
public @interface namespace {
String name();
}

View File

@ -19,6 +19,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@AdditionalClassForDotNetSimulation
public @interface Nullable {
public @interface nullable {
String description() default "";
}

View File

@ -19,6 +19,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@AdditionalClassForDotNetSimulation
public @interface Out {
public @interface out {
String description() default "";
}

View File

@ -17,8 +17,8 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Target({ElementType.TYPE_USE, ElementType.FIELD})
@AdditionalClassForDotNetSimulation
public @interface Readonly {
public @interface readonly {
String description() default "";
}

View File

@ -19,6 +19,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@AdditionalClassForDotNetSimulation
public @interface Ref {
public @interface ref {
String description() default "";
}

View File

@ -19,6 +19,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@AdditionalClassForDotNetSimulation
public @interface StaticClass {
public @interface static_ {
String description() default "";
}

View File

@ -12,7 +12,7 @@ import com.openeggbert.jdotnet.JDotNet.AdditionalClassForDotNetSimulation;
*/
@AdditionalClassForDotNetSimulation
public abstract class Struct<T> {
public abstract class struct<T> {
public abstract T copy();
/**
* Sets this class to its default values.

View File

@ -0,0 +1,43 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.System;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.struct;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.readonly;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.const_;
/**
*
* @author robertvokac
*/
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@readonly
class Boolean extends struct<Boolean> {
protected Boolean() {
this.m_value = false;
//Not meant to be instantiated.
}
private @readonly final boolean m_value;
public boolean get() {
return m_value;
}
public static Boolean of(boolean b) {
return new Boolean(b);
}
@Override
public Boolean copy() {
return new Boolean(m_value);
}
@Override
public Boolean reset() {
throw new UnsupportedOperationException();
}
}

View File

@ -4,6 +4,7 @@
*/
package com.openeggbert.jdotnet.System.Collections.Generic;
import com.openeggbert.jdotnet.System.IO.Stream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@ -57,4 +58,18 @@ public class List_<T> implements Iterable<T> {
return internalList.contains(o);
}
public boolean Any() {
return !internalList.isEmpty();
}
public void RemoveAt(int i) {
internalList.remove(i);
}
public int Count() {
return internalList.size();
}
public java.util.stream.Stream<T> stream() {
return internalList.stream();
}
}

View File

@ -0,0 +1,13 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.System.Reflection;
/**
*
* @author robertvokac
*/
public class Assembly {
}

View File

@ -0,0 +1,26 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.System.Resources;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.nullable;
import com.openeggbert.jdotnet.System.Globalization.CultureInfo;
import com.openeggbert.jdotnet.System.Reflection.Assembly;
/**
*
* @author robertvokac
*/
public class ResourceManager {
public static String GetString(String name, @nullable CultureInfo culture) {
return null;
//todo
}
public ResourceManager(String windowsPhoneSpeedyBlupiResource, Assembly Assembly) {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -4,7 +4,7 @@
*/
package com.openeggbert.jdotnet.System;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Struct;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.struct;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
@ -14,7 +14,7 @@ import lombok.NoArgsConstructor;
*/
@AllArgsConstructor
@NoArgsConstructor
public class TimeSpan extends Struct<TimeSpan> {
public class TimeSpan extends struct<TimeSpan> {
public static TimeSpan FromTicks(long ticks) {return null;}
public static TimeSpan FromSeconds(double seconds) {return null;}
private long _ticks;

View File

@ -0,0 +1,23 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.System;
import com.openeggbert.jdotnet.System.Reflection.Assembly;
/**
*
* @author robertvokac
*/
public class Type {
public Assembly Assembly() {
return null;
//todo
}
public static Type typeof(Class clazz) {
return null;
//todo
}
}

View File

@ -4,18 +4,29 @@
*/
package com.openeggbert.jdotnet.System;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.Const;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.struct;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.const_;
/**
*
* @author robertvokac
*/
public class UInt32 {
public class UInt32 extends struct<UInt32> {
protected UInt32() {
//Not meant to be instantiated.
}
public @Const static final long MaxValue = 0xFFFFFFFFL; // 32-bit unsigned maximum value
public @Const static final long MinValue = 0;
public @const_ static final long MaxValue = 0xFFFFFFFFL; // 32-bit unsigned maximum value
public @const_ static final long MinValue = 0;
@Override
public UInt32 copy() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
@Override
public UInt32 reset() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}
}

View File

@ -0,0 +1,17 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.System;
/**
*
* @author robertvokac
*/
class bool extends Boolean {
public static bool of(boolean b) {
return (bool) of(b);
}
}

View File

@ -0,0 +1,19 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.openeggbert.jdotnet.System;
import com.openeggbert.jdotnet.JDotNet.CSharpKeyWords.nullable;
/**
*
* @author robertvokac
*/
public class object {
public static boolean ReferenceEquals(@nullable Object objA, @nullable Object objB) {
if(objA == null && objB == null) {return true;}
if(objA == null || objB == null) {return false;}
return objA.equals(objB);
}
}

View File

@ -4,12 +4,14 @@
*/
package com.openeggbert.jdotnet.System;
/**
*
* @author robertvokac
*/
public class string extends String_ {
public string(char ch, int times) {
super(ch, times);
}
}