target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testFilteringXmlByPatternFalse() { String pattern = "*.xml"; File file = new File("SomeFileWithXml.json"); CustomPatternFileFilter filter = new CustomPatternFileFilter(pattern); Assert.assertFalse(filter.accept(file)); }
@Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } CustomPatternFileFilter(String pattern); }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } CustomPatternFileFilter(String pattern); @Override boolean accept(File file); }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } CustomPatternFileFilter(String pattern); @Override boolean accept(File file); }
@Test public void testFilteringXmlByPartialFileNamePattern() { String pattern = "*File*.xml"; File file = new File("SomeFileWithXml.xml"); CustomPatternFileFilter filter = new CustomPatternFileFilter(pattern); Assert.assertTrue(filter.accept(file)); }
@Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } CustomPatternFileFilter(String pattern); }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } CustomPatternFileFilter(String pattern); @Override boolean accept(File file); }
CustomPatternFileFilter implements FileFilter { @Override public boolean accept(File file) { String fileNameInLowerCase = file.getName().toLowerCase(); FileTypeEnum fileType = FileTypeEnum.parseByFileName(fileNameInLowerCase); return (null != fileType) && fileNameInLowerCase.matches(pattern); } CustomPatternFileFilter(String pattern); @Override boolean accept(File file); }
@Test public void _3_get1() throws Exception { Response res = target("").path("1").request() .get(); assertEquals(200, res.getStatus()); assertEquals( "{\"active\":false,\"callback_url\":\"" + CALLBACK_URL + "\",\"failed\":false,\"filter\":{\"exists\":[],\"for_all\":[]},\"id\":1,\"message\":null}", res.readEntity(String.class)); }
@GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
@Test public void _7_delete() throws Exception { Response res = target("").path("1").request() .delete(); assertEquals(204, res.getStatus()); }
@DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public static Response delete(@PathParam("id") long id) throws NotFound { boolean removed = Webhooks.instance().remove(id); if (removed) { return Responses.noContent(); } else { return Responses.badRequest(); } }
WebhookAPI { @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public static Response delete(@PathParam("id") long id) throws NotFound { boolean removed = Webhooks.instance().remove(id); if (removed) { return Responses.noContent(); } else { return Responses.badRequest(); } } }
WebhookAPI { @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public static Response delete(@PathParam("id") long id) throws NotFound { boolean removed = Webhooks.instance().remove(id); if (removed) { return Responses.noContent(); } else { return Responses.badRequest(); } } }
WebhookAPI { @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public static Response delete(@PathParam("id") long id) throws NotFound { boolean removed = Webhooks.instance().remove(id); if (removed) { return Responses.noContent(); } else { return Responses.badRequest(); } } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
WebhookAPI { @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public static Response delete(@PathParam("id") long id) throws NotFound { boolean removed = Webhooks.instance().remove(id); if (removed) { return Responses.noContent(); } else { return Responses.badRequest(); } } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
@Test public void _8_get_not_found() throws Exception { Response res = target("").path("1").request() .get(); assertEquals(404, res.getStatus()); }
@GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
@Test public void _9_getAll() throws Exception { String body2 = "{\"callback_url\": \"" + CALLBACK_URL + "/2\"}"; String body3 = "{\"callback_url\": \"" + CALLBACK_URL + "/3\"}"; String body4 = "{\"callback_url\": \"" + CALLBACK_URL + "/4\"}"; target("").request().post(Entity.entity(body2, MediaType.APPLICATION_JSON_TYPE)); target("").request().post(Entity.entity(body3, MediaType.APPLICATION_JSON_TYPE)); target("").request().post(Entity.entity(body4, MediaType.APPLICATION_JSON_TYPE)); Response res = target("").request().get(); assertEquals(200, res.getStatus()); assertEquals("[" + "{\"active\":true,\"callback_url\":\"" + CALLBACK_URL + "/2\",\"failed\":false,\"filter\":{\"exists\":[],\"for_all\":[]},\"id\":2,\"message\":null}," + "{\"active\":true,\"callback_url\":\"" + CALLBACK_URL + "/3\",\"failed\":false,\"filter\":{\"exists\":[],\"for_all\":[]},\"id\":3,\"message\":null}," + "{\"active\":true,\"callback_url\":\"" + CALLBACK_URL + "/4\",\"failed\":false,\"filter\":{\"exists\":[],\"for_all\":[]},\"id\":4,\"message\":null}" + "]", res.readEntity(String.class)); }
@GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
WebhookAPI { @GET @Produces(MediaType.APPLICATION_JSON) public static Response get() { return Responses.ok(Webhooks.instance().hooks()); } @GET @Produces(MediaType.APPLICATION_JSON) static Response get(); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) static Response get(@PathParam("id") long id); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response create( @Context UriInfo uriInfo, InputStream reqBody); @PATCH @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response update( @PathParam("id") long id, InputStream reqBody); @DELETE @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) static Response delete(@PathParam("id") long id); @POST @Path("/{id}/pings") @Consumes(MediaType.APPLICATION_JSON) static Response ping(@PathParam("id") long id); }
@Test public void DtoChangesURLを生成() throws Exception { URL url = Notifier.getDtoChangesUri(tx, time); assertEquals( "http: url.toString()); }
public static URL getDtoChangesUri(TransactionId.W tx, DateTime time) throws IOException { NotifierConfig conf = NotifierConfig.instance(); String urlStr = new Formatter().format( "http: conf.naefAddr(), conf.naefRestApiPort(), conf.naefRestApiVersion()) .toString(); StringJoiner queries = new StringJoiner("&"); if (tx != null) { queries.add("version=" + tx.toString()); } if (time != null) { queries.add("time=" + time.getValue()); } if (queries.length() > 0) { urlStr += "?" + queries.toString(); } return new URL(urlStr); }
Notifier implements ServletContextListener { public static URL getDtoChangesUri(TransactionId.W tx, DateTime time) throws IOException { NotifierConfig conf = NotifierConfig.instance(); String urlStr = new Formatter().format( "http: conf.naefAddr(), conf.naefRestApiPort(), conf.naefRestApiVersion()) .toString(); StringJoiner queries = new StringJoiner("&"); if (tx != null) { queries.add("version=" + tx.toString()); } if (time != null) { queries.add("time=" + time.getValue()); } if (queries.length() > 0) { urlStr += "?" + queries.toString(); } return new URL(urlStr); } }
Notifier implements ServletContextListener { public static URL getDtoChangesUri(TransactionId.W tx, DateTime time) throws IOException { NotifierConfig conf = NotifierConfig.instance(); String urlStr = new Formatter().format( "http: conf.naefAddr(), conf.naefRestApiPort(), conf.naefRestApiVersion()) .toString(); StringJoiner queries = new StringJoiner("&"); if (tx != null) { queries.add("version=" + tx.toString()); } if (time != null) { queries.add("time=" + time.getValue()); } if (queries.length() > 0) { urlStr += "?" + queries.toString(); } return new URL(urlStr); } Notifier(); }
Notifier implements ServletContextListener { public static URL getDtoChangesUri(TransactionId.W tx, DateTime time) throws IOException { NotifierConfig conf = NotifierConfig.instance(); String urlStr = new Formatter().format( "http: conf.naefAddr(), conf.naefRestApiPort(), conf.naefRestApiVersion()) .toString(); StringJoiner queries = new StringJoiner("&"); if (tx != null) { queries.add("version=" + tx.toString()); } if (time != null) { queries.add("time=" + time.getValue()); } if (queries.length() > 0) { urlStr += "?" + queries.toString(); } return new URL(urlStr); } Notifier(); static synchronized void start(); static void main(String[] args); @Override void contextInitialized(ServletContextEvent sce); @Override void contextDestroyed(ServletContextEvent sce); static URL getDtoChangesUri(TransactionId.W tx, DateTime time); static Map<String, Object> getDtoChangesJson(TransactionId.W tx, DateTime time); }
Notifier implements ServletContextListener { public static URL getDtoChangesUri(TransactionId.W tx, DateTime time) throws IOException { NotifierConfig conf = NotifierConfig.instance(); String urlStr = new Formatter().format( "http: conf.naefAddr(), conf.naefRestApiPort(), conf.naefRestApiVersion()) .toString(); StringJoiner queries = new StringJoiner("&"); if (tx != null) { queries.add("version=" + tx.toString()); } if (time != null) { queries.add("time=" + time.getValue()); } if (queries.length() > 0) { urlStr += "?" + queries.toString(); } return new URL(urlStr); } Notifier(); static synchronized void start(); static void main(String[] args); @Override void contextInitialized(ServletContextEvent sce); @Override void contextDestroyed(ServletContextEvent sce); static URL getDtoChangesUri(TransactionId.W tx, DateTime time); static Map<String, Object> getDtoChangesJson(TransactionId.W tx, DateTime time); static final String KEY_ROOT_DIR; static final String DEFAULT_ROOT_DIR_NAME; static final String BASE_DIR; }
@Test public void testInnerClassNaming() { String expected = NameUtilitiesTest.class.getPackage().getName()+"." + NameUtilitiesTest.class.getSimpleName()+"." + "Inner" ; String name = NameUtilities.getFullName(Inner.class); Assert.assertEquals(expected, name); }
public static String getFullName(Class c) { if (c == null) { throw new IllegalArgumentException("class cannot be null"); } StringBuilder name = new StringBuilder(); name.append(c.getPackage().getName()).append("."); Class klaus = c; List<Class> enclosingClasses = new ArrayList<Class>(); while ((klaus = klaus.getEnclosingClass()) != null) { enclosingClasses.add(klaus); } for (int i = enclosingClasses.size() - 1; i >= 0; i--) { name.append(enclosingClasses.get(i).getSimpleName()).append("."); } name.append(c.getSimpleName()); return name.toString(); }
NameUtilities { public static String getFullName(Class c) { if (c == null) { throw new IllegalArgumentException("class cannot be null"); } StringBuilder name = new StringBuilder(); name.append(c.getPackage().getName()).append("."); Class klaus = c; List<Class> enclosingClasses = new ArrayList<Class>(); while ((klaus = klaus.getEnclosingClass()) != null) { enclosingClasses.add(klaus); } for (int i = enclosingClasses.size() - 1; i >= 0; i--) { name.append(enclosingClasses.get(i).getSimpleName()).append("."); } name.append(c.getSimpleName()); return name.toString(); } }
NameUtilities { public static String getFullName(Class c) { if (c == null) { throw new IllegalArgumentException("class cannot be null"); } StringBuilder name = new StringBuilder(); name.append(c.getPackage().getName()).append("."); Class klaus = c; List<Class> enclosingClasses = new ArrayList<Class>(); while ((klaus = klaus.getEnclosingClass()) != null) { enclosingClasses.add(klaus); } for (int i = enclosingClasses.size() - 1; i >= 0; i--) { name.append(enclosingClasses.get(i).getSimpleName()).append("."); } name.append(c.getSimpleName()); return name.toString(); } }
NameUtilities { public static String getFullName(Class c) { if (c == null) { throw new IllegalArgumentException("class cannot be null"); } StringBuilder name = new StringBuilder(); name.append(c.getPackage().getName()).append("."); Class klaus = c; List<Class> enclosingClasses = new ArrayList<Class>(); while ((klaus = klaus.getEnclosingClass()) != null) { enclosingClasses.add(klaus); } for (int i = enclosingClasses.size() - 1; i >= 0; i--) { name.append(enclosingClasses.get(i).getSimpleName()).append("."); } name.append(c.getSimpleName()); return name.toString(); } static String getFullName(Class c); }
NameUtilities { public static String getFullName(Class c) { if (c == null) { throw new IllegalArgumentException("class cannot be null"); } StringBuilder name = new StringBuilder(); name.append(c.getPackage().getName()).append("."); Class klaus = c; List<Class> enclosingClasses = new ArrayList<Class>(); while ((klaus = klaus.getEnclosingClass()) != null) { enclosingClasses.add(klaus); } for (int i = enclosingClasses.size() - 1; i >= 0; i--) { name.append(enclosingClasses.get(i).getSimpleName()).append("."); } name.append(c.getSimpleName()); return name.toString(); } static String getFullName(Class c); }
@Test public void test() { Prologue prologue = new Prologue(); prologue.setPrefixMapping(PrefixMapping.Extended); Model model = RDFDataMgr.loadModel("virtual-predicates-example.ttl"); RDFDataMgr.write(System.out, model, RDFFormat.TURTLE_PRETTY); Map<Node, BinaryRelation> virtualPredicates = new HashMap<Node, BinaryRelation>(); virtualPredicates.put(NodeFactory.createURI("http: BinaryRelationImpl.create("?s a eg:Person ; eg:birthDate ?start . " + "BIND(NOW() AS ?end) " + "BIND(YEAR(?end) - YEAR(?start) - IF(MONTH(?end) < MONTH(?start) || (MONTH(?end) = MONTH(?start) && DAY(?end) < DAY(?start)), 1, 0) as ?age)", "s", "age", prologue)); SparqlQueryParser parser = SparqlQueryParserImpl.create(Syntax.syntaxARQ, prologue); List<Query> queries = Arrays.asList( parser.apply("Select (year(NOW()) - year('1984-01-01'^^xsd:date) AS ?d) { }"), parser.apply("Select * { ?s ?p ?o }"), parser.apply("Select * { ?s eg:age ?o }"), parser.apply("Select * { ?s a eg:Person ; eg:age ?a }"), parser.apply("Select * { ?s a eg:Person ; ?p ?o . FILTER(?p = eg:age) }") ); for(Query query : queries) { if(query.isQueryResultStar()) { query.getProjectVars().addAll(query.getResultVars().stream().map(Var::alloc).collect(Collectors.toList())); query.setQueryResultStar(false); System.out.println(query); } Query intermediateQuery = ElementTransformVirtualPredicates.transform(query, virtualPredicates, true); Op op = Algebra.compile(intermediateQuery); Context ctx = ARQ.getContext().copy(); ctx.set(ARQ.optFilterEquality, false); ctx.put(ARQ.optFilterPlacement, true); ctx.put(ARQ.optFilterPlacementBGP, true); System.out.println(op); Query finalQuery = OpAsQuery.asQuery(op); System.out.println("Rewritten query: " + finalQuery); System.out.println(ResultSetFormatter.asText( FluentQueryExecutionFactory .from(model).create().createQueryExecution(finalQuery).execSelect())); } virtualPredicates.put(NodeFactory.createURI(RDFS.label.getURI()), BinaryRelationImpl.create("?s <skos:label> [ <skos:value> ?l]", "s", "l")); }
@Override public Element transform(ElementTriplesBlock el) { Element result = applyTransform(el, virtualPredicates, varGen); return result; }
ElementTransformVirtualPredicates extends ElementTransformCopyBase { @Override public Element transform(ElementTriplesBlock el) { Element result = applyTransform(el, virtualPredicates, varGen); return result; } }
ElementTransformVirtualPredicates extends ElementTransformCopyBase { @Override public Element transform(ElementTriplesBlock el) { Element result = applyTransform(el, virtualPredicates, varGen); return result; } ElementTransformVirtualPredicates(); ElementTransformVirtualPredicates(Map<Node, BinaryRelation> virtualPredicates); ElementTransformVirtualPredicates(Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); }
ElementTransformVirtualPredicates extends ElementTransformCopyBase { @Override public Element transform(ElementTriplesBlock el) { Element result = applyTransform(el, virtualPredicates, varGen); return result; } ElementTransformVirtualPredicates(); ElementTransformVirtualPredicates(Map<Node, BinaryRelation> virtualPredicates); ElementTransformVirtualPredicates(Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); @Override Element transform(ElementTriplesBlock el); @Override Element transform(ElementPathBlock el); static Element applyTransform(ElementTriplesBlock el, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> rootVarGen); static Element applyTransform(ElementPathBlock el, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> rootVarGen); static Element applyTransform(Triple triple, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); static Element createElementForVariablePredicate(Var pVar, Node s, Node o, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); static Element createElementForConcretePredicate(Var pVar, Node pRef, Node s, Node o, BinaryRelation relation, Generator<Var> varGen); static Query transform(Query query, Map<Node, BinaryRelation> virtualPredicates, boolean cloneOnChange); static Element transform(Element element, Map<Node, BinaryRelation> virtualPredicates); }
ElementTransformVirtualPredicates extends ElementTransformCopyBase { @Override public Element transform(ElementTriplesBlock el) { Element result = applyTransform(el, virtualPredicates, varGen); return result; } ElementTransformVirtualPredicates(); ElementTransformVirtualPredicates(Map<Node, BinaryRelation> virtualPredicates); ElementTransformVirtualPredicates(Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); @Override Element transform(ElementTriplesBlock el); @Override Element transform(ElementPathBlock el); static Element applyTransform(ElementTriplesBlock el, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> rootVarGen); static Element applyTransform(ElementPathBlock el, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> rootVarGen); static Element applyTransform(Triple triple, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); static Element createElementForVariablePredicate(Var pVar, Node s, Node o, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> varGen); static Element createElementForConcretePredicate(Var pVar, Node pRef, Node s, Node o, BinaryRelation relation, Generator<Var> varGen); static Query transform(Query query, Map<Node, BinaryRelation> virtualPredicates, boolean cloneOnChange); static Element transform(Element element, Map<Node, BinaryRelation> virtualPredicates); }
@Test public void testReadSchema() throws IOException { List<Resource> tasks = SparqlQcReader.loadTasks("sparqlqc/1.4/benchmark/ucqrdfs.rdf"); for(Resource task : tasks) { RDFDataMgr.write(System.out, task.getModel(), RDFFormat.TURTLE); } }
public static List<Resource> loadTasks(String baseFile) throws IOException { List<Resource> testSuites = loadTestSuites(baseFile); List<Resource> testCases = extractTasks(testSuites); return testCases; }
SparqlQcReader { public static List<Resource> loadTasks(String baseFile) throws IOException { List<Resource> testSuites = loadTestSuites(baseFile); List<Resource> testCases = extractTasks(testSuites); return testCases; } }
SparqlQcReader { public static List<Resource> loadTasks(String baseFile) throws IOException { List<Resource> testSuites = loadTestSuites(baseFile); List<Resource> testCases = extractTasks(testSuites); return testCases; } }
SparqlQcReader { public static List<Resource> loadTasks(String baseFile) throws IOException { List<Resource> testSuites = loadTestSuites(baseFile); List<Resource> testCases = extractTasks(testSuites); return testCases; } static List<Resource> loadTestSuitesSqcf(String baseFile); static List<Resource> extractTasks(Collection<Resource> testSuites); static List<Resource> loadTasksSqcf(String baseFile); static void renameProperty(Model model, Property p, String uri); static void normalizeSqcfModel(Model testSuitesModel); static List<Resource> loadTestSuites(String baseFile); static List<Resource> loadTestSuites(Model testSuitesModel, String baseFile); static List<Resource> loadTasks(String baseFile); static void enrichTestCasesWithLabels(Model model); static RDFNode resolveIoResourceRef(Resource testCase, Property property, // String basePath, Map<String, RDFNode> cache, BiFunction<String, Model, RDFNode> rdfizer); static void loadTestSuite(Resource testSuite, String basePath); static Resource processQueryRecordUnchecked( org.springframework.core.io.Resource resource, Model inout); static Long parseSchemaId(String ref); static Resource parseQueryId(String ref); static String createQueryResourceIri(String baseIri, Resource qr); static Resource createSchemaResource(Long id); static Resource processSchemaUnchecked( org.springframework.core.io.Resource resource, Model inout); static Resource processSchema(org.springframework.core.io.Resource resource, Model inout); static Resource processQueryRecord(org.springframework.core.io.Resource resource, Model inout); @Deprecated static Model readQueryFolder(String path); }
SparqlQcReader { public static List<Resource> loadTasks(String baseFile) throws IOException { List<Resource> testSuites = loadTestSuites(baseFile); List<Resource> testCases = extractTasks(testSuites); return testCases; } static List<Resource> loadTestSuitesSqcf(String baseFile); static List<Resource> extractTasks(Collection<Resource> testSuites); static List<Resource> loadTasksSqcf(String baseFile); static void renameProperty(Model model, Property p, String uri); static void normalizeSqcfModel(Model testSuitesModel); static List<Resource> loadTestSuites(String baseFile); static List<Resource> loadTestSuites(Model testSuitesModel, String baseFile); static List<Resource> loadTasks(String baseFile); static void enrichTestCasesWithLabels(Model model); static RDFNode resolveIoResourceRef(Resource testCase, Property property, // String basePath, Map<String, RDFNode> cache, BiFunction<String, Model, RDFNode> rdfizer); static void loadTestSuite(Resource testSuite, String basePath); static Resource processQueryRecordUnchecked( org.springframework.core.io.Resource resource, Model inout); static Long parseSchemaId(String ref); static Resource parseQueryId(String ref); static String createQueryResourceIri(String baseIri, Resource qr); static Resource createSchemaResource(Long id); static Resource processSchemaUnchecked( org.springframework.core.io.Resource resource, Model inout); static Resource processSchema(org.springframework.core.io.Resource resource, Model inout); static Resource processQueryRecord(org.springframework.core.io.Resource resource, Model inout); @Deprecated static Model readQueryFolder(String path); static final Property LSQtext; static final Pattern queryNamePattern; static final Pattern schemaNamePattern; }
@Test public void testUsedPrefixes1() { PrefixMapping pm = RDFDataMgr.loadModel("rdf-prefixes/wikidata.jsonld"); String queryStr = "SELECT ?s ?desc WHERE {\n" + " ?s wdt:P279 wd:Q7725634 .\n" + " OPTIONAL {\n" + " ?s rdfs:label ?desc \n" + " FILTER (LANG(?desc) = \"en\").\n" + " }\n" + "}"; SparqlStmt stmt = SparqlStmtParserImpl.create(pm).apply(queryStr); SparqlStmtUtils.optimizePrefixes(stmt); Query query = stmt.getQuery(); Set<String> actual = query.getPrefixMapping().getNsPrefixMap().keySet(); Assert.assertEquals(Sets.newHashSet("rdfs", "wd", "wdt"), actual); }
public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } static Map<String, Boolean> mentionedEnvVars(SparqlStmt stmt); static List<Var> getUnionProjectVars(Collection<? extends SparqlStmt> stmts); static SparqlStmt optimizePrefixes(SparqlStmt stmt); static SparqlStmt optimizePrefixes(SparqlStmt stmt, PrefixMapping globalPm); static SparqlStmt applyOpTransform(SparqlStmt stmt, Function<? super Op, ? extends Op> transform); static SparqlStmt applyNodeTransform(SparqlStmt stmt, NodeTransform xform); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI); static URI extractBaseIri(String filenameOrURI); static String loadString(String filenameOrURI); static TypedInputStream openInputStream(String filenameOrURI); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI, String baseIri); static SparqlStmtIterator processInputStream(PrefixMapping pm, String baseIri, InputStream in); static SparqlStmtIterator parse(InputStream in, Function<String, SparqlStmt> parser); static SPARQLResultEx execAny(RDFConnection conn, SparqlStmt stmt); static Sink<Quad> createSinkQuads(RDFFormat format, OutputStream out, PrefixMapping pm, Supplier<Dataset> datasetSupp); static void output( SPARQLResultEx rr, SPARQLResultVisitor sink); static void output( SPARQLResultEx rr, Consumer<Quad> sink ); static void output(SPARQLResultEx r); static void process(RDFConnection conn, SparqlStmt stmt, SPARQLResultVisitor sink); static void processOld(RDFConnection conn, SparqlStmt stmt); static Op toAlgebra(SparqlStmt stmt); }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } static Map<String, Boolean> mentionedEnvVars(SparqlStmt stmt); static List<Var> getUnionProjectVars(Collection<? extends SparqlStmt> stmts); static SparqlStmt optimizePrefixes(SparqlStmt stmt); static SparqlStmt optimizePrefixes(SparqlStmt stmt, PrefixMapping globalPm); static SparqlStmt applyOpTransform(SparqlStmt stmt, Function<? super Op, ? extends Op> transform); static SparqlStmt applyNodeTransform(SparqlStmt stmt, NodeTransform xform); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI); static URI extractBaseIri(String filenameOrURI); static String loadString(String filenameOrURI); static TypedInputStream openInputStream(String filenameOrURI); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI, String baseIri); static SparqlStmtIterator processInputStream(PrefixMapping pm, String baseIri, InputStream in); static SparqlStmtIterator parse(InputStream in, Function<String, SparqlStmt> parser); static SPARQLResultEx execAny(RDFConnection conn, SparqlStmt stmt); static Sink<Quad> createSinkQuads(RDFFormat format, OutputStream out, PrefixMapping pm, Supplier<Dataset> datasetSupp); static void output( SPARQLResultEx rr, SPARQLResultVisitor sink); static void output( SPARQLResultEx rr, Consumer<Quad> sink ); static void output(SPARQLResultEx r); static void process(RDFConnection conn, SparqlStmt stmt, SPARQLResultVisitor sink); static void processOld(RDFConnection conn, SparqlStmt stmt); static Op toAlgebra(SparqlStmt stmt); static final Symbol symConnection; }
@Test public void testUsedPrefixes2() { PrefixMapping pm = RDFDataMgr.loadModel("rdf-prefixes/wikidata.jsonld"); String queryStr = "INSERT {" + " ?s wdt:P279 wd:Q7725634 .\n" + "}\n" + " WHERE {\n" + " ?s rdfs:label ?desc \n" + " FILTER (LANG(?desc) = \"en\").\n" + " }\n"; SparqlStmt stmt = SparqlStmtParserImpl.create(pm).apply(queryStr); SparqlStmtUtils.optimizePrefixes(stmt); UpdateRequest updateRequest = stmt.getUpdateRequest(); Set<String> actual = updateRequest.getPrefixMapping().getNsPrefixMap().keySet(); Assert.assertEquals(Sets.newHashSet("rdfs", "wd", "wdt"), actual); }
public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } static Map<String, Boolean> mentionedEnvVars(SparqlStmt stmt); static List<Var> getUnionProjectVars(Collection<? extends SparqlStmt> stmts); static SparqlStmt optimizePrefixes(SparqlStmt stmt); static SparqlStmt optimizePrefixes(SparqlStmt stmt, PrefixMapping globalPm); static SparqlStmt applyOpTransform(SparqlStmt stmt, Function<? super Op, ? extends Op> transform); static SparqlStmt applyNodeTransform(SparqlStmt stmt, NodeTransform xform); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI); static URI extractBaseIri(String filenameOrURI); static String loadString(String filenameOrURI); static TypedInputStream openInputStream(String filenameOrURI); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI, String baseIri); static SparqlStmtIterator processInputStream(PrefixMapping pm, String baseIri, InputStream in); static SparqlStmtIterator parse(InputStream in, Function<String, SparqlStmt> parser); static SPARQLResultEx execAny(RDFConnection conn, SparqlStmt stmt); static Sink<Quad> createSinkQuads(RDFFormat format, OutputStream out, PrefixMapping pm, Supplier<Dataset> datasetSupp); static void output( SPARQLResultEx rr, SPARQLResultVisitor sink); static void output( SPARQLResultEx rr, Consumer<Quad> sink ); static void output(SPARQLResultEx r); static void process(RDFConnection conn, SparqlStmt stmt, SPARQLResultVisitor sink); static void processOld(RDFConnection conn, SparqlStmt stmt); static Op toAlgebra(SparqlStmt stmt); }
SparqlStmtUtils { public static SparqlStmt optimizePrefixes(SparqlStmt stmt) { optimizePrefixes(stmt, null); return stmt; } static Map<String, Boolean> mentionedEnvVars(SparqlStmt stmt); static List<Var> getUnionProjectVars(Collection<? extends SparqlStmt> stmts); static SparqlStmt optimizePrefixes(SparqlStmt stmt); static SparqlStmt optimizePrefixes(SparqlStmt stmt, PrefixMapping globalPm); static SparqlStmt applyOpTransform(SparqlStmt stmt, Function<? super Op, ? extends Op> transform); static SparqlStmt applyNodeTransform(SparqlStmt stmt, NodeTransform xform); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI); static URI extractBaseIri(String filenameOrURI); static String loadString(String filenameOrURI); static TypedInputStream openInputStream(String filenameOrURI); static SparqlStmtIterator processFile(PrefixMapping pm, String filenameOrURI, String baseIri); static SparqlStmtIterator processInputStream(PrefixMapping pm, String baseIri, InputStream in); static SparqlStmtIterator parse(InputStream in, Function<String, SparqlStmt> parser); static SPARQLResultEx execAny(RDFConnection conn, SparqlStmt stmt); static Sink<Quad> createSinkQuads(RDFFormat format, OutputStream out, PrefixMapping pm, Supplier<Dataset> datasetSupp); static void output( SPARQLResultEx rr, SPARQLResultVisitor sink); static void output( SPARQLResultEx rr, Consumer<Quad> sink ); static void output(SPARQLResultEx r); static void process(RDFConnection conn, SparqlStmt stmt, SPARQLResultVisitor sink); static void processOld(RDFConnection conn, SparqlStmt stmt); static Op toAlgebra(SparqlStmt stmt); static final Symbol symConnection; }
@Test public void test() { String r = UriUtils.replaceNamespace("http: Assert.assertEquals("http: }
public static String replaceNamespace(String base, String replacement) { Matcher m = replaceNamespacePattern.matcher(base); String result = m.replaceAll(replacement); return result; }
UriUtils { public static String replaceNamespace(String base, String replacement) { Matcher m = replaceNamespacePattern.matcher(base); String result = m.replaceAll(replacement); return result; } }
UriUtils { public static String replaceNamespace(String base, String replacement) { Matcher m = replaceNamespacePattern.matcher(base); String result = m.replaceAll(replacement); return result; } }
UriUtils { public static String replaceNamespace(String base, String replacement) { Matcher m = replaceNamespacePattern.matcher(base); String result = m.replaceAll(replacement); return result; } static Map<String, String> createMapFromUriQueryString(URI uri); static String getNameSpace(String s); static String getLocalName(String s); static String replaceNamespace(String base, String replacement); static Multimap<String, String> parseQueryString(String queryString); static Multimap<String, String> parseQueryStringEx(String queryString); }
UriUtils { public static String replaceNamespace(String base, String replacement) { Matcher m = replaceNamespacePattern.matcher(base); String result = m.replaceAll(replacement); return result; } static Map<String, String> createMapFromUriQueryString(URI uri); static String getNameSpace(String s); static String getLocalName(String s); static String replaceNamespace(String base, String replacement); static Multimap<String, String> parseQueryString(String queryString); static Multimap<String, String> parseQueryStringEx(String queryString); static final Pattern replaceNamespacePattern; }
@Test public void testReducedPrefixes() { Query query = QueryFactory.create(String.join("\n", "PREFIX rdf: <http: "PREFIX foo: <http: "PREFIX bar: <http: "PREFIX baz: <http: "SELECT * {", " { SELECT * {", " ?s a foo:Foo.", " } }", " ?s rdf:type foo:Bar", "}")); PrefixMapping pm = org.aksw.jena_sparql_api.utils.QueryUtils.usedPrefixes(query); Assert.assertEquals(pm.getNsPrefixMap().keySet(), new HashSet<>(Arrays.asList("rdf", "foo"))); }
public static PrefixMapping usedPrefixes(Query query, PrefixMapping global) { PrefixMapping local = query.getPrefixMapping(); PrefixMapping pm = global == null ? local : new PrefixMapping2(global, local); PrefixMapping result = usedReferencePrefixes(query, pm); return result; }
QueryUtils { public static PrefixMapping usedPrefixes(Query query, PrefixMapping global) { PrefixMapping local = query.getPrefixMapping(); PrefixMapping pm = global == null ? local : new PrefixMapping2(global, local); PrefixMapping result = usedReferencePrefixes(query, pm); return result; } }
QueryUtils { public static PrefixMapping usedPrefixes(Query query, PrefixMapping global) { PrefixMapping local = query.getPrefixMapping(); PrefixMapping pm = global == null ? local : new PrefixMapping2(global, local); PrefixMapping result = usedReferencePrefixes(query, pm); return result; } }
QueryUtils { public static PrefixMapping usedPrefixes(Query query, PrefixMapping global) { PrefixMapping local = query.getPrefixMapping(); PrefixMapping pm = global == null ? local : new PrefixMapping2(global, local); PrefixMapping result = usedReferencePrefixes(query, pm); return result; } static Query applyOpTransform(Query beforeQuery, Function<? super Op, ? extends Op> transform); static Query restoreQueryForm(Query query, Query proto); static Query selectToConstruct(Query query, Template template); static Query rewrite(Query beforeQuery, Function<? super Op, ? extends Op> xform); static Element asPatternForConstruct(Query q); static boolean canActAsConstruct(Query q); static Set<Var> mentionedVars(Query query); static Set<Node> mentionedNodes(Query query); static Var freshVar(Query query); static Var freshVar(Query query, String baseVarName); static Map<String, Node> applyNodeTransform(Map<String, Node> jsonMapping, NodeTransform nodeTransform); static Query applyNodeTransform(Query query, NodeTransform nodeTransform); static PrefixMapping usedPrefixes(Query query, PrefixMapping global); static PrefixMapping usedPrefixes(Query query); static PrefixMapping usedReferencePrefixes(Query query, PrefixMapping pm); static Query optimizePrefixes(Query query, PrefixMapping globalPm); static Query optimizePrefixes(Query query); static Query randomizeVars(Query query); static Map<Var, Var> createRandomVarMap(Query query, String base); static void injectFilter(Query query, String exprStr); static void injectFilter(Query query, Expr expr); static void injectElement(Query query, Element element); static Range<Long> toRange(OpSlice op); static Op applyRange(Op op, Range<Long> range); static Query applySlice(Query query, Long offset, Long limit, boolean cloneOnChange); static void applyRange(Query query, Range<Long> range); static Range<Long> createRange(Long limit, Long offset); static long rangeToOffset(Range<Long> range); static long rangeToLimit(Range<Long> range); static Range<Long> toRange(Query query); static Range<Long> toRange(Long offset, Long limit); static Range<Long> subRange(Range<Long> parent, Range<Long> child); static void applyDatasetDescription(Query query, DatasetDescription dd); static Query fixVarNames(Query query); static Query elementToQuery(Element pattern, String resultVar); static Query elementToQuery(Element pattern); static Set<Quad> instanciate(Iterable<Quad> quads, Binding binding); }
QueryUtils { public static PrefixMapping usedPrefixes(Query query, PrefixMapping global) { PrefixMapping local = query.getPrefixMapping(); PrefixMapping pm = global == null ? local : new PrefixMapping2(global, local); PrefixMapping result = usedReferencePrefixes(query, pm); return result; } static Query applyOpTransform(Query beforeQuery, Function<? super Op, ? extends Op> transform); static Query restoreQueryForm(Query query, Query proto); static Query selectToConstruct(Query query, Template template); static Query rewrite(Query beforeQuery, Function<? super Op, ? extends Op> xform); static Element asPatternForConstruct(Query q); static boolean canActAsConstruct(Query q); static Set<Var> mentionedVars(Query query); static Set<Node> mentionedNodes(Query query); static Var freshVar(Query query); static Var freshVar(Query query, String baseVarName); static Map<String, Node> applyNodeTransform(Map<String, Node> jsonMapping, NodeTransform nodeTransform); static Query applyNodeTransform(Query query, NodeTransform nodeTransform); static PrefixMapping usedPrefixes(Query query, PrefixMapping global); static PrefixMapping usedPrefixes(Query query); static PrefixMapping usedReferencePrefixes(Query query, PrefixMapping pm); static Query optimizePrefixes(Query query, PrefixMapping globalPm); static Query optimizePrefixes(Query query); static Query randomizeVars(Query query); static Map<Var, Var> createRandomVarMap(Query query, String base); static void injectFilter(Query query, String exprStr); static void injectFilter(Query query, Expr expr); static void injectElement(Query query, Element element); static Range<Long> toRange(OpSlice op); static Op applyRange(Op op, Range<Long> range); static Query applySlice(Query query, Long offset, Long limit, boolean cloneOnChange); static void applyRange(Query query, Range<Long> range); static Range<Long> createRange(Long limit, Long offset); static long rangeToOffset(Range<Long> range); static long rangeToLimit(Range<Long> range); static Range<Long> toRange(Query query); static Range<Long> toRange(Long offset, Long limit); static Range<Long> subRange(Range<Long> parent, Range<Long> child); static void applyDatasetDescription(Query query, DatasetDescription dd); static Query fixVarNames(Query query); static Query elementToQuery(Element pattern, String resultVar); static Query elementToQuery(Element pattern); static Set<Quad> instanciate(Iterable<Quad> quads, Binding binding); }
@Test public void test() { StringReader reader = new StringReader(JSON); JsonParser parser = Json.createParser(reader); Attributes dataset = new JSONReader(parser).readDataset(null); assertArrayEquals(IS, dataset.getStrings(Tag.SelectorISValue)); assertArrayEquals(DS, dataset.getStrings(Tag.SelectorDSValue)); assertInfinityAndNaN(dataset.getDoubles(Tag.SelectorFDValue)); assertInfinityAndNaN(dataset.getFloats(Tag.SelectorFLValue)); }
public Attributes readDataset(Attributes attrs) { boolean wrappedInArray = next() == Event.START_ARRAY; if (wrappedInArray) next(); expect(Event.START_OBJECT); if (attrs == null) { attrs = new Attributes(); } fmi = null; next(); doReadDataset(attrs); if (wrappedInArray) next(); return attrs; }
JSONReader { public Attributes readDataset(Attributes attrs) { boolean wrappedInArray = next() == Event.START_ARRAY; if (wrappedInArray) next(); expect(Event.START_OBJECT); if (attrs == null) { attrs = new Attributes(); } fmi = null; next(); doReadDataset(attrs); if (wrappedInArray) next(); return attrs; } }
JSONReader { public Attributes readDataset(Attributes attrs) { boolean wrappedInArray = next() == Event.START_ARRAY; if (wrappedInArray) next(); expect(Event.START_OBJECT); if (attrs == null) { attrs = new Attributes(); } fmi = null; next(); doReadDataset(attrs); if (wrappedInArray) next(); return attrs; } JSONReader(JsonParser parser); }
JSONReader { public Attributes readDataset(Attributes attrs) { boolean wrappedInArray = next() == Event.START_ARRAY; if (wrappedInArray) next(); expect(Event.START_OBJECT); if (attrs == null) { attrs = new Attributes(); } fmi = null; next(); doReadDataset(attrs); if (wrappedInArray) next(); return attrs; } JSONReader(JsonParser parser); boolean isSkipBulkDataURI(); void setSkipBulkDataURI(boolean skipBulkDataURI); Attributes getFileMetaInformation(); Attributes readDataset(Attributes attrs); void readDatasets(Callback callback); }
JSONReader { public Attributes readDataset(Attributes attrs) { boolean wrappedInArray = next() == Event.START_ARRAY; if (wrappedInArray) next(); expect(Event.START_OBJECT); if (attrs == null) { attrs = new Attributes(); } fmi = null; next(); doReadDataset(attrs); if (wrappedInArray) next(); return attrs; } JSONReader(JsonParser parser); boolean isSkipBulkDataURI(); void setSkipBulkDataURI(boolean skipBulkDataURI); Attributes getFileMetaInformation(); Attributes readDataset(Attributes attrs); void readDatasets(Callback callback); }
@Test public void testTagToBytesLE() { assertArrayEquals(TAG_PIXEL_DATA_LE, ByteUtils.tagToBytesLE(Tag.PixelData, new byte[4] , 0)); }
public static byte[] tagToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 24); bytes[off] = (byte) (i >> 16); bytes[off + 3] = (byte) (i >> 8); bytes[off + 2] = (byte) i; return bytes; }
ByteUtils { public static byte[] tagToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 24); bytes[off] = (byte) (i >> 16); bytes[off + 3] = (byte) (i >> 8); bytes[off + 2] = (byte) i; return bytes; } }
ByteUtils { public static byte[] tagToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 24); bytes[off] = (byte) (i >> 16); bytes[off + 3] = (byte) (i >> 8); bytes[off + 2] = (byte) i; return bytes; } }
ByteUtils { public static byte[] tagToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 24); bytes[off] = (byte) (i >> 16); bytes[off + 3] = (byte) (i >> 8); bytes[off + 2] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] tagToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 24); bytes[off] = (byte) (i >> 16); bytes[off + 3] = (byte) (i >> 8); bytes[off + 2] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testFloatToBytesBE() { assertArrayEquals(FLOAT_PI_BE , ByteUtils.floatToBytesBE((float) Math.PI, new byte[4], 0)); }
public static byte[] floatToBytesBE(float f, byte[] bytes, int off) { return intToBytesBE(Float.floatToIntBits(f), bytes, off); }
ByteUtils { public static byte[] floatToBytesBE(float f, byte[] bytes, int off) { return intToBytesBE(Float.floatToIntBits(f), bytes, off); } }
ByteUtils { public static byte[] floatToBytesBE(float f, byte[] bytes, int off) { return intToBytesBE(Float.floatToIntBits(f), bytes, off); } }
ByteUtils { public static byte[] floatToBytesBE(float f, byte[] bytes, int off) { return intToBytesBE(Float.floatToIntBits(f), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] floatToBytesBE(float f, byte[] bytes, int off) { return intToBytesBE(Float.floatToIntBits(f), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testFloatToBytesLE() { assertArrayEquals(FLOAT_PI_LE , ByteUtils.floatToBytesLE((float) Math.PI, new byte[4], 0)); }
public static byte[] floatToBytesLE(float f, byte[] bytes, int off) { return intToBytesLE(Float.floatToIntBits(f), bytes, off); }
ByteUtils { public static byte[] floatToBytesLE(float f, byte[] bytes, int off) { return intToBytesLE(Float.floatToIntBits(f), bytes, off); } }
ByteUtils { public static byte[] floatToBytesLE(float f, byte[] bytes, int off) { return intToBytesLE(Float.floatToIntBits(f), bytes, off); } }
ByteUtils { public static byte[] floatToBytesLE(float f, byte[] bytes, int off) { return intToBytesLE(Float.floatToIntBits(f), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] floatToBytesLE(float f, byte[] bytes, int off) { return intToBytesLE(Float.floatToIntBits(f), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testDoubleToBytesBE() { assertArrayEquals(DOUBLE_PI_BE , ByteUtils.doubleToBytesBE(Math.PI, new byte[8], 0)); }
public static byte[] doubleToBytesBE(double d, byte[] bytes, int off) { return longToBytesBE(Double.doubleToLongBits(d), bytes, off); }
ByteUtils { public static byte[] doubleToBytesBE(double d, byte[] bytes, int off) { return longToBytesBE(Double.doubleToLongBits(d), bytes, off); } }
ByteUtils { public static byte[] doubleToBytesBE(double d, byte[] bytes, int off) { return longToBytesBE(Double.doubleToLongBits(d), bytes, off); } }
ByteUtils { public static byte[] doubleToBytesBE(double d, byte[] bytes, int off) { return longToBytesBE(Double.doubleToLongBits(d), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] doubleToBytesBE(double d, byte[] bytes, int off) { return longToBytesBE(Double.doubleToLongBits(d), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testDoubleToBytesLE() { assertArrayEquals(DOUBLE_PI_LE , ByteUtils.doubleToBytesLE(Math.PI, new byte[8], 0)); }
public static byte[] doubleToBytesLE(double d, byte[] bytes, int off) { return longToBytesLE(Double.doubleToLongBits(d), bytes, off); }
ByteUtils { public static byte[] doubleToBytesLE(double d, byte[] bytes, int off) { return longToBytesLE(Double.doubleToLongBits(d), bytes, off); } }
ByteUtils { public static byte[] doubleToBytesLE(double d, byte[] bytes, int off) { return longToBytesLE(Double.doubleToLongBits(d), bytes, off); } }
ByteUtils { public static byte[] doubleToBytesLE(double d, byte[] bytes, int off) { return longToBytesLE(Double.doubleToLongBits(d), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] doubleToBytesLE(double d, byte[] bytes, int off) { return longToBytesLE(Double.doubleToLongBits(d), bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testSwapShorts() { assertArrayEquals(TAG_PIXEL_DATA_LE , ByteUtils.swapShorts(TAG_PIXEL_DATA_BE.clone(), 0, TAG_PIXEL_DATA_BE.length)); }
public static byte[][] swapShorts(byte bs[][]) { int carry = 0; for (int i = 0; i < bs.length; i++) { byte[] b = bs[i]; if (carry != 0) swapLastFirst(bs[i-1], b); int len = b.length - carry; swapShorts(b, carry, len & ~1); carry = len & 1; } return bs; }
ByteUtils { public static byte[][] swapShorts(byte bs[][]) { int carry = 0; for (int i = 0; i < bs.length; i++) { byte[] b = bs[i]; if (carry != 0) swapLastFirst(bs[i-1], b); int len = b.length - carry; swapShorts(b, carry, len & ~1); carry = len & 1; } return bs; } }
ByteUtils { public static byte[][] swapShorts(byte bs[][]) { int carry = 0; for (int i = 0; i < bs.length; i++) { byte[] b = bs[i]; if (carry != 0) swapLastFirst(bs[i-1], b); int len = b.length - carry; swapShorts(b, carry, len & ~1); carry = len & 1; } return bs; } }
ByteUtils { public static byte[][] swapShorts(byte bs[][]) { int carry = 0; for (int i = 0; i < bs.length; i++) { byte[] b = bs[i]; if (carry != 0) swapLastFirst(bs[i-1], b); int len = b.length - carry; swapShorts(b, carry, len & ~1); carry = len & 1; } return bs; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[][] swapShorts(byte bs[][]) { int carry = 0; for (int i = 0; i < bs.length; i++) { byte[] b = bs[i]; if (carry != 0) swapLastFirst(bs[i-1], b); int len = b.length - carry; swapShorts(b, carry, len & ~1); carry = len & 1; } return bs; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testSwapInts() { assertArrayEquals(FLOAT_PI_LE , ByteUtils.swapInts(FLOAT_PI_BE.clone(), 0, FLOAT_PI_BE.length)); }
public static byte[] swapInts(byte b[], int off, int len) { checkLength(len, 4); for (int i = off, n = off + len; i < n; i += 4) { swap(b, i, i+3); swap(b, i+1, i+2); } return b; }
ByteUtils { public static byte[] swapInts(byte b[], int off, int len) { checkLength(len, 4); for (int i = off, n = off + len; i < n; i += 4) { swap(b, i, i+3); swap(b, i+1, i+2); } return b; } }
ByteUtils { public static byte[] swapInts(byte b[], int off, int len) { checkLength(len, 4); for (int i = off, n = off + len; i < n; i += 4) { swap(b, i, i+3); swap(b, i+1, i+2); } return b; } }
ByteUtils { public static byte[] swapInts(byte b[], int off, int len) { checkLength(len, 4); for (int i = off, n = off + len; i < n; i += 4) { swap(b, i, i+3); swap(b, i+1, i+2); } return b; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] swapInts(byte b[], int off, int len) { checkLength(len, 4); for (int i = off, n = off + len; i < n; i += 4) { swap(b, i, i+3); swap(b, i+1, i+2); } return b; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test public void testSwapLongs() { assertArrayEquals(DOUBLE_PI_LE , ByteUtils.swapLongs(DOUBLE_PI_BE.clone(), 0, DOUBLE_PI_BE.length)); }
public static byte[] swapLongs(byte b[], int off, int len) { checkLength(len, 8); for (int i = off, n = off + len; i < n; i += 8) { swap(b, i, i+7); swap(b, i+1, i+6); swap(b, i+2, i+5); swap(b, i+3, i+4); } return b; }
ByteUtils { public static byte[] swapLongs(byte b[], int off, int len) { checkLength(len, 8); for (int i = off, n = off + len; i < n; i += 8) { swap(b, i, i+7); swap(b, i+1, i+6); swap(b, i+2, i+5); swap(b, i+3, i+4); } return b; } }
ByteUtils { public static byte[] swapLongs(byte b[], int off, int len) { checkLength(len, 8); for (int i = off, n = off + len; i < n; i += 8) { swap(b, i, i+7); swap(b, i+1, i+6); swap(b, i+2, i+5); swap(b, i+3, i+4); } return b; } }
ByteUtils { public static byte[] swapLongs(byte b[], int off, int len) { checkLength(len, 8); for (int i = off, n = off + len; i < n; i += 8) { swap(b, i, i+7); swap(b, i+1, i+6); swap(b, i+2, i+5); swap(b, i+3, i+4); } return b; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); }
ByteUtils { public static byte[] swapLongs(byte b[], int off, int len) { checkLength(len, 8); for (int i = off, n = off + len; i < n; i += 8) { swap(b, i, i+7); swap(b, i+1, i+6); swap(b, i+2, i+5); swap(b, i+3, i+4); } return b; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); static int bytesToShort(byte[] bytes, int off, boolean bigEndian); static int bytesToShortBE(byte[] bytes, int off); static int bytesToShortLE(byte[] bytes, int off); static void bytesToShorts(byte[] b, short[] s, int off, int len, boolean bigEndian); static void bytesToShortsLE(byte[] b, short[] s, int off, int len); static void bytesToShortsBE(byte[] b, short[] s, int off, int len); static int bytesToInt(byte[] bytes, int off, boolean bigEndian); static int bytesToIntBE(byte[] bytes, int off); static int bytesToIntLE(byte[] bytes, int off); static int bytesToTag(byte[] bytes, int off, boolean bigEndian); static int bytesToTagBE(byte[] bytes, int off); static int bytesToTagLE(byte[] bytes, int off); static float bytesToFloat(byte[] bytes, int off, boolean bigEndian); static float bytesToFloatBE(byte[] bytes, int off); static float bytesToFloatLE(byte[] bytes, int off); static long bytesToLong(byte[] bytes, int off, boolean bigEndian); static long bytesToLongBE(byte[] bytes, int off); static long bytesToLongLE(byte[] bytes, int off); static double bytesToDouble(byte[] bytes, int off, boolean bigEndian); static double bytesToDoubleBE(byte[] bytes, int off); static double bytesToDoubleLE(byte[] bytes, int off); static byte[] shortToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] shortToBytesBE(int i, byte[] bytes, int off); static byte[] shortToBytesLE(int i, byte[] bytes, int off); static byte[] intToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] intToBytesBE(int i, byte[] bytes, int off); static byte[] intToBytesLE(int i, byte[] bytes, int off); static byte[] tagToBytes(int i, byte[] bytes, int off, boolean bigEndian); static byte[] tagToBytesBE(int i, byte[] bytes, int off); static byte[] tagToBytesLE(int i, byte[] bytes, int off); static byte[] floatToBytes(float f, byte[] bytes, int off, boolean bigEndian); static byte[] floatToBytesBE(float f, byte[] bytes, int off); static byte[] floatToBytesLE(float f, byte[] bytes, int off); static byte[] doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian); static byte[] doubleToBytesBE(double d, byte[] bytes, int off); static byte[] doubleToBytesLE(double d, byte[] bytes, int off); static byte[] longToBytes(long l, byte[] bytes, int off, boolean bigEndian); static byte[] longToBytesBE(long l, byte[] bytes, int off); static byte[] longToBytesLE(long l, byte[] bytes, int off); static byte[][] swapShorts(byte bs[][]); static byte[] swapShorts(byte b[], int off, int len); static byte[] swapInts(byte b[], int off, int len); static byte[] swapLongs(byte b[], int off, int len); static byte[] intsToBytesLE(int... values); static final byte[] EMPTY_BYTES; static final int[] EMPTY_INTS; static final float[] EMPTY_FLOATS; static final double[] EMPTY_DOUBLES; }
@Test(expected = EOFException.class) public void testNoOutOfMemoryErrorOnInvalidLength() throws IOException { byte[] b = { 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 'e', 'v', 'i', 'l', 'l', 'e', 'n', 'g', 'h' }; try ( DicomInputStream in = new DicomInputStream(new ByteArrayInputStream(b))) { in.readDataset(-1, -1); } }
public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; }
DicomInputStream extends FilterInputStream implements DicomInputHandler, BulkDataCreator { public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; } }
DicomInputStream extends FilterInputStream implements DicomInputHandler, BulkDataCreator { public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; } DicomInputStream(InputStream in, String tsuid); DicomInputStream(InputStream in); DicomInputStream(File file); }
DicomInputStream extends FilterInputStream implements DicomInputHandler, BulkDataCreator { public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; } DicomInputStream(InputStream in, String tsuid); DicomInputStream(InputStream in); DicomInputStream(File file); final String getTransferSyntax(); final int getAllocateLimit(); final void setAllocateLimit(int allocateLimit); final String getURI(); final void setURI(String uri); final IncludeBulkData getIncludeBulkData(); final void setIncludeBulkData(IncludeBulkData includeBulkData); final BulkDataDescriptor getBulkDataDescriptor(); final void setBulkDataDescriptor(BulkDataDescriptor bulkDataDescriptor); final String getBulkDataFilePrefix(); final void setBulkDataFilePrefix(String blkFilePrefix); final String getBulkDataFileSuffix(); final void setBulkDataFileSuffix(String blkFileSuffix); final File getBulkDataDirectory(); final void setBulkDataDirectory(File blkDirectory); final boolean isConcatenateBulkDataFiles(); final void setConcatenateBulkDataFiles(boolean catBlkFiles); final List<File> getBulkDataFiles(); final void setDicomInputHandler(DicomInputHandler handler); void setBulkDataCreator(BulkDataCreator bulkDataCreator); final void setFileMetaInformationGroupLength(byte[] val); final byte[] getPreamble(); Attributes getFileMetaInformation(); final int level(); final int tag(); final VR vr(); final int length(); final long getPosition(); void setPosition(long pos); long getTagPosition(); final boolean bigEndian(); final boolean explicitVR(); boolean isExcludeBulkData(); boolean isIncludeBulkDataURI(); static String toAttributePath(List<ItemPointer> itemPointers, int tag); String getAttributePath(); @Override void close(); @Override synchronized void mark(int readlimit); @Override synchronized void reset(); @Override final int read(); @Override final int read(byte[] b, int off, int len); @Override final int read(byte[] b); @Override final long skip(long n); void skipFully(long n); void readFully(byte b[]); void readFully(byte b[], int off, int len); void readFully(short[] s, int off, int len); void readHeader(); boolean readItemHeader(); Attributes readCommand(); Attributes readDataset(int len, int stopTag); Attributes readFileMetaInformation(); void readAttributes(Attributes attrs, int len, int stopTag); @Override void readValue(DicomInputStream dis, Attributes attrs); @Override BulkData createBulkData(DicomInputStream dis); @Override void readValue(DicomInputStream dis, Sequence seq); @Override void readValue(DicomInputStream dis, Fragments frags); @Override void startDataset(DicomInputStream dis); @Override void endDataset(DicomInputStream dis); Attributes readItem(); byte[] readValue(); }
DicomInputStream extends FilterInputStream implements DicomInputHandler, BulkDataCreator { public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; } DicomInputStream(InputStream in, String tsuid); DicomInputStream(InputStream in); DicomInputStream(File file); final String getTransferSyntax(); final int getAllocateLimit(); final void setAllocateLimit(int allocateLimit); final String getURI(); final void setURI(String uri); final IncludeBulkData getIncludeBulkData(); final void setIncludeBulkData(IncludeBulkData includeBulkData); final BulkDataDescriptor getBulkDataDescriptor(); final void setBulkDataDescriptor(BulkDataDescriptor bulkDataDescriptor); final String getBulkDataFilePrefix(); final void setBulkDataFilePrefix(String blkFilePrefix); final String getBulkDataFileSuffix(); final void setBulkDataFileSuffix(String blkFileSuffix); final File getBulkDataDirectory(); final void setBulkDataDirectory(File blkDirectory); final boolean isConcatenateBulkDataFiles(); final void setConcatenateBulkDataFiles(boolean catBlkFiles); final List<File> getBulkDataFiles(); final void setDicomInputHandler(DicomInputHandler handler); void setBulkDataCreator(BulkDataCreator bulkDataCreator); final void setFileMetaInformationGroupLength(byte[] val); final byte[] getPreamble(); Attributes getFileMetaInformation(); final int level(); final int tag(); final VR vr(); final int length(); final long getPosition(); void setPosition(long pos); long getTagPosition(); final boolean bigEndian(); final boolean explicitVR(); boolean isExcludeBulkData(); boolean isIncludeBulkDataURI(); static String toAttributePath(List<ItemPointer> itemPointers, int tag); String getAttributePath(); @Override void close(); @Override synchronized void mark(int readlimit); @Override synchronized void reset(); @Override final int read(); @Override final int read(byte[] b, int off, int len); @Override final int read(byte[] b); @Override final long skip(long n); void skipFully(long n); void readFully(byte b[]); void readFully(byte b[], int off, int len); void readFully(short[] s, int off, int len); void readHeader(); boolean readItemHeader(); Attributes readCommand(); Attributes readDataset(int len, int stopTag); Attributes readFileMetaInformation(); void readAttributes(Attributes attrs, int len, int stopTag); @Override void readValue(DicomInputStream dis, Attributes attrs); @Override BulkData createBulkData(DicomInputStream dis); @Override void readValue(DicomInputStream dis, Sequence seq); @Override void readValue(DicomInputStream dis, Fragments frags); @Override void startDataset(DicomInputStream dis); @Override void endDataset(DicomInputStream dis); Attributes readItem(); byte[] readValue(); }
@Test public void testWriteCommand() throws IOException { DicomOutputStream out = new DicomOutputStream( new FileOutputStream(file), UID.ImplicitVRLittleEndian); try { out.writeCommand(cechorq()); } finally { out.close(); } assertEquals(4, readAttributes().size()); }
public void writeCommand(Attributes cmd) throws IOException { if (explicitVR || bigEndian) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian); cmd.writeGroupTo(this, Tag.CommandGroupLength); }
DicomOutputStream extends FilterOutputStream { public void writeCommand(Attributes cmd) throws IOException { if (explicitVR || bigEndian) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian); cmd.writeGroupTo(this, Tag.CommandGroupLength); } }
DicomOutputStream extends FilterOutputStream { public void writeCommand(Attributes cmd) throws IOException { if (explicitVR || bigEndian) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian); cmd.writeGroupTo(this, Tag.CommandGroupLength); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public void writeCommand(Attributes cmd) throws IOException { if (explicitVR || bigEndian) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian); cmd.writeGroupTo(this, Tag.CommandGroupLength); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public void writeCommand(Attributes cmd) throws IOException { if (explicitVR || bigEndian) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian); cmd.writeGroupTo(this, Tag.CommandGroupLength); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testMatches() { ItemPointer ip = new ItemPointer(Tag.RequestAttributesSequence); AttributeSelector selector = new AttributeSelector(Tag.StudyInstanceUID, null, ip); assertTrue(selector.matches(Collections.singletonList(ip), null, Tag.StudyInstanceUID)); }
public boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag) { int level; if (tag != this.tag || !Objects.equals(privateCreator, this.privateCreator) || (itemPointers.size() != (level = level()))) { return false; } for (int i = 0; i < level; i++) { ItemPointer itemPointer = itemPointers.get(i); ItemPointer other = itemPointer(i); if (!(itemPointer.itemIndex < 0 || other.itemIndex < 0 ? itemPointer.equalsIgnoreItemIndex(other) : itemPointer.equals(other))) { return false; } } return true; }
AttributeSelector implements Serializable { public boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag) { int level; if (tag != this.tag || !Objects.equals(privateCreator, this.privateCreator) || (itemPointers.size() != (level = level()))) { return false; } for (int i = 0; i < level; i++) { ItemPointer itemPointer = itemPointers.get(i); ItemPointer other = itemPointer(i); if (!(itemPointer.itemIndex < 0 || other.itemIndex < 0 ? itemPointer.equalsIgnoreItemIndex(other) : itemPointer.equals(other))) { return false; } } return true; } }
AttributeSelector implements Serializable { public boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag) { int level; if (tag != this.tag || !Objects.equals(privateCreator, this.privateCreator) || (itemPointers.size() != (level = level()))) { return false; } for (int i = 0; i < level; i++) { ItemPointer itemPointer = itemPointers.get(i); ItemPointer other = itemPointer(i); if (!(itemPointer.itemIndex < 0 || other.itemIndex < 0 ? itemPointer.equalsIgnoreItemIndex(other) : itemPointer.equals(other))) { return false; } } return true; } AttributeSelector(int tag); AttributeSelector(int tag, String privateCreator); AttributeSelector(int tag, String privateCreator, ItemPointer... itemPointers); AttributeSelector(int tag, String privateCreator, List<ItemPointer> itemPointers); }
AttributeSelector implements Serializable { public boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag) { int level; if (tag != this.tag || !Objects.equals(privateCreator, this.privateCreator) || (itemPointers.size() != (level = level()))) { return false; } for (int i = 0; i < level; i++) { ItemPointer itemPointer = itemPointers.get(i); ItemPointer other = itemPointer(i); if (!(itemPointer.itemIndex < 0 || other.itemIndex < 0 ? itemPointer.equalsIgnoreItemIndex(other) : itemPointer.equals(other))) { return false; } } return true; } AttributeSelector(int tag); AttributeSelector(int tag, String privateCreator); AttributeSelector(int tag, String privateCreator, ItemPointer... itemPointers); AttributeSelector(int tag, String privateCreator, List<ItemPointer> itemPointers); int tag(); String privateCreator(); int level(); ItemPointer itemPointer(int index); String selectStringValue(Attributes attrs, int valueIndex, String defVal); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static AttributeSelector valueOf(String s); boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag); }
AttributeSelector implements Serializable { public boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag) { int level; if (tag != this.tag || !Objects.equals(privateCreator, this.privateCreator) || (itemPointers.size() != (level = level()))) { return false; } for (int i = 0; i < level; i++) { ItemPointer itemPointer = itemPointers.get(i); ItemPointer other = itemPointer(i); if (!(itemPointer.itemIndex < 0 || other.itemIndex < 0 ? itemPointer.equalsIgnoreItemIndex(other) : itemPointer.equals(other))) { return false; } } return true; } AttributeSelector(int tag); AttributeSelector(int tag, String privateCreator); AttributeSelector(int tag, String privateCreator, ItemPointer... itemPointers); AttributeSelector(int tag, String privateCreator, List<ItemPointer> itemPointers); int tag(); String privateCreator(); int level(); ItemPointer itemPointer(int index); String selectStringValue(Attributes attrs, int valueIndex, String defVal); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static AttributeSelector valueOf(String s); boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag); }
@Test public void testWriteDataset() throws IOException { DicomOutputStream out = new DicomOutputStream(file); }
public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testWriteDatasetWithGroupLength() throws IOException { DicomOutputStream out = new DicomOutputStream(file); out.setEncodingOptions( new DicomEncodingOptions(true, true, false, true, false)); testWriteDataset(out, UID.ExplicitVRLittleEndian); }
public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testWriteDatasetWithoutUndefLength() throws IOException { DicomOutputStream out = new DicomOutputStream(file); out.setEncodingOptions( new DicomEncodingOptions(false, false, false, false, false)); testWriteDataset(out, UID.ExplicitVRLittleEndian); }
public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testWriteDatasetWithUndefEmptyLength() throws IOException { DicomOutputStream out = new DicomOutputStream(file); out.setEncodingOptions( new DicomEncodingOptions(false, true, true, true, true)); testWriteDataset(out, UID.ExplicitVRLittleEndian); }
public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public final void setEncodingOptions(DicomEncodingOptions encOpts) { if (encOpts == null) throw new NullPointerException(); this.encOpts = encOpts; } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testSerializeDataset() throws Exception { ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream(file)); try { out.writeObject(dataset()); out.writeUTF("END"); } finally { out.close(); } deserializeAttributes(); }
public void close() throws IOException { try { finish(); } catch (IOException ignored) { } super.close(); }
DicomOutputStream extends FilterOutputStream { public void close() throws IOException { try { finish(); } catch (IOException ignored) { } super.close(); } }
DicomOutputStream extends FilterOutputStream { public void close() throws IOException { try { finish(); } catch (IOException ignored) { } super.close(); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public void close() throws IOException { try { finish(); } catch (IOException ignored) { } super.close(); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public void close() throws IOException { try { finish(); } catch (IOException ignored) { } super.close(); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test(expected = IllegalStateException.class) public void testWriteFMIDeflated() throws IOException { try (DicomOutputStream out = new DicomOutputStream( new ByteArrayOutputStream(), UID.DeflatedExplicitVRLittleEndian)) { out.writeFileMetaInformation( Attributes.createFileMetaInformation(UIDUtils.createUID(), UID.CTImageStorage, UID.DeflatedExplicitVRLittleEndian)); } }
public void writeFileMetaInformation(Attributes fmi) throws IOException { if (!explicitVR || bigEndian || countingOutputStream != null) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian + ", deflated=" + (countingOutputStream != null)); write(preamble); write(DICM); fmi.writeGroupTo(this, Tag.FileMetaInformationGroupLength); }
DicomOutputStream extends FilterOutputStream { public void writeFileMetaInformation(Attributes fmi) throws IOException { if (!explicitVR || bigEndian || countingOutputStream != null) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian + ", deflated=" + (countingOutputStream != null)); write(preamble); write(DICM); fmi.writeGroupTo(this, Tag.FileMetaInformationGroupLength); } }
DicomOutputStream extends FilterOutputStream { public void writeFileMetaInformation(Attributes fmi) throws IOException { if (!explicitVR || bigEndian || countingOutputStream != null) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian + ", deflated=" + (countingOutputStream != null)); write(preamble); write(DICM); fmi.writeGroupTo(this, Tag.FileMetaInformationGroupLength); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public void writeFileMetaInformation(Attributes fmi) throws IOException { if (!explicitVR || bigEndian || countingOutputStream != null) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian + ", deflated=" + (countingOutputStream != null)); write(preamble); write(DICM); fmi.writeGroupTo(this, Tag.FileMetaInformationGroupLength); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public void writeFileMetaInformation(Attributes fmi) throws IOException { if (!explicitVR || bigEndian || countingOutputStream != null) throw new IllegalStateException("explicitVR=" + explicitVR + ", bigEndian=" + bigEndian + ", deflated=" + (countingOutputStream != null)); write(preamble); write(DICM); fmi.writeGroupTo(this, Tag.FileMetaInformationGroupLength); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testWriteDeflatedEvenLength() throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); try (DicomOutputStream dos = new DicomOutputStream( out, UID.DeflatedExplicitVRLittleEndian)) { Attributes attrs = new Attributes(); attrs.setString(Tag.SOPClassUID, VR.UI, UID.CTImageStorage); dos.writeDataset(null, attrs); } assertEquals("odd number of bytes", 0, out.size() & 1); }
public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
DicomOutputStream extends FilterOutputStream { public void writeDataset(Attributes fmi, Attributes dataset) throws IOException { if (fmi != null) { writeFileMetaInformation(fmi); switchTransferSyntax(fmi.getString(Tag.TransferSyntaxUID, null)); } if (dataset.bigEndian() != bigEndian || encOpts.groupLength || !encOpts.undefSequenceLength || !encOpts.undefItemLength) dataset = new Attributes(dataset, bigEndian); if (encOpts.groupLength) dataset.calcLength(encOpts, explicitVR); dataset.writeTo(this); } DicomOutputStream(OutputStream out, String tsuid); DicomOutputStream(File file); final void setPreamble(byte[] preamble); final boolean isExplicitVR(); final boolean isBigEndian(); final DicomEncodingOptions getEncodingOptions(); final void setEncodingOptions(DicomEncodingOptions encOpts); @Override void write(byte[] b, int off, int len); void writeCommand(Attributes cmd); void writeFileMetaInformation(Attributes fmi); void writeDataset(Attributes fmi, Attributes dataset); void switchTransferSyntax(String tsuid); void writeHeader(int tag, VR vr, int len); void writeAttribute(int tag, VR vr, Object value, SpecificCharacterSet cs); void writeAttribute(int tag, VR vr, byte[] val); void writeAttribute(int tag, VR vr, Value val); void writeGroupLength(int tag, int len); void finish(); void close(); }
@Test public void testGetRecordType() { RecordFactory f = new RecordFactory(); assertEquals(RecordType.IMAGE, f.getRecordType(UID.SecondaryCaptureImageStorage)); }
public RecordType getRecordType(String cuid) { if (cuid == null) throw new NullPointerException(); lazyLoadDefaultConfiguration(); RecordType recordType = recordTypes.get(cuid); return recordType != null ? recordType : RecordType.PRIVATE; }
RecordFactory { public RecordType getRecordType(String cuid) { if (cuid == null) throw new NullPointerException(); lazyLoadDefaultConfiguration(); RecordType recordType = recordTypes.get(cuid); return recordType != null ? recordType : RecordType.PRIVATE; } }
RecordFactory { public RecordType getRecordType(String cuid) { if (cuid == null) throw new NullPointerException(); lazyLoadDefaultConfiguration(); RecordType recordType = recordTypes.get(cuid); return recordType != null ? recordType : RecordType.PRIVATE; } }
RecordFactory { public RecordType getRecordType(String cuid) { if (cuid == null) throw new NullPointerException(); lazyLoadDefaultConfiguration(); RecordType recordType = recordTypes.get(cuid); return recordType != null ? recordType : RecordType.PRIVATE; } void loadDefaultConfiguration(); void loadConfiguration(String uri); RecordType getRecordType(String cuid); RecordType setRecordType(String cuid, RecordType type); void setRecordKeys(RecordType type, int[] keys); int[] getRecordKeys(RecordType type); String getPrivateRecordUID(String cuid); String setPrivateRecordUID(String cuid, String uid); int[] setPrivateRecordKeys(String uid, int[] keys); Attributes createRecord(Attributes dataset, Attributes fmi, String[] fileIDs); Attributes createRecord(RecordType type, String privRecUID, Attributes dataset, Attributes fmi, String[] fileIDs); }
RecordFactory { public RecordType getRecordType(String cuid) { if (cuid == null) throw new NullPointerException(); lazyLoadDefaultConfiguration(); RecordType recordType = recordTypes.get(cuid); return recordType != null ? recordType : RecordType.PRIVATE; } void loadDefaultConfiguration(); void loadConfiguration(String uri); RecordType getRecordType(String cuid); RecordType setRecordType(String cuid, RecordType type); void setRecordKeys(RecordType type, int[] keys); int[] getRecordKeys(RecordType type); String getPrivateRecordUID(String cuid); String setPrivateRecordUID(String cuid, String uid); int[] setPrivateRecordKeys(String uid, int[] keys); Attributes createRecord(Attributes dataset, Attributes fmi, String[] fileIDs); Attributes createRecord(RecordType type, String privRecUID, Attributes dataset, Attributes fmi, String[] fileIDs); }
@Test public void mergeNestedKeys() throws Exception { Attributes attrs = withSSA(returnKeys()); FindSCU.mergeKeys(attrs, withSSA(matchingKeys())); assertEquals(mergedKeys(), attrs.getNestedDataset(Tag.ScheduledStepAttributesSequence)); }
static void mergeKeys(Attributes attrs, Attributes keys) { try { attrs.accept(new MergeNested(keys), false); } catch (Exception e) { throw new RuntimeException(e); } attrs.addAll(keys); }
FindSCU { static void mergeKeys(Attributes attrs, Attributes keys) { try { attrs.accept(new MergeNested(keys), false); } catch (Exception e) { throw new RuntimeException(e); } attrs.addAll(keys); } }
FindSCU { static void mergeKeys(Attributes attrs, Attributes keys) { try { attrs.accept(new MergeNested(keys), false); } catch (Exception e) { throw new RuntimeException(e); } attrs.addAll(keys); } FindSCU(); }
FindSCU { static void mergeKeys(Attributes attrs, Attributes keys) { try { attrs.accept(new MergeNested(keys), false); } catch (Exception e) { throw new RuntimeException(e); } attrs.addAll(keys); } FindSCU(); final void setPriority(int priority); final void setInformationModel(InformationModel model, String[] tss, EnumSet<QueryOption> queryOptions); void addLevel(String s); final void setCancelAfter(int cancelAfter); final void setOutputDirectory(File outDir); final void setOutputFileFormat(String outFileFormat); final void setXSLT(File xsltFile); final void setXML(boolean xml); final void setXMLIndent(boolean indent); final void setXMLIncludeKeyword(boolean includeKeyword); final void setXMLIncludeNamespaceDeclaration( boolean includeNamespaceDeclaration); final void setConcatenateOutputFiles(boolean catOut); final void setInputFilter(int[] inFilter); ApplicationEntity getApplicationEntity(); Connection getRemoteConnection(); AAssociateRQ getAAssociateRQ(); Association getAssociation(); Device getDevice(); Attributes getKeys(); @SuppressWarnings("unchecked") static void main(String[] args); void open(); void close(); void query(File f); void query(); void query( DimseRSPHandler rspHandler); }
FindSCU { static void mergeKeys(Attributes attrs, Attributes keys) { try { attrs.accept(new MergeNested(keys), false); } catch (Exception e) { throw new RuntimeException(e); } attrs.addAll(keys); } FindSCU(); final void setPriority(int priority); final void setInformationModel(InformationModel model, String[] tss, EnumSet<QueryOption> queryOptions); void addLevel(String s); final void setCancelAfter(int cancelAfter); final void setOutputDirectory(File outDir); final void setOutputFileFormat(String outFileFormat); final void setXSLT(File xsltFile); final void setXML(boolean xml); final void setXMLIndent(boolean indent); final void setXMLIncludeKeyword(boolean includeKeyword); final void setXMLIncludeNamespaceDeclaration( boolean includeNamespaceDeclaration); final void setConcatenateOutputFiles(boolean catOut); final void setInputFilter(int[] inFilter); ApplicationEntity getApplicationEntity(); Connection getRemoteConnection(); AAssociateRQ getAAssociateRQ(); Association getAssociation(); Device getDevice(); Attributes getKeys(); @SuppressWarnings("unchecked") static void main(String[] args); void open(); void close(); void query(File f); void query(); void query( DimseRSPHandler rspHandler); }
@Test public void testReconfigure() throws Exception { Device d1 = createDevice("test", "AET1"); Device d2 = createDevice("test", "AET2"); d1.reconfigure(d2); ApplicationEntity ae = d1.getApplicationEntity("AET2"); assertNotNull(ae); List<Connection> conns = ae.getConnections(); assertEquals(1, conns.size()); }
public void reconfigure(Device from) throws IOException, GeneralSecurityException { setDeviceAttributes(from); reconfigureConnections(from); reconfigureApplicationEntities(from); reconfigureWebApplications(from); reconfigureKeycloakClients(from); reconfigureDeviceExtensions(from); }
Device implements Serializable { public void reconfigure(Device from) throws IOException, GeneralSecurityException { setDeviceAttributes(from); reconfigureConnections(from); reconfigureApplicationEntities(from); reconfigureWebApplications(from); reconfigureKeycloakClients(from); reconfigureDeviceExtensions(from); } }
Device implements Serializable { public void reconfigure(Device from) throws IOException, GeneralSecurityException { setDeviceAttributes(from); reconfigureConnections(from); reconfigureApplicationEntities(from); reconfigureWebApplications(from); reconfigureKeycloakClients(from); reconfigureDeviceExtensions(from); } Device(); Device(String name); }
Device implements Serializable { public void reconfigure(Device from) throws IOException, GeneralSecurityException { setDeviceAttributes(from); reconfigureConnections(from); reconfigureApplicationEntities(from); reconfigureWebApplications(from); reconfigureKeycloakClients(from); reconfigureDeviceExtensions(from); } Device(); Device(String name); final String getDeviceName(); final void setDeviceName(String name); final String getDescription(); final void setDescription(String description); String getDeviceUID(); void setDeviceUID(String deviceUID); final String getManufacturer(); final void setManufacturer(String manufacturer); final String getManufacturerModelName(); final void setManufacturerModelName(String manufacturerModelName); final String[] getSoftwareVersions(); final void setSoftwareVersions(String... softwareVersions); final String getStationName(); final void setStationName(String stationName); final String getDeviceSerialNumber(); final void setDeviceSerialNumber(String deviceSerialNumber); final String[] getPrimaryDeviceTypes(); void setPrimaryDeviceTypes(String... primaryDeviceTypes); final String[] getInstitutionNames(); void setInstitutionNames(String... names); final Code[] getInstitutionCodes(); void setInstitutionCodes(Code... codes); final String[] getInstitutionAddresses(); void setInstitutionAddresses(String... addresses); final String[] getInstitutionalDepartmentNames(); void setInstitutionalDepartmentNames(String... names); final Issuer getIssuerOfPatientID(); final void setIssuerOfPatientID(Issuer issuerOfPatientID); final Issuer getIssuerOfAccessionNumber(); final void setIssuerOfAccessionNumber(Issuer issuerOfAccessionNumber); final Issuer getOrderPlacerIdentifier(); final void setOrderPlacerIdentifier(Issuer orderPlacerIdentifier); final Issuer getOrderFillerIdentifier(); final void setOrderFillerIdentifier(Issuer orderFillerIdentifier); final Issuer getIssuerOfAdmissionID(); final void setIssuerOfAdmissionID(Issuer issuerOfAdmissionID); final Issuer getIssuerOfServiceEpisodeID(); final void setIssuerOfServiceEpisodeID(Issuer issuerOfServiceEpisodeID); final Issuer getIssuerOfContainerIdentifier(); final void setIssuerOfContainerIdentifier(Issuer issuerOfContainerIdentifier); final Issuer getIssuerOfSpecimenIdentifier(); final void setIssuerOfSpecimenIdentifier(Issuer issuerOfSpecimenIdentifier); X509Certificate[] getAuthorizedNodeCertificates(String ref); void setAuthorizedNodeCertificates(String ref, X509Certificate... certs); X509Certificate[] removeAuthorizedNodeCertificates(String ref); void removeAllAuthorizedNodeCertificates(); X509Certificate[] getAllAuthorizedNodeCertificates(); String[] getAuthorizedNodeCertificateRefs(); final String getTrustStoreURL(); final void setTrustStoreURL(String trustStoreURL); final String getTrustStoreType(); final void setTrustStoreType(String trustStoreType); final String getTrustStorePin(); final void setTrustStorePin(String trustStorePin); final String getTrustStorePinProperty(); final void setTrustStorePinProperty(String trustStorePinProperty); X509Certificate[] getThisNodeCertificates(String ref); void setThisNodeCertificates(String ref, X509Certificate... certs); X509Certificate[] removeThisNodeCertificates(String ref); final String getKeyStoreURL(); final void setKeyStoreURL(String keyStoreURL); final String getKeyStoreType(); final void setKeyStoreType(String keyStoreType); final String getKeyStorePin(); final void setKeyStorePin(String keyStorePin); final String getKeyStorePinProperty(); final void setKeyStorePinProperty(String keyStorePinProperty); final String getKeyStoreKeyPin(); final void setKeyStoreKeyPin(String keyStorePin); final String getKeyStoreKeyPinProperty(); final void setKeyStoreKeyPinProperty(String keyStoreKeyPinProperty); void removeAllThisNodeCertificates(); X509Certificate[] getAllThisNodeCertificates(); String[] getThisNodeCertificateRefs(); final String[] getRelatedDeviceRefs(); void setRelatedDeviceRefs(String... refs); final byte[][] getVendorData(); void setVendorData(byte[]... vendorData); final boolean isInstalled(); final void setInstalled(boolean installed); boolean isRoleSelectionNegotiationLenient(); void setRoleSelectionNegotiationLenient(boolean roleSelectionNegotiationLenient); void setTimeZoneOfDevice(TimeZone timeZoneOfDevice); TimeZone getTimeZoneOfDevice(); final void setDimseRQHandler(DimseRQHandler dimseRQHandler); final DimseRQHandler getDimseRQHandler(); final AssociationHandler getAssociationHandler(); void setAssociationHandler(AssociationHandler associationHandler); ConnectionMonitor getConnectionMonitor(); void setConnectionMonitor(ConnectionMonitor connectionMonitor); AssociationMonitor getAssociationMonitor(); void setAssociationMonitor(AssociationMonitor associationMonitor); void bindConnections(); void rebindConnections(); void unbindConnections(); final Executor getExecutor(); final void setExecutor(Executor executor); final ScheduledExecutorService getScheduledExecutor(); final void setScheduledExecutor(ScheduledExecutorService executor); void addConnection(Connection conn); boolean removeConnection(Connection conn); List<Connection> listConnections(); Connection connectionWithEqualsRDN(Connection other); void addApplicationEntity(ApplicationEntity ae); ApplicationEntity removeApplicationEntity(ApplicationEntity ae); ApplicationEntity removeApplicationEntity(String aet); Collection<String> getWebApplicationNames(); Collection<WebApplication> getWebApplications(); Collection<WebApplication> getWebApplicationsWithServiceClass(WebApplication.ServiceClass serviceClass); WebApplication getWebApplication(String name); void addWebApplication(WebApplication webapp); WebApplication removeWebApplication(WebApplication webapp); WebApplication removeWebApplication(String name); Collection<String> getKeycloakClientIDs(); Collection<KeycloakClient> getKeycloakClients(); KeycloakClient getKeycloakClient(String clientID); void addKeycloakClient(KeycloakClient client); KeycloakClient removeKeycloakClient(KeycloakClient client); KeycloakClient removeKeycloakClient(String name); void addDeviceExtension(DeviceExtension ext); boolean removeDeviceExtension(DeviceExtension ext); final int getLimitOpenAssociations(); final void setLimitOpenAssociations(int limit); int getLimitAssociationsInitiatedBy(String callingAET); void setLimitAssociationsInitiatedBy(String callingAET, int limit); String[] getLimitAssociationsInitiatedBy(); void setLimitAssociationsInitiatedBy(String[] values); Association [] listOpenAssociations(); int getNumberOfOpenAssociations(); int getNumberOfAssociationsInitiatedBy(String callingAET); void waitForNoOpenConnections(); boolean isLimitOfAssociationsExceeded(AAssociateRQ rq); ApplicationEntity getApplicationEntity(String aet); ApplicationEntity getApplicationEntity(String aet, boolean matchOtherAETs); Collection<String> getApplicationAETitles(); Collection<ApplicationEntity> getApplicationEntities(); final void setKeyManager(KeyManager km); final KeyManager getKeyManager(); final void setTrustManager(TrustManager tm); final TrustManager getTrustManager(); SSLContext sslContext(); KeyManager[] keyManagers(); TrustManager[] trustManagers(); void execute(Runnable command); ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit); ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit); ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit); @Override String toString(); StringBuilder promptTo(StringBuilder sb, String indent); void reconfigure(Device from); void reconfigureConnections(List<Connection> conns, List<Connection> src); Collection<DeviceExtension> listDeviceExtensions(); @SuppressWarnings("unchecked") T getDeviceExtension(Class<T> clazz); T getDeviceExtensionNotNull(Class<T> clazz); }
Device implements Serializable { public void reconfigure(Device from) throws IOException, GeneralSecurityException { setDeviceAttributes(from); reconfigureConnections(from); reconfigureApplicationEntities(from); reconfigureWebApplications(from); reconfigureKeycloakClients(from); reconfigureDeviceExtensions(from); } Device(); Device(String name); final String getDeviceName(); final void setDeviceName(String name); final String getDescription(); final void setDescription(String description); String getDeviceUID(); void setDeviceUID(String deviceUID); final String getManufacturer(); final void setManufacturer(String manufacturer); final String getManufacturerModelName(); final void setManufacturerModelName(String manufacturerModelName); final String[] getSoftwareVersions(); final void setSoftwareVersions(String... softwareVersions); final String getStationName(); final void setStationName(String stationName); final String getDeviceSerialNumber(); final void setDeviceSerialNumber(String deviceSerialNumber); final String[] getPrimaryDeviceTypes(); void setPrimaryDeviceTypes(String... primaryDeviceTypes); final String[] getInstitutionNames(); void setInstitutionNames(String... names); final Code[] getInstitutionCodes(); void setInstitutionCodes(Code... codes); final String[] getInstitutionAddresses(); void setInstitutionAddresses(String... addresses); final String[] getInstitutionalDepartmentNames(); void setInstitutionalDepartmentNames(String... names); final Issuer getIssuerOfPatientID(); final void setIssuerOfPatientID(Issuer issuerOfPatientID); final Issuer getIssuerOfAccessionNumber(); final void setIssuerOfAccessionNumber(Issuer issuerOfAccessionNumber); final Issuer getOrderPlacerIdentifier(); final void setOrderPlacerIdentifier(Issuer orderPlacerIdentifier); final Issuer getOrderFillerIdentifier(); final void setOrderFillerIdentifier(Issuer orderFillerIdentifier); final Issuer getIssuerOfAdmissionID(); final void setIssuerOfAdmissionID(Issuer issuerOfAdmissionID); final Issuer getIssuerOfServiceEpisodeID(); final void setIssuerOfServiceEpisodeID(Issuer issuerOfServiceEpisodeID); final Issuer getIssuerOfContainerIdentifier(); final void setIssuerOfContainerIdentifier(Issuer issuerOfContainerIdentifier); final Issuer getIssuerOfSpecimenIdentifier(); final void setIssuerOfSpecimenIdentifier(Issuer issuerOfSpecimenIdentifier); X509Certificate[] getAuthorizedNodeCertificates(String ref); void setAuthorizedNodeCertificates(String ref, X509Certificate... certs); X509Certificate[] removeAuthorizedNodeCertificates(String ref); void removeAllAuthorizedNodeCertificates(); X509Certificate[] getAllAuthorizedNodeCertificates(); String[] getAuthorizedNodeCertificateRefs(); final String getTrustStoreURL(); final void setTrustStoreURL(String trustStoreURL); final String getTrustStoreType(); final void setTrustStoreType(String trustStoreType); final String getTrustStorePin(); final void setTrustStorePin(String trustStorePin); final String getTrustStorePinProperty(); final void setTrustStorePinProperty(String trustStorePinProperty); X509Certificate[] getThisNodeCertificates(String ref); void setThisNodeCertificates(String ref, X509Certificate... certs); X509Certificate[] removeThisNodeCertificates(String ref); final String getKeyStoreURL(); final void setKeyStoreURL(String keyStoreURL); final String getKeyStoreType(); final void setKeyStoreType(String keyStoreType); final String getKeyStorePin(); final void setKeyStorePin(String keyStorePin); final String getKeyStorePinProperty(); final void setKeyStorePinProperty(String keyStorePinProperty); final String getKeyStoreKeyPin(); final void setKeyStoreKeyPin(String keyStorePin); final String getKeyStoreKeyPinProperty(); final void setKeyStoreKeyPinProperty(String keyStoreKeyPinProperty); void removeAllThisNodeCertificates(); X509Certificate[] getAllThisNodeCertificates(); String[] getThisNodeCertificateRefs(); final String[] getRelatedDeviceRefs(); void setRelatedDeviceRefs(String... refs); final byte[][] getVendorData(); void setVendorData(byte[]... vendorData); final boolean isInstalled(); final void setInstalled(boolean installed); boolean isRoleSelectionNegotiationLenient(); void setRoleSelectionNegotiationLenient(boolean roleSelectionNegotiationLenient); void setTimeZoneOfDevice(TimeZone timeZoneOfDevice); TimeZone getTimeZoneOfDevice(); final void setDimseRQHandler(DimseRQHandler dimseRQHandler); final DimseRQHandler getDimseRQHandler(); final AssociationHandler getAssociationHandler(); void setAssociationHandler(AssociationHandler associationHandler); ConnectionMonitor getConnectionMonitor(); void setConnectionMonitor(ConnectionMonitor connectionMonitor); AssociationMonitor getAssociationMonitor(); void setAssociationMonitor(AssociationMonitor associationMonitor); void bindConnections(); void rebindConnections(); void unbindConnections(); final Executor getExecutor(); final void setExecutor(Executor executor); final ScheduledExecutorService getScheduledExecutor(); final void setScheduledExecutor(ScheduledExecutorService executor); void addConnection(Connection conn); boolean removeConnection(Connection conn); List<Connection> listConnections(); Connection connectionWithEqualsRDN(Connection other); void addApplicationEntity(ApplicationEntity ae); ApplicationEntity removeApplicationEntity(ApplicationEntity ae); ApplicationEntity removeApplicationEntity(String aet); Collection<String> getWebApplicationNames(); Collection<WebApplication> getWebApplications(); Collection<WebApplication> getWebApplicationsWithServiceClass(WebApplication.ServiceClass serviceClass); WebApplication getWebApplication(String name); void addWebApplication(WebApplication webapp); WebApplication removeWebApplication(WebApplication webapp); WebApplication removeWebApplication(String name); Collection<String> getKeycloakClientIDs(); Collection<KeycloakClient> getKeycloakClients(); KeycloakClient getKeycloakClient(String clientID); void addKeycloakClient(KeycloakClient client); KeycloakClient removeKeycloakClient(KeycloakClient client); KeycloakClient removeKeycloakClient(String name); void addDeviceExtension(DeviceExtension ext); boolean removeDeviceExtension(DeviceExtension ext); final int getLimitOpenAssociations(); final void setLimitOpenAssociations(int limit); int getLimitAssociationsInitiatedBy(String callingAET); void setLimitAssociationsInitiatedBy(String callingAET, int limit); String[] getLimitAssociationsInitiatedBy(); void setLimitAssociationsInitiatedBy(String[] values); Association [] listOpenAssociations(); int getNumberOfOpenAssociations(); int getNumberOfAssociationsInitiatedBy(String callingAET); void waitForNoOpenConnections(); boolean isLimitOfAssociationsExceeded(AAssociateRQ rq); ApplicationEntity getApplicationEntity(String aet); ApplicationEntity getApplicationEntity(String aet, boolean matchOtherAETs); Collection<String> getApplicationAETitles(); Collection<ApplicationEntity> getApplicationEntities(); final void setKeyManager(KeyManager km); final KeyManager getKeyManager(); final void setTrustManager(TrustManager tm); final TrustManager getTrustManager(); SSLContext sslContext(); KeyManager[] keyManagers(); TrustManager[] trustManagers(); void execute(Runnable command); ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit); ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit); ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit); @Override String toString(); StringBuilder promptTo(StringBuilder sb, String indent); void reconfigure(Device from); void reconfigureConnections(List<Connection> conns, List<Connection> src); Collection<DeviceExtension> listDeviceExtensions(); @SuppressWarnings("unchecked") T getDeviceExtension(Class<T> clazz); T getDeviceExtensionNotNull(Class<T> clazz); }
@Test public void testEncodeGermanPersonName() { assertArrayEquals(GERMAN_PERSON_NAME_BYTE, iso8859_1().encode(GERMAN_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeGermanPersonName() { assertEquals(GERMAN_PERSON_NAME, iso8859_1().decode(GERMAN_PERSON_NAME_BYTE)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeFrenchPersonName() { assertArrayEquals(FRENCH_PERSON_NAME_BYTE, iso8859_1().encode(FRENCH_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeFrenchPersonName() { assertEquals(FRENCH_PERSON_NAME, iso8859_1().decode(FRENCH_PERSON_NAME_BYTE)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeRussianPersonName() { assertArrayEquals(RUSSIAN_PERSON_NAME_BYTE, iso8859_5().encode(RUSSIAN_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeRussianPersonName() { assertEquals(RUSSIAN_PERSON_NAME, iso8859_5().decode(RUSSIAN_PERSON_NAME_BYTE)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeArabicPersonName() { assertArrayEquals(ARABIC_PERSON_NAME_BYTE, iso8859_6().encode(ARABIC_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeArabicPersonName() { assertEquals(ARABIC_PERSON_NAME, iso8859_6().decode(ARABIC_PERSON_NAME_BYTE)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeGreekPersonName() { assertArrayEquals(GREEK_PERSON_NAME_BYTE, iso8859_7().encode(GREEK_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void test() { Attributes dataset = new Attributes(); dataset.setString(Tag.SpecificCharacterSet, VR.CS, null, "ISO 2022 IR 87"); dataset.setString(Tag.ImageType, VR.CS, "DERIVED", "PRIMARY"); Attributes item = new Attributes(2); dataset.newSequence(Tag.SourceImageSequence, 1).add(item); item.setString(Tag.ReferencedSOPClassUID, VR.UI, UID.CTImageStorage); item.setString(Tag.ReferencedSOPInstanceUID, VR.UI, "1.2.3.4"); dataset.setString(Tag.PatientName, VR.PN, "af^ag=if^ig=pf^pg"); dataset.setBytes("PRIVATE", 0x00090002, VR.OB, BYTE01); dataset.setDouble(Tag.FrameTime, VR.DS, 33.0); dataset.setInt(Tag.SamplesPerPixel, VR.US, 1); dataset.setInt(Tag.NumberOfFrames, VR.IS, 1); dataset.setInt(Tag.FrameIncrementPointer, VR.AT, Tag.FrameTime); dataset.setValue(Tag.OverlayData, VR.OW, new BulkData(null, "file:/OverlayData", false)); Fragments frags = dataset.newFragments(Tag.PixelData, VR.OB, 2); frags.add(null); frags.add(new BulkData(null, "file:/PixelData", false)); StringWriter writer = new StringWriter(); JsonGenerator gen = Json.createGenerator(writer); new JSONWriter(gen).write(dataset); gen.flush(); assertEquals(RESULT, writer.toString()); }
public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } JSONWriter(JsonGenerator gen); }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } JSONWriter(JsonGenerator gen); String getReplaceBulkDataURI(); void setReplaceBulkDataURI(String replaceBulkDataURI); void write(Attributes attrs); @Override void readValue(DicomInputStream dis, Attributes attrs); @Override void readValue(DicomInputStream dis, Sequence seq); @Override void readValue(DicomInputStream dis, Fragments frags); @Override void startDataset(DicomInputStream dis); @Override void endDataset(DicomInputStream dis); }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } JSONWriter(JsonGenerator gen); String getReplaceBulkDataURI(); void setReplaceBulkDataURI(String replaceBulkDataURI); void write(Attributes attrs); @Override void readValue(DicomInputStream dis, Attributes attrs); @Override void readValue(DicomInputStream dis, Sequence seq); @Override void readValue(DicomInputStream dis, Fragments frags); @Override void startDataset(DicomInputStream dis); @Override void endDataset(DicomInputStream dis); }
@Test public void testDecodeGreekPersonName() { assertEquals(GREEK_PERSON_NAME, iso8859_7().decode(GREEK_PERSON_NAME_BYTE)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeHebrewPersonName() { assertArrayEquals(HEBREW_PERSON_NAME_BYTE, iso8859_8().encode(HEBREW_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeHebrewPersonName() { assertEquals(HEBREW_PERSON_NAME, iso8859_8().decode(HEBREW_PERSON_NAME_BYTE)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeJapanesePersonNameASCII() { assertArrayEquals(JAPANESE_PERSON_NAME_ASCII_BYTES, jisX0208().encode(JAPANESE_PERSON_NAME_ASCII, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeJapanesePersonNameASCII() { assertEquals(JAPANESE_PERSON_NAME_ASCII, jisX0208().decode(JAPANESE_PERSON_NAME_ASCII_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeJapanesePersonNameJISX0201() { assertArrayEquals(JAPANESE_PERSON_NAME_JISX0201_BYTES, jisX0201().encode(JAPANESE_PERSON_NAME_JISX0201, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeJapanesePersonNameJISX0201() { assertEquals(JAPANESE_PERSON_NAME_JISX0201, jisX0201().decode(JAPANESE_PERSON_NAME_JISX0201_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeKoreanPersonName() { assertArrayEquals(KOREAN_PERSON_NAME_BYTES, ksx1001().encode(KOREAN_PERSON_NAME, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeKoreanPersonName() { assertEquals(KOREAN_PERSON_NAME, ksx1001().decode(KOREAN_PERSON_NAME_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeKoreanLongText() { assertArrayEquals(KOREAN_LONG_TEXT_BYTES, ksx1001().encode(KOREAN_LONG_TEXT, LT_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testInfinityAndNaN() { Attributes dataset = new Attributes(); dataset.setDouble(Tag.SelectorFDValue, VR.FD, Double.NEGATIVE_INFINITY, Double.NaN, Double.POSITIVE_INFINITY); dataset.setFloat(Tag.SelectorFLValue, VR.FL, Float.NEGATIVE_INFINITY, Float.NaN, Float.POSITIVE_INFINITY); StringWriter writer = new StringWriter(); JsonGenerator gen = Json.createGenerator(writer); new JSONWriter(gen).write(dataset); gen.flush(); assertEquals(INFINITY_AND_NAN, writer.toString()); }
public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } JSONWriter(JsonGenerator gen); }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } JSONWriter(JsonGenerator gen); String getReplaceBulkDataURI(); void setReplaceBulkDataURI(String replaceBulkDataURI); void write(Attributes attrs); @Override void readValue(DicomInputStream dis, Attributes attrs); @Override void readValue(DicomInputStream dis, Sequence seq); @Override void readValue(DicomInputStream dis, Fragments frags); @Override void startDataset(DicomInputStream dis); @Override void endDataset(DicomInputStream dis); }
JSONWriter implements DicomInputHandler { public void write(Attributes attrs) { final SpecificCharacterSet cs = attrs.getSpecificCharacterSet(); gen.writeStartObject(); try { attrs.accept(new Attributes.Visitor(){ @Override public boolean visit(Attributes attrs, int tag, VR vr, Object value) throws Exception { writeAttribute(tag, vr, value, cs, attrs); return true; }}, false); } catch (Exception e) { throw new RuntimeException(e); } gen.writeEnd(); } JSONWriter(JsonGenerator gen); String getReplaceBulkDataURI(); void setReplaceBulkDataURI(String replaceBulkDataURI); void write(Attributes attrs); @Override void readValue(DicomInputStream dis, Attributes attrs); @Override void readValue(DicomInputStream dis, Sequence seq); @Override void readValue(DicomInputStream dis, Fragments frags); @Override void startDataset(DicomInputStream dis); @Override void endDataset(DicomInputStream dis); }
@Test public void testDecodeKoreanLongText() { assertEquals(KOREAN_LONG_TEXT, ksx1001().decode(KOREAN_LONG_TEXT_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeChinesePersonNameGB2312() { assertArrayEquals(CHINESE_PERSON_NAME_GB2312_BYTES, gb2312().encode(CHINESE_PERSON_NAME_GB2312, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeChinesePersonNameGB2312() { assertEquals(CHINESE_PERSON_NAME_GB2312, gb2312().decode(CHINESE_PERSON_NAME_GB2312_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeChineseLongTextGB2312() { assertArrayEquals(CHINESE_LONG_TEXT_GB2312_BYTES, gb2312().encode(CHINESE_LONG_TEXT_GB2312, LT_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeChineseLongTextGB2312() { assertEquals(CHINESE_LONG_TEXT_GB2312, gb2312().decode(CHINESE_LONG_TEXT_GB2312_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeChinesePersonNameUTF8() { assertArrayEquals(CHINESE_PERSON_NAME_UTF8_BYTES, utf8().encode(CHINESE_PERSON_NAME_UTF8, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeChinesePersonNameUTF8() { assertEquals(CHINESE_PERSON_NAME_UTF8, utf8().decode(CHINESE_PERSON_NAME_UTF8_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeChinesePersonNameGB18030() { assertArrayEquals(CHINESE_PERSON_NAME_GB18030_BYTES, gb18030().encode(CHINESE_PERSON_NAME_GB18030, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeChinesePersonNameGB18030() { assertEquals(CHINESE_PERSON_NAME_GB18030, gb18030().decode(CHINESE_PERSON_NAME_GB18030_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testEncodeChinesePersonNameGBK() { assertArrayEquals(CHINESE_PERSON_NAME_GB18030_BYTES, gbk().encode(CHINESE_PERSON_NAME_GB18030, PN_DELIMS)); }
public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public byte[] encode(String val, String delimiters) { return codecs[0].encode(val); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testPersist() throws Exception { try { config.removeDevice("Test-Device-1", null); } catch (ConfigurationNotFoundException e) {} Device device = createDevice("Test-Device-1", "TEST1^DCM4CHE"); config.persist(device, null); HL7Application app = hl7Ext.findHL7Application("TEST1^DCM4CHE"); assertEquals(2575, app.getConnections().get(0).getPort()); assertEquals("TEST2^DCM4CHE", app.getAcceptedSendingApplications()[0]); assertEquals(7, app.getAcceptedMessageTypes().length); config.removeDevice("Test-Device-1", null); }
@Override public HL7Application findHL7Application(String name) throws ConfigurationException { Device device = config.findDevice( "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))", name); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext.getHL7Application(name); }
LdapHL7Configuration extends LdapDicomConfigurationExtension implements HL7Configuration { @Override public HL7Application findHL7Application(String name) throws ConfigurationException { Device device = config.findDevice( "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))", name); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext.getHL7Application(name); } }
LdapHL7Configuration extends LdapDicomConfigurationExtension implements HL7Configuration { @Override public HL7Application findHL7Application(String name) throws ConfigurationException { Device device = config.findDevice( "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))", name); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext.getHL7Application(name); } }
LdapHL7Configuration extends LdapDicomConfigurationExtension implements HL7Configuration { @Override public HL7Application findHL7Application(String name) throws ConfigurationException { Device device = config.findDevice( "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))", name); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext.getHL7Application(name); } void addHL7ConfigurationExtension(LdapHL7ConfigurationExtension ext); boolean removeHL7ConfigurationExtension( LdapHL7ConfigurationExtension ext); @Override boolean registerHL7Application(String name); @Override void unregisterHL7Application(String name); @Override String[] listRegisteredHL7ApplicationNames(); @Override HL7Application findHL7Application(String name); @Override synchronized HL7ApplicationInfo[] listHL7AppInfos(HL7ApplicationInfo keys); }
LdapHL7Configuration extends LdapDicomConfigurationExtension implements HL7Configuration { @Override public HL7Application findHL7Application(String name) throws ConfigurationException { Device device = config.findDevice( "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))", name); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext.getHL7Application(name); } void addHL7ConfigurationExtension(LdapHL7ConfigurationExtension ext); boolean removeHL7ConfigurationExtension( LdapHL7ConfigurationExtension ext); @Override boolean registerHL7Application(String name); @Override void unregisterHL7Application(String name); @Override String[] listRegisteredHL7ApplicationNames(); @Override HL7Application findHL7Application(String name); @Override synchronized HL7ApplicationInfo[] listHL7AppInfos(HL7ApplicationInfo keys); }
@Test public void testDecodeChinesePersonNameGBK() { assertEquals(CHINESE_PERSON_NAME_GB18030, gbk().decode(CHINESE_PERSON_NAME_GB18030_BYTES)); }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void testDecodeJISX0201EdgeCases() { byte[][] edgeCases = new byte[][] { {}, { 0x33, 0x43 }, { 0x33, 0x1b }, { 0x1b, 0x24, 0x28 }, { 0x1b, 0x24, 0x28, 0x55 }, { 0x1b, 0x24, 0x28, 0x44 }, { 0x1b, 0x24, 0x28, 0x44, 0x55 }, { 0x1b, 0x24, 0x29 }, { 0x1b, 0x24, 0x29, 0x41 }, { 0x1b, 0x24, 0x29, 0x41, 0x55 }, { 0x1b, 0x24, 0x29, 0x43 }, { 0x1b, 0x24, 0x29, 0x43, 0x55 }, { 0x1b, 0x24, 0x29, 0x55 }, { 0x1b, 0x24, 0x42 }, { 0x1b, 0x24, 0x42, 0x31 }, { 0x1b, 0x33 }, { 0x1b, 0x33, 0x43 } }; final String[] expectedStrings = new String[] { "", "3C", "3\u001b", "\u001b$(", "\u001b$(U", "", "\ufffd", "\u001b$)", "", "U", "", "U", "\u001b$)U", "", "\ufffd", "\u001b3", "\u001b3C" }; assertEquals( "There must be the same number of expected results and edge cases.", edgeCases.length, expectedStrings.length ); for ( int i = 0; i < edgeCases.length; ++i ) { assertEquals( "Unexpected value for the sequence with the index " + i, expectedStrings[ i ], jisX0201().decode( edgeCases[ i ] ) ); } }
public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); }
SpecificCharacterSet { public String decode(byte[] val) { return codecs[0].decode(val, 0, val.length); } protected SpecificCharacterSet(Codec[] codecs, String... codes); static SpecificCharacterSet getDefaultCharacterSet(); static void setDefaultCharacterSet(String code); static void setCharsetNameMapping(String code, String charsetName); static void resetCharsetNameMappings(); static String checkSpecificCharacterSet(String code); static String checkCharsetName(String charsetName); static SpecificCharacterSet valueOf(String... codes); static boolean trimISO2022(String[] codes); String[] toCodes(); byte[] encode(String val, String delimiters); String decode(byte[] val); boolean isUTF8(); boolean isASCII(); boolean containsASCII(); boolean contains(SpecificCharacterSet other); String toText(String s); @Override boolean equals(Object other); @Override int hashCode(); static final SpecificCharacterSet ASCII; }
@Test public void pidsOfTest_faking_duplicate_by_using_same_PID_but_different_issuer() { Attributes rootWithMainId = createIdWithNS(NS); rootWithMainId.newSequence(OtherPatientIDsSequence, 0); Sequence other = rootWithMainId.getSequence(OtherPatientIDsSequence); Attributes otherPatientId = otherPatientIds("other_ns"); other.add(otherPatientId); Set<IDWithIssuer> all = IDWithIssuer.pidsOf(rootWithMainId); assertEquals("Same pid but for different issuer should not be removed!", all.size(), 2); }
public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } IDWithIssuer(String id, Issuer issuer); IDWithIssuer(String id, String issuer); IDWithIssuer(String cx); }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } IDWithIssuer(String id, Issuer issuer); IDWithIssuer(String id, String issuer); IDWithIssuer(String cx); IDWithIssuer withoutIssuer(); final String getID(); String getTypeOfPatientID(); void setTypeOfPatientID(String typeOfPatientID); final String getIdentifierTypeCode(); final void setIdentifierTypeCode(String identifierTypeCode); final Issuer getIssuer(); final void setIssuer(Issuer issuer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean matches(IDWithIssuer other); Attributes exportPatientIDWithIssuer(Attributes attrs); static IDWithIssuer valueOf(Attributes attrs, int idTag, int issuerSeqTag); static IDWithIssuer pidOf(Attributes attrs); static Set<IDWithIssuer> pidsOf(Attributes attrs); }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } IDWithIssuer(String id, Issuer issuer); IDWithIssuer(String id, String issuer); IDWithIssuer(String cx); IDWithIssuer withoutIssuer(); final String getID(); String getTypeOfPatientID(); void setTypeOfPatientID(String typeOfPatientID); final String getIdentifierTypeCode(); final void setIdentifierTypeCode(String identifierTypeCode); final Issuer getIssuer(); final void setIssuer(Issuer issuer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean matches(IDWithIssuer other); Attributes exportPatientIDWithIssuer(Attributes attrs); static IDWithIssuer valueOf(Attributes attrs, int idTag, int issuerSeqTag); static IDWithIssuer pidOf(Attributes attrs); static Set<IDWithIssuer> pidsOf(Attributes attrs); static final IDWithIssuer[] EMPTY; }
@Test public void no_main_id_returns_all() { Attributes rootWithMainId = createIdWithNS(NS); rootWithMainId.newSequence(OtherPatientIDsSequence, 0); Sequence other = rootWithMainId.getSequence(OtherPatientIDsSequence); Attributes otherPatientId = otherPatientIds("other_ns"); other.add(otherPatientId); Set<IDWithIssuer> all = IDWithIssuer.pidsOf(rootWithMainId); assertEquals("Same pid but for different issuer should not be removed!", all.size(), 2); }
public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } IDWithIssuer(String id, Issuer issuer); IDWithIssuer(String id, String issuer); IDWithIssuer(String cx); }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } IDWithIssuer(String id, Issuer issuer); IDWithIssuer(String id, String issuer); IDWithIssuer(String cx); IDWithIssuer withoutIssuer(); final String getID(); String getTypeOfPatientID(); void setTypeOfPatientID(String typeOfPatientID); final String getIdentifierTypeCode(); final void setIdentifierTypeCode(String identifierTypeCode); final Issuer getIssuer(); final void setIssuer(Issuer issuer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean matches(IDWithIssuer other); Attributes exportPatientIDWithIssuer(Attributes attrs); static IDWithIssuer valueOf(Attributes attrs, int idTag, int issuerSeqTag); static IDWithIssuer pidOf(Attributes attrs); static Set<IDWithIssuer> pidsOf(Attributes attrs); }
IDWithIssuer { public static Set<IDWithIssuer> pidsOf(Attributes attrs) { IDWithIssuer pid = IDWithIssuer.pidOf(attrs); Sequence opidseq = attrs.getSequence(Tag.OtherPatientIDsSequence); if (opidseq == null) if (pid == null) return Collections.emptySet(); else return Collections.singleton(pid); Set<IDWithIssuer> pids = new HashSet<IDWithIssuer>((1 + opidseq.size()) << 1); if (pid != null) pids.add(pid); for (Attributes item : opidseq) addTo(IDWithIssuer.pidOf(item), pids); return pids; } IDWithIssuer(String id, Issuer issuer); IDWithIssuer(String id, String issuer); IDWithIssuer(String cx); IDWithIssuer withoutIssuer(); final String getID(); String getTypeOfPatientID(); void setTypeOfPatientID(String typeOfPatientID); final String getIdentifierTypeCode(); final void setIdentifierTypeCode(String identifierTypeCode); final Issuer getIssuer(); final void setIssuer(Issuer issuer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean matches(IDWithIssuer other); Attributes exportPatientIDWithIssuer(Attributes attrs); static IDWithIssuer valueOf(Attributes attrs, int idTag, int issuerSeqTag); static IDWithIssuer pidOf(Attributes attrs); static Set<IDWithIssuer> pidsOf(Attributes attrs); static final IDWithIssuer[] EMPTY; }
@Test public void testValidateDICOMDIR() throws Exception { IOD iod = IOD.load("resource:dicomdir-iod.xml"); Attributes attrs = readDataset("DICOMDIR"); ValidationResult result = attrs.validate(iod); assertTrue(result.isValid()); }
public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } void setType(DataElementType type); DataElementType getType(); void setCondition(Condition condition); Condition getCondition(); int getLineNumber(); void setLineNumber(int lineNumber); void parse(String uri); static IOD load(String uri); static IOD valueOf(Code code); }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } void setType(DataElementType type); DataElementType getType(); void setCondition(Condition condition); Condition getCondition(); int getLineNumber(); void setLineNumber(int lineNumber); void parse(String uri); static IOD load(String uri); static IOD valueOf(Code code); }
@Test public void testValidateCode() throws Exception { IOD iod = IOD.load("resource:code-iod.xml"); Attributes attrs = new Attributes(2); attrs.newSequence(Tag.ConceptNameCodeSequence, 1).add( new Code("CV-9991", "99DCM4CHE", null, "CM-9991").toItem()); Attributes contentNode = new Attributes(2); contentNode.newSequence(Tag.ConceptNameCodeSequence, 1).add( new Code("CV-9992", "99DCM4CHE", null, "CM-9992").toItem()); contentNode.newSequence(Tag.ConceptCodeSequence, 1).add( new Code("CV-9993", "99DCM4CHE", null, "CM-9993").toItem()); attrs.newSequence(Tag.ContentSequence, 1).add(contentNode); ValidationResult result = attrs.validate(iod); assertTrue(result.isValid()); }
public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } void setType(DataElementType type); DataElementType getType(); void setCondition(Condition condition); Condition getCondition(); int getLineNumber(); void setLineNumber(int lineNumber); void parse(String uri); static IOD load(String uri); static IOD valueOf(Code code); }
IOD extends ArrayList<IOD.DataElement> { public static IOD load(String uri) throws IOException { if (uri.startsWith("resource:")) { try { uri = ResourceLocator.getResource(uri.substring(9), IOD.class); } catch (NullPointerException npe) { throw new FileNotFoundException(uri); } } else if (uri.indexOf(':') < 2) { uri = new File(uri).toURI().toString(); } IOD iod = new IOD(); iod.parse(uri); iod.trimToSize(); return iod; } void setType(DataElementType type); DataElementType getType(); void setCondition(Condition condition); Condition getCondition(); int getLineNumber(); void setLineNumber(int lineNumber); void parse(String uri); static IOD load(String uri); static IOD valueOf(Code code); }
@Test public void testValueOf() { PersonName pn = new PersonName( "Adams^John Robert Quincy^^Rev.^B.A. M.Div."); assertEquals("Adams", pn.get(PersonName.Component.FamilyName)); assertEquals("John Robert Quincy", pn.get(PersonName.Component.GivenName)); assertEquals("Rev.", pn.get(PersonName.Component.NamePrefix)); assertEquals("B.A. M.Div.", pn.get(PersonName.Component.NameSuffix)); }
public String get(Component c) { return get(Group.Alphabetic, c); }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); String toString(); String toString(Group g, boolean trim); String get(Component c); String get(Group g, Component c); void set(Component c, String s); void set(Group g, Component c, String s); boolean isEmpty(); boolean contains(Group g); boolean contains(Group g, Component c); boolean contains(Component c); @Override int hashCode(); @Override boolean equals(Object obj); }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); String toString(); String toString(Group g, boolean trim); String get(Component c); String get(Group g, Component c); void set(Component c, String s); void set(Group g, Component c, String s); boolean isEmpty(); boolean contains(Group g); boolean contains(Group g, Component c); boolean contains(Component c); @Override int hashCode(); @Override boolean equals(Object obj); }
@Test public void testValueOf2() { PersonName pn = new PersonName("Hong^Gildong=洪^吉洞=홍^길동"); assertEquals("Hong", pn.get(PersonName.Group.Alphabetic, PersonName.Component.FamilyName)); assertEquals("Gildong", pn.get(PersonName.Group.Alphabetic, PersonName.Component.GivenName)); assertEquals("洪", pn.get(PersonName.Group.Ideographic, PersonName.Component.FamilyName)); assertEquals("吉洞", pn.get(PersonName.Group.Ideographic, PersonName.Component.GivenName)); assertEquals("홍", pn.get(PersonName.Group.Phonetic, PersonName.Component.FamilyName)); assertEquals("길동", pn.get(PersonName.Group.Phonetic, PersonName.Component.GivenName)); }
public String get(Component c) { return get(Group.Alphabetic, c); }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); String toString(); String toString(Group g, boolean trim); String get(Component c); String get(Group g, Component c); void set(Component c, String s); void set(Group g, Component c, String s); boolean isEmpty(); boolean contains(Group g); boolean contains(Group g, Component c); boolean contains(Component c); @Override int hashCode(); @Override boolean equals(Object obj); }
PersonName { public String get(Component c) { return get(Group.Alphabetic, c); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); String toString(); String toString(Group g, boolean trim); String get(Component c); String get(Group g, Component c); void set(Component c, String s); void set(Group g, Component c, String s); boolean isEmpty(); boolean contains(Group g); boolean contains(Group g, Component c); boolean contains(Component c); @Override int hashCode(); @Override boolean equals(Object obj); }
@Test public void testToString() { PersonName pn = new PersonName(); pn.set(PersonName.Component.FamilyName, "Morrison-Jones"); pn.set(PersonName.Component.GivenName, "Susan"); pn.set(PersonName.Component.NameSuffix, "Ph.D., Chief Executive Officer"); assertEquals("Morrison-Jones^Susan^^^Ph.D., Chief Executive Officer", pn.toString()); }
public String toString() { int totLen = 0; Group lastGroup = Group.Alphabetic; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { totLen += s.length(); lastGroup = g; lastCompOfGroup = c; } } totLen += lastCompOfGroup.ordinal(); } totLen += lastGroup.ordinal(); char[] ch = new char[totLen]; int wpos = 0; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { int d = c.ordinal() - lastCompOfGroup.ordinal(); while (d-- > 0) ch[wpos++] = '^'; d = s.length(); s.getChars(0, d, ch, wpos); wpos += d; lastCompOfGroup = c; } } if (g == lastGroup) break; ch[wpos++] = '='; } return new String(ch); }
PersonName { public String toString() { int totLen = 0; Group lastGroup = Group.Alphabetic; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { totLen += s.length(); lastGroup = g; lastCompOfGroup = c; } } totLen += lastCompOfGroup.ordinal(); } totLen += lastGroup.ordinal(); char[] ch = new char[totLen]; int wpos = 0; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { int d = c.ordinal() - lastCompOfGroup.ordinal(); while (d-- > 0) ch[wpos++] = '^'; d = s.length(); s.getChars(0, d, ch, wpos); wpos += d; lastCompOfGroup = c; } } if (g == lastGroup) break; ch[wpos++] = '='; } return new String(ch); } }
PersonName { public String toString() { int totLen = 0; Group lastGroup = Group.Alphabetic; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { totLen += s.length(); lastGroup = g; lastCompOfGroup = c; } } totLen += lastCompOfGroup.ordinal(); } totLen += lastGroup.ordinal(); char[] ch = new char[totLen]; int wpos = 0; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { int d = c.ordinal() - lastCompOfGroup.ordinal(); while (d-- > 0) ch[wpos++] = '^'; d = s.length(); s.getChars(0, d, ch, wpos); wpos += d; lastCompOfGroup = c; } } if (g == lastGroup) break; ch[wpos++] = '='; } return new String(ch); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); }
PersonName { public String toString() { int totLen = 0; Group lastGroup = Group.Alphabetic; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { totLen += s.length(); lastGroup = g; lastCompOfGroup = c; } } totLen += lastCompOfGroup.ordinal(); } totLen += lastGroup.ordinal(); char[] ch = new char[totLen]; int wpos = 0; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { int d = c.ordinal() - lastCompOfGroup.ordinal(); while (d-- > 0) ch[wpos++] = '^'; d = s.length(); s.getChars(0, d, ch, wpos); wpos += d; lastCompOfGroup = c; } } if (g == lastGroup) break; ch[wpos++] = '='; } return new String(ch); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); String toString(); String toString(Group g, boolean trim); String get(Component c); String get(Group g, Component c); void set(Component c, String s); void set(Group g, Component c, String s); boolean isEmpty(); boolean contains(Group g); boolean contains(Group g, Component c); boolean contains(Component c); @Override int hashCode(); @Override boolean equals(Object obj); }
PersonName { public String toString() { int totLen = 0; Group lastGroup = Group.Alphabetic; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { totLen += s.length(); lastGroup = g; lastCompOfGroup = c; } } totLen += lastCompOfGroup.ordinal(); } totLen += lastGroup.ordinal(); char[] ch = new char[totLen]; int wpos = 0; for (Group g : Group.values()) { Component lastCompOfGroup = Component.FamilyName; for (Component c : Component.values()) { String s = get(g, c); if (s != null) { int d = c.ordinal() - lastCompOfGroup.ordinal(); while (d-- > 0) ch[wpos++] = '^'; d = s.length(); s.getChars(0, d, ch, wpos); wpos += d; lastCompOfGroup = c; } } if (g == lastGroup) break; ch[wpos++] = '='; } return new String(ch); } PersonName(); PersonName(String s); PersonName(String s, boolean lenient); String toString(); String toString(Group g, boolean trim); String get(Component c); String get(Group g, Component c); void set(Component c, String s); void set(Group g, Component c, String s); boolean isEmpty(); boolean contains(Group g); boolean contains(Group g, Component c); boolean contains(Component c); @Override int hashCode(); @Override boolean equals(Object obj); }
@Test public void testToString() { ItemPointer ip = new ItemPointer(Tag.RequestAttributesSequence, 0); ValueSelector vs = new ValueSelector(Tag.StudyInstanceUID, null, 0, ip); assertEquals(XPATH, vs.toString()); }
@Override public String toString() { if (str == null) str = attributeSelector.toStringBuilder() .append("/Value[@number=\"") .append(valueIndex + 1) .append("\"]") .toString(); return str; }
ValueSelector implements Serializable { @Override public String toString() { if (str == null) str = attributeSelector.toStringBuilder() .append("/Value[@number=\"") .append(valueIndex + 1) .append("\"]") .toString(); return str; } }
ValueSelector implements Serializable { @Override public String toString() { if (str == null) str = attributeSelector.toStringBuilder() .append("/Value[@number=\"") .append(valueIndex + 1) .append("\"]") .toString(); return str; } ValueSelector(int tag, String privateCreator, int index, ItemPointer... itemPointers); ValueSelector(AttributeSelector attributeSelector, int index); }
ValueSelector implements Serializable { @Override public String toString() { if (str == null) str = attributeSelector.toStringBuilder() .append("/Value[@number=\"") .append(valueIndex + 1) .append("\"]") .toString(); return str; } ValueSelector(int tag, String privateCreator, int index, ItemPointer... itemPointers); ValueSelector(AttributeSelector attributeSelector, int index); int tag(); String privateCreator(); int level(); ItemPointer itemPointer(int index); int valueIndex(); String selectStringValue(Attributes attrs, String defVal); @Override String toString(); static ValueSelector valueOf(String s); @Override int hashCode(); @Override boolean equals(Object obj); }
ValueSelector implements Serializable { @Override public String toString() { if (str == null) str = attributeSelector.toStringBuilder() .append("/Value[@number=\"") .append(valueIndex + 1) .append("\"]") .toString(); return str; } ValueSelector(int tag, String privateCreator, int index, ItemPointer... itemPointers); ValueSelector(AttributeSelector attributeSelector, int index); int tag(); String privateCreator(); int level(); ItemPointer itemPointer(int index); int valueIndex(); String selectStringValue(Attributes attrs, String defVal); @Override String toString(); static ValueSelector valueOf(String s); @Override int hashCode(); @Override boolean equals(Object obj); }
@Test public void testRegisterAETitle() throws Exception { config.unregisterAETitle("TEST-AET1"); assertTrue(config.registerAETitle("TEST-AET1")); assertFalse(config.registerAETitle("TEST-AET1")); assertTrue( Arrays.asList(config.listRegisteredAETitles()) .contains("TEST-AET1")); config.unregisterAETitle("TEST-AET1"); assertFalse( Arrays.asList(config.listRegisteredAETitles()) .contains("TEST-AET1")); }
@Override public synchronized boolean registerAETitle(String aet) throws ConfigurationException { ensureConfigurationExists(); try { registerAET(aet); return true; } catch (AETitleAlreadyExistsException e) { return false; } }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized boolean registerAETitle(String aet) throws ConfigurationException { ensureConfigurationExists(); try { registerAET(aet); return true; } catch (AETitleAlreadyExistsException e) { return false; } } }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized boolean registerAETitle(String aet) throws ConfigurationException { ensureConfigurationExists(); try { registerAET(aet); return true; } catch (AETitleAlreadyExistsException e) { return false; } } LdapDicomConfiguration(); @SuppressWarnings("unchecked") LdapDicomConfiguration(Hashtable<?,?> env); }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized boolean registerAETitle(String aet) throws ConfigurationException { ensureConfigurationExists(); try { registerAET(aet); return true; } catch (AETitleAlreadyExistsException e) { return false; } } LdapDicomConfiguration(); @SuppressWarnings("unchecked") LdapDicomConfiguration(Hashtable<?,?> env); final boolean isExtended(); final void setExtended(boolean extended); final void setConfigurationCN(String configurationCN); final String getConfigurationCN(); final void setConfigurationRoot(String configurationRoot); final String getConfigurationRoot(); void setPkiUser(String pkiUser); String getPkiUser(); void setUserCertificate(String userCertificate); String getUserCertificate(); void addDicomConfigurationExtension(LdapDicomConfigurationExtension ext); boolean removeDicomConfigurationExtension( LdapDicomConfigurationExtension ext); @SuppressWarnings("unchecked") @Override T getDicomConfigurationExtension(Class<T> clazz); @Override synchronized void close(); @Override synchronized boolean configurationExists(); boolean exists(String dn); @Override synchronized boolean purgeConfiguration(); @Override synchronized boolean registerAETitle(String aet); @Override synchronized boolean registerWebAppName(String webAppName); @Override synchronized void unregisterAETitle(String aet); @Override synchronized void unregisterWebAppName(String webAppName); @Override synchronized ApplicationEntity findApplicationEntity(String aet); @Override synchronized WebApplication findWebApplication(String name); synchronized Device findDevice(String filter, String childName); Connection findConnection(String connDN, Map<String, Connection> cache); @Override synchronized Device findDevice(String name); @Override synchronized DeviceInfo[] listDeviceInfos(DeviceInfo keys); @Override synchronized String[] listDeviceNames(); @Override synchronized String[] listRegisteredAETitles(); @Override synchronized String[] listRegisteredWebAppNames(); synchronized String[] list(String dn, String filter, String attrID); @Override synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options); @Override ConfigurationChanges merge(Device device, EnumSet<Option> options); @Override synchronized ConfigurationChanges removeDevice(String name, EnumSet<Option> options); synchronized void createSubcontext(String name, Attributes attrs); synchronized void destroySubcontext(String dn); synchronized void destroySubcontextWithChilds(String name); String getConfigurationDN(); void ensureConfigurationExists(); @Override synchronized void persistCertificates(String dn, X509Certificate... certs); @Override synchronized void removeCertificates(String dn); @Override synchronized X509Certificate[] findCertificates(String dn); @Override byte[][] loadDeviceVendorData(String deviceName); @Override ConfigurationChanges updateDeviceVendorData(String deviceName, byte[]... vendorData); Device loadDevice(String deviceDN); Attributes getAttributes(String name); Attributes getAttributes(String name, String[] attrIDs); NamingEnumeration<SearchResult> search(String dn, String filter); NamingEnumeration<SearchResult> search(String dn, String filter, String... attrs); void modifyAttributes(String dn, List<ModificationItem> mods); void replaceAttributes(String dn, Attributes attrs); @Override String deviceRef(String name); void store(ConfigurationChanges diffs, Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void load(Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void merge(ConfigurationChanges diffs, Map<String,BasicBulkDataDescriptor> prevs, Map<String,BasicBulkDataDescriptor> descriptors, String parentDN); void store(AttributeCoercions coercions, String parentDN); void load(AttributeCoercions acs, String dn); void merge(ConfigurationChanges diffs, AttributeCoercions prevs, AttributeCoercions acs, String parentDN); @Override void sync(); @Override synchronized ApplicationEntityInfo[] listAETInfos(ApplicationEntityInfo keys); @Override synchronized WebApplicationInfo[] listWebApplicationInfos(WebApplicationInfo keys); NamingEnumeration<SearchResult> search(String deviceName, String[] attrsArray, String filter); }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized boolean registerAETitle(String aet) throws ConfigurationException { ensureConfigurationExists(); try { registerAET(aet); return true; } catch (AETitleAlreadyExistsException e) { return false; } } LdapDicomConfiguration(); @SuppressWarnings("unchecked") LdapDicomConfiguration(Hashtable<?,?> env); final boolean isExtended(); final void setExtended(boolean extended); final void setConfigurationCN(String configurationCN); final String getConfigurationCN(); final void setConfigurationRoot(String configurationRoot); final String getConfigurationRoot(); void setPkiUser(String pkiUser); String getPkiUser(); void setUserCertificate(String userCertificate); String getUserCertificate(); void addDicomConfigurationExtension(LdapDicomConfigurationExtension ext); boolean removeDicomConfigurationExtension( LdapDicomConfigurationExtension ext); @SuppressWarnings("unchecked") @Override T getDicomConfigurationExtension(Class<T> clazz); @Override synchronized void close(); @Override synchronized boolean configurationExists(); boolean exists(String dn); @Override synchronized boolean purgeConfiguration(); @Override synchronized boolean registerAETitle(String aet); @Override synchronized boolean registerWebAppName(String webAppName); @Override synchronized void unregisterAETitle(String aet); @Override synchronized void unregisterWebAppName(String webAppName); @Override synchronized ApplicationEntity findApplicationEntity(String aet); @Override synchronized WebApplication findWebApplication(String name); synchronized Device findDevice(String filter, String childName); Connection findConnection(String connDN, Map<String, Connection> cache); @Override synchronized Device findDevice(String name); @Override synchronized DeviceInfo[] listDeviceInfos(DeviceInfo keys); @Override synchronized String[] listDeviceNames(); @Override synchronized String[] listRegisteredAETitles(); @Override synchronized String[] listRegisteredWebAppNames(); synchronized String[] list(String dn, String filter, String attrID); @Override synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options); @Override ConfigurationChanges merge(Device device, EnumSet<Option> options); @Override synchronized ConfigurationChanges removeDevice(String name, EnumSet<Option> options); synchronized void createSubcontext(String name, Attributes attrs); synchronized void destroySubcontext(String dn); synchronized void destroySubcontextWithChilds(String name); String getConfigurationDN(); void ensureConfigurationExists(); @Override synchronized void persistCertificates(String dn, X509Certificate... certs); @Override synchronized void removeCertificates(String dn); @Override synchronized X509Certificate[] findCertificates(String dn); @Override byte[][] loadDeviceVendorData(String deviceName); @Override ConfigurationChanges updateDeviceVendorData(String deviceName, byte[]... vendorData); Device loadDevice(String deviceDN); Attributes getAttributes(String name); Attributes getAttributes(String name, String[] attrIDs); NamingEnumeration<SearchResult> search(String dn, String filter); NamingEnumeration<SearchResult> search(String dn, String filter, String... attrs); void modifyAttributes(String dn, List<ModificationItem> mods); void replaceAttributes(String dn, Attributes attrs); @Override String deviceRef(String name); void store(ConfigurationChanges diffs, Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void load(Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void merge(ConfigurationChanges diffs, Map<String,BasicBulkDataDescriptor> prevs, Map<String,BasicBulkDataDescriptor> descriptors, String parentDN); void store(AttributeCoercions coercions, String parentDN); void load(AttributeCoercions acs, String dn); void merge(ConfigurationChanges diffs, AttributeCoercions prevs, AttributeCoercions acs, String parentDN); @Override void sync(); @Override synchronized ApplicationEntityInfo[] listAETInfos(ApplicationEntityInfo keys); @Override synchronized WebApplicationInfo[] listWebApplicationInfos(WebApplicationInfo keys); NamingEnumeration<SearchResult> search(String deviceName, String[] attrsArray, String filter); }
@Test public void testValueOf() { ValueSelector vs = ValueSelector.valueOf(XPATH); assertEquals(Tag.StudyInstanceUID, vs.tag()); assertNull(vs.privateCreator()); assertEquals(0, vs.valueIndex()); assertEquals(1, vs.level()); ItemPointer ip = vs.itemPointer(0); assertEquals(Tag.RequestAttributesSequence, ip.sequenceTag); assertNull(ip.privateCreator); assertEquals(0, ip.itemIndex); }
public static ValueSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new ValueSelector(AttributeSelector.valueOf(s), AttributeSelector.selectNumber(s, fromIndex) - 1); } catch (Exception e) { throw new IllegalArgumentException(s); } }
ValueSelector implements Serializable { public static ValueSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new ValueSelector(AttributeSelector.valueOf(s), AttributeSelector.selectNumber(s, fromIndex) - 1); } catch (Exception e) { throw new IllegalArgumentException(s); } } }
ValueSelector implements Serializable { public static ValueSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new ValueSelector(AttributeSelector.valueOf(s), AttributeSelector.selectNumber(s, fromIndex) - 1); } catch (Exception e) { throw new IllegalArgumentException(s); } } ValueSelector(int tag, String privateCreator, int index, ItemPointer... itemPointers); ValueSelector(AttributeSelector attributeSelector, int index); }
ValueSelector implements Serializable { public static ValueSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new ValueSelector(AttributeSelector.valueOf(s), AttributeSelector.selectNumber(s, fromIndex) - 1); } catch (Exception e) { throw new IllegalArgumentException(s); } } ValueSelector(int tag, String privateCreator, int index, ItemPointer... itemPointers); ValueSelector(AttributeSelector attributeSelector, int index); int tag(); String privateCreator(); int level(); ItemPointer itemPointer(int index); int valueIndex(); String selectStringValue(Attributes attrs, String defVal); @Override String toString(); static ValueSelector valueOf(String s); @Override int hashCode(); @Override boolean equals(Object obj); }
ValueSelector implements Serializable { public static ValueSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new ValueSelector(AttributeSelector.valueOf(s), AttributeSelector.selectNumber(s, fromIndex) - 1); } catch (Exception e) { throw new IllegalArgumentException(s); } } ValueSelector(int tag, String privateCreator, int index, ItemPointer... itemPointers); ValueSelector(AttributeSelector attributeSelector, int index); int tag(); String privateCreator(); int level(); ItemPointer itemPointer(int index); int valueIndex(); String selectStringValue(Attributes attrs, String defVal); @Override String toString(); static ValueSelector valueOf(String s); @Override int hashCode(); @Override boolean equals(Object obj); }
@Test public void testVrOf() { for (int i = 0; i < TAGS.length; i++) assertEquals(VRS[i], ElementDictionary.vrOf(TAGS[i], null)); }
public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
@Test public void testKeywordOf() { for (int i = 0; i < TAGS.length; i++) assertEquals(KEYWORDS[i], ElementDictionary.keywordOf(TAGS[i], null)); }
public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
@Test public void tagForKeyword() { for (int i = 0; i < KEYWORDS.length-1; i++) assertEquals(TAGS[i], ElementDictionary.tagForKeyword(KEYWORDS[i], null)); }
public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } protected ElementDictionary(String privateCreator, Class<?> tagClass); }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
@Test public void testPrivateVrOf() { for (int i = 0; i < SIEMENS_CSA_HEADER_TAGS.length; i++) assertEquals(SIEMENS_CSA_HEADER_VRS[i], ElementDictionary.vrOf(SIEMENS_CSA_HEADER_TAGS[i], SIEMENS_CSA_HEADER)); for (int i = 0; i < SIEMENS_CSA_NON_IMAGE_TAGS.length; i++) assertEquals(SIEMENS_CSA_NON_IMAGE_VRS[i], ElementDictionary.vrOf(SIEMENS_CSA_NON_IMAGE_TAGS[i], SIEMENS_CSA_NON_IMAGE)); }
public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
ElementDictionary { public static VR vrOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).vrOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
@Test public void testPrivateKeywordOf() { for (int i = 0; i < SIEMENS_CSA_HEADER_TAGS.length; i++) assertEquals(SIEMENS_CSA_HEADER_KEYWORDS[i], ElementDictionary.keywordOf( SIEMENS_CSA_HEADER_TAGS[i], SIEMENS_CSA_HEADER)); for (int i = 0; i < SIEMENS_CSA_NON_IMAGE_TAGS.length; i++) assertEquals(SIEMENS_CSA_NON_IMAGE_KEYWORDS[i], ElementDictionary.keywordOf( SIEMENS_CSA_NON_IMAGE_TAGS[i], SIEMENS_CSA_NON_IMAGE)); }
public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
ElementDictionary { public static String keywordOf(int tag, String privateCreator) { return getElementDictionary(privateCreator).keywordOf(tag); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
@Test public void tagPrivateForKeyword() { for (int i = 0; i < SIEMENS_CSA_HEADER_KEYWORDS.length; i++) assertEquals(SIEMENS_CSA_HEADER_TAGS[i], ElementDictionary.tagForKeyword( SIEMENS_CSA_HEADER_KEYWORDS[i], SIEMENS_CSA_HEADER)); for (int i = 0; i < SIEMENS_CSA_NON_IMAGE_KEYWORDS.length; i++) assertEquals(SIEMENS_CSA_NON_IMAGE_TAGS[i], ElementDictionary.tagForKeyword( SIEMENS_CSA_NON_IMAGE_KEYWORDS[i], SIEMENS_CSA_NON_IMAGE)); }
public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } protected ElementDictionary(String privateCreator, Class<?> tagClass); }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
ElementDictionary { public static int tagForKeyword(String keyword, String privateCreatorID) { return getElementDictionary(privateCreatorID).tagForKeyword(keyword); } protected ElementDictionary(String privateCreator, Class<?> tagClass); static ElementDictionary getStandardElementDictionary(); static ElementDictionary getElementDictionary(String privateCreator); static void reload(); static VR vrOf(int tag, String privateCreator); static String keywordOf(int tag, String privateCreator); static int tagForKeyword(String keyword, String privateCreatorID); final String getPrivateCreator(); abstract VR vrOf(int tag); abstract String keywordOf(int tag); int tmTagOf(int daTag); int daTagOf(int tmTag); int tagForKeyword(String keyword); }
@Test public void testMatches() { assertTrue(StringUtils.matches("aBcD", "aBcD", false, false)); assertFalse(StringUtils.matches("aBcD", "abCd", false, false)); assertTrue(StringUtils.matches("aBcD", "abCd", false, true)); assertFalse(StringUtils.matches("aBcD", "ab*", false, false)); assertTrue(StringUtils.matches("aBcD", "ab*", false, true)); assertTrue(StringUtils.matches("aBcD", "a?c?", false, false)); assertTrue(StringUtils.matches("aBcD", "a*D*", false, false)); assertFalse(StringUtils.matches("aBcD", "a*d?", false, true)); }
public static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase) { if (key == null || key.isEmpty()) return true; if (s == null || s.isEmpty()) return matchNullOrEmpty; return containsWildCard(key) ? compilePattern(key, ignoreCase).matcher(s).matches() : ignoreCase ? key.equalsIgnoreCase(s) : key.equals(s); }
StringUtils { public static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase) { if (key == null || key.isEmpty()) return true; if (s == null || s.isEmpty()) return matchNullOrEmpty; return containsWildCard(key) ? compilePattern(key, ignoreCase).matcher(s).matches() : ignoreCase ? key.equalsIgnoreCase(s) : key.equals(s); } }
StringUtils { public static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase) { if (key == null || key.isEmpty()) return true; if (s == null || s.isEmpty()) return matchNullOrEmpty; return containsWildCard(key) ? compilePattern(key, ignoreCase).matcher(s).matches() : ignoreCase ? key.equalsIgnoreCase(s) : key.equals(s); } }
StringUtils { public static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase) { if (key == null || key.isEmpty()) return true; if (s == null || s.isEmpty()) return matchNullOrEmpty; return containsWildCard(key) ? compilePattern(key, ignoreCase).matcher(s).matches() : ignoreCase ? key.equalsIgnoreCase(s) : key.equals(s); } static StringBuilder appendLine(StringBuilder sb, Object... ss); static String concat(String[] ss, char delim); static String concat(Collection<String> ss, char delim); static Object splitAndTrim(String s, char delim); static String[] split(String s, char delim); static String cut(String s, int index, char delim); static String trimTrailing(String s); static int parseIS(String s); static double parseDS(String s); static String formatDS(float f); static String formatDS(double d); static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase); static Pattern compilePattern(String key, boolean ignoreCase); static boolean containsWildCard(String s); static String[] maskNull(String[] ss); static T maskNull(T o, T mask); static T nullify(T o, T val); static String maskEmpty(String s, String mask); static String truncate(String s, int maxlen); static boolean equals(T o1, T o2); static String replaceSystemProperties(String s); @Deprecated static String resourceURL(String name); static boolean isUpperCase(String s); static boolean isIPAddr(String s); static boolean contains(T[] a, T o); static T[] requireNotEmpty(T[] a, String message); static String requireNotEmpty(String s, String message); static String[] requireContainsNoEmpty(String[] ss, String message); }
StringUtils { public static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase) { if (key == null || key.isEmpty()) return true; if (s == null || s.isEmpty()) return matchNullOrEmpty; return containsWildCard(key) ? compilePattern(key, ignoreCase).matcher(s).matches() : ignoreCase ? key.equalsIgnoreCase(s) : key.equals(s); } static StringBuilder appendLine(StringBuilder sb, Object... ss); static String concat(String[] ss, char delim); static String concat(Collection<String> ss, char delim); static Object splitAndTrim(String s, char delim); static String[] split(String s, char delim); static String cut(String s, int index, char delim); static String trimTrailing(String s); static int parseIS(String s); static double parseDS(String s); static String formatDS(float f); static String formatDS(double d); static boolean matches(String s, String key, boolean matchNullOrEmpty, boolean ignoreCase); static Pattern compilePattern(String key, boolean ignoreCase); static boolean containsWildCard(String s); static String[] maskNull(String[] ss); static T maskNull(T o, T mask); static T nullify(T o, T val); static String maskEmpty(String s, String mask); static String truncate(String s, int maxlen); static boolean equals(T o1, T o2); static String replaceSystemProperties(String s); @Deprecated static String resourceURL(String name); static boolean isUpperCase(String s); static boolean isIPAddr(String s); static boolean contains(T[] a, T o); static T[] requireNotEmpty(T[] a, String message); static String requireNotEmpty(String s, String message); static String[] requireContainsNoEmpty(String[] ss, String message); static String LINE_SEPARATOR; static String[] EMPTY_STRING; }
@Test public void testFormat() { Attributes attrs = new Attributes(); attrs.setString(Tag.ImageType, VR.CS, "ORIGINAL", "PRIMARY", "AXIAL"); attrs.setString(Tag.StudyDate, VR.DA, "20111012"); attrs.setString(Tag.StudyTime, VR.TM, "0930"); attrs.setString(Tag.StudyInstanceUID, VR.UI, "1.2.3"); attrs.setString(Tag.SeriesInstanceUID, VR.UI, "1.2.3.4"); attrs.setString(Tag.SOPInstanceUID, VR.UI, "1.2.3.4.5"); assertEquals("2011/10/12/09/02C82A3A/71668980/PRIMARY/1.2.3.4.5.dcm", new AttributesFormat(TEST_PATTERN).format(attrs)); }
@Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
@Test public void testFormatMD5() { Attributes attrs = new Attributes(); attrs.setString(Tag.StudyDate, VR.DA, "20111012"); attrs.setString(Tag.StudyTime, VR.TM, "0930"); attrs.setString(Tag.StudyInstanceUID, VR.UI, "1.2.3"); attrs.setString(Tag.SeriesInstanceUID, VR.UI, "1.2.3.4"); attrs.setString(Tag.SOPInstanceUID, VR.UI, "1.2.3.4.5"); assertEquals("2011/10/12/09/02C82A3A/71668980/08vpsu2l2shpb0kc3orpgfnhv0.dcm", new AttributesFormat(TEST_PATTERN_MD5).format(attrs)); }
@Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
@Test public void testPersist() throws Exception { try { config.removeDevice("Test-Device-1", null); } catch (ConfigurationNotFoundException e) {} Device device = createDevice("Test-Device-1", "TEST-AET1"); config.persist(device, null); ApplicationEntity ae = config.findApplicationEntity("TEST-AET1"); assertFalse(ae.isAssociationInitiator()); assertTrue(ae.isAssociationAcceptor()); assertTrue(ae.getConnections().get(0).isServer()); TransferCapability echoSCP = ae.getTransferCapabilityFor( UID.Verification, TransferCapability.Role.SCP); assertNotNull(echoSCP); assertArrayEquals(new String[] { UID.ImplicitVRLittleEndian }, echoSCP.getTransferSyntaxes()); TransferCapability ctSCP = ae.getTransferCapabilityFor( UID.CTImageStorage, TransferCapability.Role.SCP); assertNotNull(ctSCP); assertArrayEquals(new String[] { UID.ImplicitVRLittleEndian, UID.ExplicitVRLittleEndian }, sort(ctSCP.getTransferSyntaxes())); assertNull(ctSCP.getStorageOptions()); TransferCapability findSCP = ae.getTransferCapabilityFor( UID.StudyRootQueryRetrieveInformationModelFind, TransferCapability.Role.SCP); assertNotNull(findSCP); assertArrayEquals(new String[] { UID.ImplicitVRLittleEndian }, findSCP.getTransferSyntaxes()); assertEquals(EnumSet.of(QueryOption.RELATIONAL), findSCP.getQueryOptions()); assertEquals(1, config.listDeviceInfos(deviceInfo("Test-Device-1")).length); try { config.persist(createDevice("Test-Device-1", "TEST-AET1"), null); fail("ConfigurationAlreadyExistsException expected"); } catch (ConfigurationAlreadyExistsException e) {} config.removeDevice("Test-Device-1", null); }
@Override public synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options) throws ConfigurationException { ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>(); try { if (options != null && options.contains(Option.REGISTER)) register(device, destroyDNs); ConfigurationChanges diffs = configurationChangesOf(options); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.C); createSubcontext(deviceDN, storeTo(ConfigurationChanges.nullifyIfNotVerbose(diffs, ldapObj), device, new BasicAttributes(true))); rollback = true; storeChilds(ConfigurationChanges.nullifyIfNotVerbose(diffs, diffs), deviceDN, device); if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE)) updateCertificates(device); rollback = false; destroyDNs.clear(); return diffs; } catch (NameAlreadyBoundException e) { throw new ConfigurationAlreadyExistsException(deviceName); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } finally { if (rollback) { try { destroySubcontextWithChilds(deviceDN); } catch (NamingException e) { LOG.warn("Rollback failed:", e); } } unregister(destroyDNs); } }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options) throws ConfigurationException { ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>(); try { if (options != null && options.contains(Option.REGISTER)) register(device, destroyDNs); ConfigurationChanges diffs = configurationChangesOf(options); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.C); createSubcontext(deviceDN, storeTo(ConfigurationChanges.nullifyIfNotVerbose(diffs, ldapObj), device, new BasicAttributes(true))); rollback = true; storeChilds(ConfigurationChanges.nullifyIfNotVerbose(diffs, diffs), deviceDN, device); if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE)) updateCertificates(device); rollback = false; destroyDNs.clear(); return diffs; } catch (NameAlreadyBoundException e) { throw new ConfigurationAlreadyExistsException(deviceName); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } finally { if (rollback) { try { destroySubcontextWithChilds(deviceDN); } catch (NamingException e) { LOG.warn("Rollback failed:", e); } } unregister(destroyDNs); } } }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options) throws ConfigurationException { ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>(); try { if (options != null && options.contains(Option.REGISTER)) register(device, destroyDNs); ConfigurationChanges diffs = configurationChangesOf(options); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.C); createSubcontext(deviceDN, storeTo(ConfigurationChanges.nullifyIfNotVerbose(diffs, ldapObj), device, new BasicAttributes(true))); rollback = true; storeChilds(ConfigurationChanges.nullifyIfNotVerbose(diffs, diffs), deviceDN, device); if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE)) updateCertificates(device); rollback = false; destroyDNs.clear(); return diffs; } catch (NameAlreadyBoundException e) { throw new ConfigurationAlreadyExistsException(deviceName); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } finally { if (rollback) { try { destroySubcontextWithChilds(deviceDN); } catch (NamingException e) { LOG.warn("Rollback failed:", e); } } unregister(destroyDNs); } } LdapDicomConfiguration(); @SuppressWarnings("unchecked") LdapDicomConfiguration(Hashtable<?,?> env); }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options) throws ConfigurationException { ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>(); try { if (options != null && options.contains(Option.REGISTER)) register(device, destroyDNs); ConfigurationChanges diffs = configurationChangesOf(options); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.C); createSubcontext(deviceDN, storeTo(ConfigurationChanges.nullifyIfNotVerbose(diffs, ldapObj), device, new BasicAttributes(true))); rollback = true; storeChilds(ConfigurationChanges.nullifyIfNotVerbose(diffs, diffs), deviceDN, device); if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE)) updateCertificates(device); rollback = false; destroyDNs.clear(); return diffs; } catch (NameAlreadyBoundException e) { throw new ConfigurationAlreadyExistsException(deviceName); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } finally { if (rollback) { try { destroySubcontextWithChilds(deviceDN); } catch (NamingException e) { LOG.warn("Rollback failed:", e); } } unregister(destroyDNs); } } LdapDicomConfiguration(); @SuppressWarnings("unchecked") LdapDicomConfiguration(Hashtable<?,?> env); final boolean isExtended(); final void setExtended(boolean extended); final void setConfigurationCN(String configurationCN); final String getConfigurationCN(); final void setConfigurationRoot(String configurationRoot); final String getConfigurationRoot(); void setPkiUser(String pkiUser); String getPkiUser(); void setUserCertificate(String userCertificate); String getUserCertificate(); void addDicomConfigurationExtension(LdapDicomConfigurationExtension ext); boolean removeDicomConfigurationExtension( LdapDicomConfigurationExtension ext); @SuppressWarnings("unchecked") @Override T getDicomConfigurationExtension(Class<T> clazz); @Override synchronized void close(); @Override synchronized boolean configurationExists(); boolean exists(String dn); @Override synchronized boolean purgeConfiguration(); @Override synchronized boolean registerAETitle(String aet); @Override synchronized boolean registerWebAppName(String webAppName); @Override synchronized void unregisterAETitle(String aet); @Override synchronized void unregisterWebAppName(String webAppName); @Override synchronized ApplicationEntity findApplicationEntity(String aet); @Override synchronized WebApplication findWebApplication(String name); synchronized Device findDevice(String filter, String childName); Connection findConnection(String connDN, Map<String, Connection> cache); @Override synchronized Device findDevice(String name); @Override synchronized DeviceInfo[] listDeviceInfos(DeviceInfo keys); @Override synchronized String[] listDeviceNames(); @Override synchronized String[] listRegisteredAETitles(); @Override synchronized String[] listRegisteredWebAppNames(); synchronized String[] list(String dn, String filter, String attrID); @Override synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options); @Override ConfigurationChanges merge(Device device, EnumSet<Option> options); @Override synchronized ConfigurationChanges removeDevice(String name, EnumSet<Option> options); synchronized void createSubcontext(String name, Attributes attrs); synchronized void destroySubcontext(String dn); synchronized void destroySubcontextWithChilds(String name); String getConfigurationDN(); void ensureConfigurationExists(); @Override synchronized void persistCertificates(String dn, X509Certificate... certs); @Override synchronized void removeCertificates(String dn); @Override synchronized X509Certificate[] findCertificates(String dn); @Override byte[][] loadDeviceVendorData(String deviceName); @Override ConfigurationChanges updateDeviceVendorData(String deviceName, byte[]... vendorData); Device loadDevice(String deviceDN); Attributes getAttributes(String name); Attributes getAttributes(String name, String[] attrIDs); NamingEnumeration<SearchResult> search(String dn, String filter); NamingEnumeration<SearchResult> search(String dn, String filter, String... attrs); void modifyAttributes(String dn, List<ModificationItem> mods); void replaceAttributes(String dn, Attributes attrs); @Override String deviceRef(String name); void store(ConfigurationChanges diffs, Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void load(Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void merge(ConfigurationChanges diffs, Map<String,BasicBulkDataDescriptor> prevs, Map<String,BasicBulkDataDescriptor> descriptors, String parentDN); void store(AttributeCoercions coercions, String parentDN); void load(AttributeCoercions acs, String dn); void merge(ConfigurationChanges diffs, AttributeCoercions prevs, AttributeCoercions acs, String parentDN); @Override void sync(); @Override synchronized ApplicationEntityInfo[] listAETInfos(ApplicationEntityInfo keys); @Override synchronized WebApplicationInfo[] listWebApplicationInfos(WebApplicationInfo keys); NamingEnumeration<SearchResult> search(String deviceName, String[] attrsArray, String filter); }
LdapDicomConfiguration implements DicomConfiguration { @Override public synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options) throws ConfigurationException { ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>(); try { if (options != null && options.contains(Option.REGISTER)) register(device, destroyDNs); ConfigurationChanges diffs = configurationChangesOf(options); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.C); createSubcontext(deviceDN, storeTo(ConfigurationChanges.nullifyIfNotVerbose(diffs, ldapObj), device, new BasicAttributes(true))); rollback = true; storeChilds(ConfigurationChanges.nullifyIfNotVerbose(diffs, diffs), deviceDN, device); if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE)) updateCertificates(device); rollback = false; destroyDNs.clear(); return diffs; } catch (NameAlreadyBoundException e) { throw new ConfigurationAlreadyExistsException(deviceName); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } finally { if (rollback) { try { destroySubcontextWithChilds(deviceDN); } catch (NamingException e) { LOG.warn("Rollback failed:", e); } } unregister(destroyDNs); } } LdapDicomConfiguration(); @SuppressWarnings("unchecked") LdapDicomConfiguration(Hashtable<?,?> env); final boolean isExtended(); final void setExtended(boolean extended); final void setConfigurationCN(String configurationCN); final String getConfigurationCN(); final void setConfigurationRoot(String configurationRoot); final String getConfigurationRoot(); void setPkiUser(String pkiUser); String getPkiUser(); void setUserCertificate(String userCertificate); String getUserCertificate(); void addDicomConfigurationExtension(LdapDicomConfigurationExtension ext); boolean removeDicomConfigurationExtension( LdapDicomConfigurationExtension ext); @SuppressWarnings("unchecked") @Override T getDicomConfigurationExtension(Class<T> clazz); @Override synchronized void close(); @Override synchronized boolean configurationExists(); boolean exists(String dn); @Override synchronized boolean purgeConfiguration(); @Override synchronized boolean registerAETitle(String aet); @Override synchronized boolean registerWebAppName(String webAppName); @Override synchronized void unregisterAETitle(String aet); @Override synchronized void unregisterWebAppName(String webAppName); @Override synchronized ApplicationEntity findApplicationEntity(String aet); @Override synchronized WebApplication findWebApplication(String name); synchronized Device findDevice(String filter, String childName); Connection findConnection(String connDN, Map<String, Connection> cache); @Override synchronized Device findDevice(String name); @Override synchronized DeviceInfo[] listDeviceInfos(DeviceInfo keys); @Override synchronized String[] listDeviceNames(); @Override synchronized String[] listRegisteredAETitles(); @Override synchronized String[] listRegisteredWebAppNames(); synchronized String[] list(String dn, String filter, String attrID); @Override synchronized ConfigurationChanges persist(Device device, EnumSet<Option> options); @Override ConfigurationChanges merge(Device device, EnumSet<Option> options); @Override synchronized ConfigurationChanges removeDevice(String name, EnumSet<Option> options); synchronized void createSubcontext(String name, Attributes attrs); synchronized void destroySubcontext(String dn); synchronized void destroySubcontextWithChilds(String name); String getConfigurationDN(); void ensureConfigurationExists(); @Override synchronized void persistCertificates(String dn, X509Certificate... certs); @Override synchronized void removeCertificates(String dn); @Override synchronized X509Certificate[] findCertificates(String dn); @Override byte[][] loadDeviceVendorData(String deviceName); @Override ConfigurationChanges updateDeviceVendorData(String deviceName, byte[]... vendorData); Device loadDevice(String deviceDN); Attributes getAttributes(String name); Attributes getAttributes(String name, String[] attrIDs); NamingEnumeration<SearchResult> search(String dn, String filter); NamingEnumeration<SearchResult> search(String dn, String filter, String... attrs); void modifyAttributes(String dn, List<ModificationItem> mods); void replaceAttributes(String dn, Attributes attrs); @Override String deviceRef(String name); void store(ConfigurationChanges diffs, Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void load(Map<String, BasicBulkDataDescriptor> descriptors, String parentDN); void merge(ConfigurationChanges diffs, Map<String,BasicBulkDataDescriptor> prevs, Map<String,BasicBulkDataDescriptor> descriptors, String parentDN); void store(AttributeCoercions coercions, String parentDN); void load(AttributeCoercions acs, String dn); void merge(ConfigurationChanges diffs, AttributeCoercions prevs, AttributeCoercions acs, String parentDN); @Override void sync(); @Override synchronized ApplicationEntityInfo[] listAETInfos(ApplicationEntityInfo keys); @Override synchronized WebApplicationInfo[] listWebApplicationInfos(WebApplicationInfo keys); NamingEnumeration<SearchResult> search(String deviceName, String[] attrsArray, String filter); }
@Test public void testFormatRND() { assertTrue(ASSERT_PATTERN_RND.matcher( new AttributesFormat(TEST_PATTERN_RND).format(new Attributes())).matches()); }
@Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
@Test public void testOffset() { Attributes attrs = new Attributes(); attrs.setString(Tag.SeriesNumber, VR.IS, "1"); attrs.setString(Tag.InstanceNumber, VR.IS, "2"); assertEquals("101/1", new AttributesFormat(TEST_PATTERN_OFFSET).format(attrs)); }
@Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
AttributesFormat extends Format { @Override public StringBuffer format(Object obj, StringBuffer result, FieldPosition pos) { return format.format(toArgs((Attributes) obj), result, pos); } AttributesFormat(String pattern); static AttributesFormat valueOf(String s); @Override StringBuffer format(Object obj, StringBuffer result, FieldPosition pos); @Override Object parseObject(String source, ParsePosition pos); @Override String toString(); }
@Test public void testFormatDA() { assertEquals("19700101", DateUtils.formatDA(tz, new Date(0))); }
public static String formatDA(TimeZone tz, Date date) { return formatDA(tz, date, new StringBuilder(8)).toString(); }
DateUtils { public static String formatDA(TimeZone tz, Date date) { return formatDA(tz, date, new StringBuilder(8)).toString(); } }
DateUtils { public static String formatDA(TimeZone tz, Date date) { return formatDA(tz, date, new StringBuilder(8)).toString(); } }
DateUtils { public static String formatDA(TimeZone tz, Date date) { return formatDA(tz, date, new StringBuilder(8)).toString(); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static String formatDA(TimeZone tz, Date date) { return formatDA(tz, date, new StringBuilder(8)).toString(); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testFormatTM() { assertEquals("020000.000", DateUtils.formatTM(tz, new Date(0))); }
public static String formatTM(TimeZone tz, Date date) { return formatTM(tz, date, new DatePrecision()); }
DateUtils { public static String formatTM(TimeZone tz, Date date) { return formatTM(tz, date, new DatePrecision()); } }
DateUtils { public static String formatTM(TimeZone tz, Date date) { return formatTM(tz, date, new DatePrecision()); } }
DateUtils { public static String formatTM(TimeZone tz, Date date) { return formatTM(tz, date, new DatePrecision()); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static String formatTM(TimeZone tz, Date date) { return formatTM(tz, date, new DatePrecision()); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testFormatDT() { assertEquals("19700101020000.000", DateUtils.formatDT(tz, new Date(0))); }
public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testFormatDTwithTZ() { assertEquals("19700101020000.000+0200", DateUtils.formatDT(tz, new Date(0), new DatePrecision(Calendar.MILLISECOND, true))); }
public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static String formatDT(TimeZone tz, Date date) { return formatDT(tz, date, new DatePrecision()); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testParseDA() { assertEquals(-2 * HOUR, DateUtils.parseDA(tz, "19700101").getTime()); }
public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testParseDAacrnema() { assertEquals(-2 * HOUR, DateUtils.parseDA(tz, "1970.01.01").getTime()); }
public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testParseDAceil() { assertEquals(DAY - 2 * HOUR - 1, DateUtils.parseDA(tz, "19700101", true).getTime()); }
public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static Date parseDA(TimeZone tz, String s) { return parseDA(tz, s, false); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }
@Test public void testParseTM() { DatePrecision precision = new DatePrecision(); assertEquals(0, DateUtils.parseTM(tz, "020000.000", precision).getTime()); assertEquals(Calendar.MILLISECOND, precision.lastField); }
public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date); static String formatTM(TimeZone tz, Date date, DatePrecision precision); static String formatDT(TimeZone tz, Date date); static String formatDT(TimeZone tz, Date date, DatePrecision precision); static StringBuilder formatDT(TimeZone tz, Date date, StringBuilder toAppendTo, DatePrecision precision); static String formatTimezoneOffsetFromUTC(TimeZone tz); static String formatTimezoneOffsetFromUTC(TimeZone tz, Date date); static Date parseDA(TimeZone tz, String s); static Date parseDA(TimeZone tz, String s, boolean ceil); static Date parseTM(TimeZone tz, String s, DatePrecision precision); static Date parseTM(TimeZone tz, String s, boolean ceil, DatePrecision precision); static Date parseDT(TimeZone tz, String s, DatePrecision precision); static TimeZone timeZone(String s); static Date parseDT(TimeZone tz, String s, boolean ceil, DatePrecision precision); static final Date[] EMPTY_DATES; }