<commit_before># mirror
A Java representation of jQuery, using Reflection to interact with things.

jQuery is used to interact with the DOM in JavaScript. Java doesn't have a DOM, so the next best thing was Reflection, which interacts with everything in Java.

I recently found out `$` could be used as an identifier in Java, and I immediately thought of jQuery. jQuery messes with the DOM, Relfection messes with Classes. Put two and two together and we've got mirror!

##Use
The first thing you want to do is statically import Mirror.java:
```java
import static mirror.Mirror;
```
`$()` is the main method for mirror. It will get the class of what you input.
```java
int i = 7;
$(i); //returns a ReflectedClass of type Integer

$(i).print(); //prints 'java.lang.Integer'
```
All of the classes implement a Printable interface, so you can put `print()` anywhere in your chain to debug.

To invoke a method:
```java
String s = "Hello World";
$(s).getMethod("split").invoke(" "); //returns s.split(" ") (which happens to return void in this case)
```<commit_msg>you can do all the things<commit_after># mirror
A Java representation of jQuery, using Reflection to interact with things.

jQuery is used to interact with the DOM in JavaScript. Java doesn't have a DOM, so the next best thing was Reflection, which interacts with everything in Java.

I recently found out `$` could be used as an identifier in Java, and I immediately thought of jQuery. jQuery messes with the DOM, Relfection messes with Classes. Put two and two together and we've got mirror!

##Use
The first thing you want to do is statically import Mirror.java:
```java
import static mirror.Mirror;
```
`$()` is the main method for mirror. It will get the class of what you input.
```java
int i = 7;
$(i); //returns a ReflectedClass of type Integer

$(i).print(); //prints 'java.lang.Integer'
```
All of the classes implement a Printable interface, so you can put `print()` anywhere in your chain to debug.

To invoke a method:
```java
String s = "Hello World";
String[] a = $(s).getMethod("split", String.class).invoke(" "); //returns s.split(" ")
```

You can also set and get fields:
```java
String s = "Hello World";
$(s).setField("hash", -5);
int i = $(s).<Integer>getField("hash");
```
{'fraction_non_alphanumeric': 0.11037234042553191, 'fraction_numerical': 0.0013297872340425532, 'mean_word_length': 4.386634844868735, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6996856', 'n_tokens_mistral': 644, 'n_tokens_neox': 609, 'n_words': 339}