Class OEISWriter
java.lang.Object
org.episteme.core.io.AbstractResourceWriter<IntegerSequence>
org.episteme.core.mathematics.loaders.oeis.OEISWriter
- All Implemented Interfaces:
ResourceIO<IntegerSequence>, ResourceWriter<IntegerSequence>
Writer for exporting sequences to OEIS formats.
Supports stripped format and b-file format.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexportBFile(IntegerSequence sequence, int count, PrintWriter writer) Exports a sequence to the b-file format.static voidexportStripped(IntegerSequence sequence, int count, PrintWriter writer) Exports a sequence to the 'stripped' format.format(OEISWriter.OEISOutputFormat format) Returns the category for grouping.Returns a short description of this resource handler.Returns a long description of this resource handler.getName()Returns the display name of this resource handler.Returns the base path where this resource is located.Returns the type of resource.String[]Returns the supported versions of the format this reader/writer handles.static booleanisValidOEISId(String id) Validates an OEIS ID format (A followed by 6 digits).voidsave(IntegerSequence sequence, String destination) Saves the resource to a destination.termCount(int count) Methods inherited from class AbstractResourceWriter
createBufferedStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceIO
getExpectedResourceFiles, getSupportedExtensions, isFileBased, isInputMethods inherited from interface ResourceWriter
isOutput
-
Constructor Details
-
OEISWriter
public OEISWriter()
-
-
Method Details
-
getResourceType
Description copied from interface:ResourceIOReturns the type of resource. -
getResourcePath
Description copied from interface:ResourceIOReturns the base path where this resource is located. -
getCategory
Description copied from interface:ResourceIOReturns the category for grouping. MUST be implemented with I18N support.- Specified by:
getCategoryin interfaceResourceIO<IntegerSequence>- Overrides:
getCategoryin classAbstractResourceWriter<IntegerSequence>- Returns:
- the category name
-
getName
Description copied from interface:ResourceIOReturns the display name of this resource handler. MUST be implemented with I18N support.- Specified by:
getNamein interfaceResourceIO<IntegerSequence>- Overrides:
getNamein classAbstractResourceWriter<IntegerSequence>- Returns:
- the display name
-
getDescription
Description copied from interface:ResourceIOReturns a short description of this resource handler. MUST be implemented with I18N support.- Specified by:
getDescriptionin interfaceResourceIO<IntegerSequence>- Overrides:
getDescriptionin classAbstractResourceWriter<IntegerSequence>- Returns:
- the description
-
getLongDescription
Description copied from interface:ResourceIOReturns a long description of this resource handler. MUST be implemented with I18N support.- Specified by:
getLongDescriptionin interfaceResourceIO<IntegerSequence>- Overrides:
getLongDescriptionin classAbstractResourceWriter<IntegerSequence>- Returns:
- the long description
-
termCount
-
format
-
save
Description copied from interface:ResourceWriterSaves the resource to a destination.- Throws:
Exception
-
exportStripped
Exports a sequence to the 'stripped' format. Format: ID ,term1,term2,term3,... -
isValidOEISId
Validates an OEIS ID format (A followed by 6 digits). -
exportBFile
Exports a sequence to the b-file format. Format: n a(n) -
getSupportedVersions
Description copied from interface:ResourceIOReturns the supported versions of the format this reader/writer handles.Each implementation MUST override this method to declare which versions of the underlying format are supported. The returned array should contain version strings in the format's standard notation (e.g., "3.0", "2.1", "Level 3 Version 2").
Examples:
- MathML: {"3.0", "2.0"}
- SBML: {"Level 3 Version 2", "Level 3 Version 1", "Level 2 Version 5"}
- PhyloXML: {"1.10", "1.00"}
- Returns:
- array of supported version strings, never null (empty array if version-agnostic)
-