XanderFileUtil

From Robowiki
Revision as of 22:28, 10 November 2011 by Skotty (talk | contribs) (stub)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

The Xander File Utility is a single class, XanderFileUtil, that makes it easier to handle loading and saving data from and to disk across multiple versions of your robot.

A word of caution -- this utility class is not designed to handle the situation where you run a robot against itself.

Consider it freeware. Use it as you like. The full source will be posted below in the next day or two.

Usage

The two main methods of this utility class are:

public static void save(Serializable o, AdvancedRobot robot, String fileNamePrefix, boolean separateByVersion, boolean allowOverwriteOfNewerVersions)

public static <T> T load(AdvancedRobot robot, String fileNamePrefix, boolean separateByVersion, boolean allowReadFromOtherVersions)

Robot Version Support

Determining whether a robot version is an earlier or later version from another is done by examining the version string. The version string can consist of one or more character sequences separated by periods, as in the following examples:

  • 7
  • 1.5.0
  • 10.7c
  • 3ab.4cd