test_class.declarator: factory
test_class.modifier: private static
test_class.original_string: private static FormatFactory factory;
test_class.type: FormatFactory
test_class.var_name: factory
test_class.file: storage/ioformats/src/test/java/org/openscience/cdk/io/FormatFactoryTest.java
test_class.identifier: FormatFactoryTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testGuessFormat_Gz() throws Exception {
          String filename = "data/xyz/bf3.xyz.gz";
          InputStream input = new BufferedInputStream(new GZIPInputStream(this.getClass().getClassLoader()
                  .getResourceAsStream(filename)));
          IChemFormat format = factory.guessFormat(input);
          Assert.assertNotNull(format);
          // make sure the InputStream is properly reset
          BufferedReader reader = new BufferedReader(new InputStreamReader(input));
          String line = reader.readLine();
          Assert.assertNotNull(line);
          Assert.assertEquals("4", line);
          line = reader.readLine();
          Assert.assertNotNull(line);
          Assert.assertEquals("Bortrifluorid", line);
      }
test_case.class_method_signature: FormatFactoryTest.testGuessFormat_Gz()
test_case.full_signature: @Test public void testGuessFormat_Gz()
test_case.identifier: testGuessFormat_Gz
test_case.invocations: getResourceAsStream getClassLoader getClass guessFormat assertNotNull readLine assertNotNull assertEquals readLine assertNotNull assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGuessFormat_Gz()
focal_class.declarator: headerLength
focal_class.modifier: private
focal_class.original_string: private int                      headerLength;
focal_class.type: int
focal_class.var_name: headerLength
focal_class.declarator: formats = new ArrayList<IChemFormatMatcher>(100)
focal_class.modifier: private
focal_class.original_string: private List<IChemFormatMatcher> formats = new ArrayList<IChemFormatMatcher>(100);
focal_class.type: List<IChemFormatMatcher>
focal_class.var_name: formats
focal_class.declarator: LOGGER = LoggingToolFactory.createLoggingTool(FormatFactory.class)
focal_class.modifier: private final static
focal_class.original_string: private final static ILoggingTool LOGGER = LoggingToolFactory.createLoggingTool(FormatFactory.class);
focal_class.type: ILoggingTool
focal_class.var_name: LOGGER
focal_class.file: storage/ioformats/src/main/java/org/openscience/cdk/io/FormatFactory.java
focal_class.identifier: FormatFactory
focal_class.class_method_signature: FormatFactory.FormatFactory()
focal_class.full_signature: public  FormatFactory()
focal_class.identifier: FormatFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  FormatFactory()
focal_class.class_method_signature: FormatFactory.FormatFactory(int headerLength)
focal_class.full_signature: public  FormatFactory(int headerLength)
focal_class.identifier: FormatFactory
focal_class.modifiers: public
focal_class.parameters: (int headerLength)
focal_class.signature:  FormatFactory(int headerLength)
focal_class.class_method_signature: FormatFactory.loadFormats()
focal_class.full_signature: private void loadFormats()
focal_class.identifier: loadFormats
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadFormats()
focal_class.class_method_signature: FormatFactory.registerFormat(IChemFormatMatcher format)
focal_class.full_signature: public void registerFormat(IChemFormatMatcher format)
focal_class.identifier: registerFormat
focal_class.modifiers: public
focal_class.parameters: (IChemFormatMatcher format)
focal_class.return: void
focal_class.signature: void registerFormat(IChemFormatMatcher format)
focal_class.class_method_signature: FormatFactory.getFormats()
focal_class.full_signature: public List<IChemFormatMatcher> getFormats()
focal_class.identifier: getFormats
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<IChemFormatMatcher>
focal_class.signature: List<IChemFormatMatcher> getFormats()
focal_class.class_method_signature: FormatFactory.guessFormat(Reader input)
focal_class.full_signature: public IChemFormat guessFormat(Reader input)
focal_class.identifier: guessFormat
focal_class.modifiers: public
focal_class.parameters: (Reader input)
focal_class.return: IChemFormat
focal_class.signature: IChemFormat guessFormat(Reader input)
focal_class.class_method_signature: FormatFactory.guessFormat(InputStream input)
focal_class.full_signature: public IChemFormat guessFormat(InputStream input)
focal_class.identifier: guessFormat
focal_class.modifiers: public
focal_class.parameters: (InputStream input)
focal_class.return: IChemFormat
focal_class.signature: IChemFormat guessFormat(InputStream input)
focal_class.class_method_signature: FormatFactory.getMatchResult( BufferedReader buffer)
focal_class.full_signature: private IChemFormat getMatchResult( BufferedReader buffer)
focal_class.identifier: getMatchResult
focal_class.modifiers: private
focal_class.parameters: ( BufferedReader buffer)
focal_class.return: IChemFormat
focal_class.signature: IChemFormat getMatchResult( BufferedReader buffer)
focal_class.class_method_signature: FormatFactory.getXYZFormat(BufferedReader buffer)
focal_class.full_signature: private IChemFormat getXYZFormat(BufferedReader buffer)
focal_class.identifier: getXYZFormat
focal_class.modifiers: private
focal_class.parameters: (BufferedReader buffer)
focal_class.return: IChemFormat
focal_class.signature: IChemFormat getXYZFormat(BufferedReader buffer)
focal_method.body: public IChemFormat guessFormat(Reader input) throws IOException {
          if (input == null) {
              throw new IllegalArgumentException("input cannot be null");
          }
          // make a copy of the header
          char[] header = new char[this.headerLength];
          if (!input.markSupported()) {
              throw new IllegalArgumentException("input must support mark");
          }
          input.mark(this.headerLength);
          input.read(header, 0, this.headerLength);
          input.reset();
  
          BufferedReader buffer = new BufferedReader(new CharArrayReader(header));
          IChemFormat chemFormat = getMatchResult(buffer);
  
          if(chemFormat == null){
          	buffer = new BufferedReader(new CharArrayReader(header));
              chemFormat = getXYZFormat(buffer);
            }
          return chemFormat;
          
      }
focal_method.class_method_signature: FormatFactory.guessFormat(Reader input)
focal_method.full_signature: public IChemFormat guessFormat(Reader input)
focal_method.identifier: guessFormat
focal_method.invocations: markSupported mark read reset getMatchResult getXYZFormat
focal_method.modifiers: public
focal_method.parameters: (Reader input)
focal_method.return: IChemFormat
focal_method.signature: IChemFormat guessFormat(Reader input)