public class Sparta extends Object
Copyright (C) 2003 Hewlett-Packard Company. This file is part of Sparta, an XML Parser, DOM, and XPath library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Sparta.Cache
What a CacheFactory generates.
|
static interface |
Sparta.CacheFactory
You should pass an object that implements this interface to
setCacheFactory.
|
static interface |
Sparta.Internment
Pass an object that implements this interface to setInternment.
|
| Constructor and Description |
|---|
Sparta() |
| Modifier and Type | Method and Description |
|---|---|
static String |
intern(String s)
Used internally by Sparta code to intern strings because the
String.intern method is not supported in older and smaller JVMs.
|
static void |
setCacheFactory(Sparta.CacheFactory f)
Change the caching to something custom.
|
static void |
setInternment(Sparta.Internment i)
Change the String intern to something custom.
|
public static String intern(String s)
String.intern()public static void setInternment(Sparta.Internment i)
public class MyApplication {
static{
Sparta.setInternment(new Sparta.Internment(){
public String intern(String s) {
return s.intern();
}
});
}
public static void main(String[] args) {
...
public static void setCacheFactory(Sparta.CacheFactory f)
public class MyApplication {
static private class LruCache extends LruMap implements Sparta.Cache {}
static{
Sparta.setCacheFactory(new Sparta.CacheFactory(){
public Sparta.Cache create() {
return new SoftCache();
}
});
}
public static void main(String[] args) {
...
Copyright © 2016. All Rights Reserved.