Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
86 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package xerial.larray.japi; | ||
|
||
import xerial.larray.DefaultAllocator; | ||
import xerial.larray.LByteArray; | ||
import xerial.larray.LIntArray; | ||
|
||
/** | ||
* Java interface of LArray | ||
* @author Taro L. Saito | ||
*/ | ||
public class LArray { | ||
|
||
static xerial.larray.MemoryAllocator defaultAllocator = new DefaultAllocator(); | ||
|
||
public static LIntArray newLIntArray(long size) { | ||
return new LIntArray(size, defaultAllocator); | ||
} | ||
|
||
public static LByteArray newLByteArray(long size) { | ||
return new LByteArray(size, defaultAllocator); | ||
} | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
//-------------------------------------- | ||
// | ||
// Logger.scala | ||
// Since: 2013/03/22 2:32 | ||
// | ||
//-------------------------------------- | ||
|
||
package xerial.larray | ||
|
||
/** | ||
* Logger wrapper for using [[xerial.core.log.Logger]] in Java | ||
* @author Taro L. Saito | ||
*/ | ||
class Logger(cl:Class[_]) { | ||
private val _logger = xerial.core.log.LoggerFactory(cl) | ||
|
||
def trace(m:String) { _logger.trace(m) } | ||
def debug(m:String) { _logger.debug(m) } | ||
def info(m:String) { _logger.info(m) } | ||
def warn(m:String) { _logger.warn(m) } | ||
def error(m:String) { _logger.error(m) } | ||
def fatal(m:String) { _logger.fatal(m) } | ||
|
||
} |
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,28 @@ | ||
package xerial.larray.japi; | ||
|
||
import junit.framework.Assert; | ||
import org.junit.Test; | ||
import xerial.larray.LIntArray; | ||
import xerial.larray.Logger; | ||
|
||
/** | ||
* @author Taro L. Saito | ||
*/ | ||
public class JLArrayTest { | ||
|
||
Logger _logger = new Logger(this.getClass()); | ||
|
||
@Test | ||
public void constructor() { | ||
|
||
LIntArray l = LArray.newLIntArray(5L); | ||
for (long i = 0; i < l.size(); ++i) l.update(i, (int) i * 2); | ||
_logger.debug(l.mkString(", ")); | ||
for (long i = 0; i < l.size(); ++i) l.update(i, (int) (i * i)); | ||
_logger.debug(l.mkString(", ")); | ||
|
||
Assert.assertEquals(5L, l.size()); | ||
|
||
l.free(); | ||
} | ||
} |
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