diff options
author | Frankie B <git@diskfloppy.me> | 2024-05-10 00:32:34 +0100 |
---|---|---|
committer | Frankie B <git@diskfloppy.me> | 2024-05-10 00:32:34 +0100 |
commit | 3faced7068a8401b57be8949e80ce4f4da4a0fb5 (patch) | |
tree | 32e76b06780fe6c14ddb4917d3ad0b222fa9c596 /src/com/wilko/jaim/TocResponseFactory.java | |
parent | a1dff2cb8d33b17bc5981f1638cd50266713e98f (diff) |
Format all code, add editorconfig
Diffstat (limited to 'src/com/wilko/jaim/TocResponseFactory.java')
-rw-r--r-- | src/com/wilko/jaim/TocResponseFactory.java | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/src/com/wilko/jaim/TocResponseFactory.java b/src/com/wilko/jaim/TocResponseFactory.java index d7728b9..45b9444 100644 --- a/src/com/wilko/jaim/TocResponseFactory.java +++ b/src/com/wilko/jaim/TocResponseFactory.java @@ -1,4 +1,4 @@ -/* +/* * (C) 2002 Paul Wilkinson wilko@users.sourceforge.net * * This program is free software; you can redistribute it and/or modify @@ -26,8 +26,7 @@ package com.wilko.jaim; /** - * - * @author paulw + * @author paulw * @version $Revision: 1.5 $ */ @@ -36,47 +35,41 @@ import java.util.Vector; public abstract class TocResponseFactory { static Vector responseHandlers = new Vector(); - - /** Creates new TocResponseFactory */ + + /** + * Creates new TocResponseFactory + */ public TocResponseFactory() { } - public static void addResponseHandler(TocResponseHandler h) - { - synchronized (responseHandlers) - { + public static void addResponseHandler(TocResponseHandler h) { + synchronized (responseHandlers) { responseHandlers.add(h); } } - - static TocResponse createResponse(byte[] b) - { - TocResponse tr=null; - String strversion=new String(b); - int colonpos=strversion.indexOf(':'); - if (colonpos != -1) - { - String firstWord=strversion.substring(0,colonpos); - int i=0; - synchronized (responseHandlers) - { - while ((i<responseHandlers.size())&&(tr==null)) - { - TocResponseHandler h=(TocResponseHandler)responseHandlers.elementAt(i); - if (h.canHandle(firstWord)) - { - tr=h.parseString(strversion); + + static TocResponse createResponse(byte[] b) { + TocResponse tr = null; + String strversion = new String(b); + int colonpos = strversion.indexOf(':'); + if (colonpos != -1) { + String firstWord = strversion.substring(0, colonpos); + int i = 0; + synchronized (responseHandlers) { + while ((i < responseHandlers.size()) && (tr == null)) { + TocResponseHandler h = (TocResponseHandler) responseHandlers.elementAt(i); + if (h.canHandle(firstWord)) { + tr = h.parseString(strversion); } i++; } } } - if (tr==null) - { - GenericTocResponse gtr=new GenericTocResponse(); - tr=gtr.parseString(strversion); + if (tr == null) { + GenericTocResponse gtr = new GenericTocResponse(); + tr = gtr.parseString(strversion); } - return(tr); + return (tr); } - + } |