Skip to content

Commit

Permalink
Refactor code to create fully qualified packages
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Oct 31, 2024
1 parent 67158e9 commit 303db99
Show file tree
Hide file tree
Showing 101 changed files with 30,356 additions and 30,090 deletions.
2 changes: 1 addition & 1 deletion java/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifest-Version: 1.0
Built-By: flanglet
Main-Class: kanzi.app.Kanzi
Main-Class: io.github.flanglet.kanzi.app.Kanzi

20 changes: 10 additions & 10 deletions java/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
destdir="${build.dir}/classes"
classpath="${build.dir}/classes"
debug="on">
<include name="kanzi/*.java"/>
<include name="kanzi/app/**"/>
<include name="kanzi/bitstream/**"/>
<include name="kanzi/entropy/**"/>
<include name="kanzi/function/**"/>
<include name="kanzi/io/**"/>
<include name="kanzi/transform/**"/>
<include name="kanzi/util/*.java"/>
<include name="kanzi/util/hash/**"/>
<include name="kanzi/util/sort/**"/>
<include name="io/github/flanglet/kanzi/*.java"/>
<include name="io/github/flanglet/kanzi/app/**"/>
<include name="io/github/flanglet/kanzi/bitstream/**"/>
<include name="io/github/flanglet/kanzi/entropy/**"/>
<include name="io/github/flanglet/kanzi/function/**"/>
<include name="io/github/flanglet/kanzi/io/**"/>
<include name="io/github/flanglet/kanzi/transform/**"/>
<include name="io/github/flanglet/kanzi/util/*.java"/>
<include name="io/github/flanglet/kanzi/util/hash/**"/>
<include name="io/github/flanglet/kanzi/util/sort/**"/>
</javac>
</target>

Expand Down
2 changes: 0 additions & 2 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -111,7 +110,6 @@
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kanzi;


public interface ArrayComparator
{
// Given an array (not provided here), return how the
// sub-array starting at lidx compares to that starting at ridx
public int compare(int lidx, int ridx);
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package io.github.flanglet.kanzi;


public interface ArrayComparator
{
// Given an array (not provided here), return how the
// sub-array starting at lidx compares to that starting at ridx
public int compare(int lidx, int ridx);
}
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kanzi;


public class BitStreamException extends RuntimeException
{
private static final long serialVersionUID = 7279737120722476336L;

public static final int UNDEFINED = 0;
public static final int INPUT_OUTPUT = 1;
public static final int END_OF_STREAM = 2;
public static final int INVALID_STREAM = 3;
public static final int STREAM_CLOSED = 4;

private final int code;


protected BitStreamException()
{
this.code = UNDEFINED;
}


public BitStreamException(String message, int code)
{
super(message);
this.code = code;
}


public BitStreamException(String message, Throwable cause, int code)
{
super(message, cause);
this.code = code;
}


public BitStreamException(Throwable cause, int code)
{
super(cause);
this.code = code;
}


public int getErrorCode()
{
return this.code;
}
}
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package io.github.flanglet.kanzi;


public class BitStreamException extends RuntimeException
{
private static final long serialVersionUID = 7279737120722476336L;

public static final int UNDEFINED = 0;
public static final int INPUT_OUTPUT = 1;
public static final int END_OF_STREAM = 2;
public static final int INVALID_STREAM = 3;
public static final int STREAM_CLOSED = 4;

private final int code;


protected BitStreamException()
{
this.code = UNDEFINED;
}


public BitStreamException(String message, int code)
{
super(message);
this.code = code;
}


public BitStreamException(String message, Throwable cause, int code)
{
super(message, cause);
this.code = code;
}


public BitStreamException(Throwable cause, int code)
{
super(cause);
this.code = code;
}


public int getErrorCode()
{
return this.code;
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kanzi;


public interface ByteSorter
{
public boolean sort(byte[] array, int idx, int len);
}
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package io.github.flanglet.kanzi;


public interface ByteSorter
{
public boolean sort(byte[] array, int idx, int len);
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kanzi;


public interface ByteTransform
{
// Read src.length bytes from src.array[src.index], process them and
// write them to dst.array[dst.index]. The index of each slice is updated
// with the number of bytes respectively read from and written to.
public boolean forward(SliceByteArray src, SliceByteArray dst);


// Read src.length bytes from src.array[src.index], process them and
// write them to dst.array[dst.index]. The index of each slice is updated
// with the number of bytes respectively read from and written to.
public boolean inverse(SliceByteArray src, SliceByteArray dst);


// Return the max size required for the output buffer
public int getMaxEncodedLength(int srcLength);
}

/*
Copyright 2011-2024 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package io.github.flanglet.kanzi;


public interface ByteTransform
{
// Read src.length bytes from src.array[src.index], process them and
// write them to dst.array[dst.index]. The index of each slice is updated
// with the number of bytes respectively read from and written to.
public boolean forward(SliceByteArray src, SliceByteArray dst);


// Read src.length bytes from src.array[src.index], process them and
// write them to dst.array[dst.index]. The index of each slice is updated
// with the number of bytes respectively read from and written to.
public boolean inverse(SliceByteArray src, SliceByteArray dst);


// Return the max size required for the output buffer
public int getMaxEncodedLength(int srcLength);
}
Loading

0 comments on commit 303db99

Please sign in to comment.