com.xinapse.multisliceimage
Class ImageName

java.lang.Object
  extended by com.xinapse.multisliceimage.ImageName

public abstract class ImageName
extends java.lang.Object

Class to add extensions, prefixes and suffices to image file and URL names. This class understands the nature of image file name extensions such as ".img" and ".hdr" and takes care of constructing the correct file names.


Method Summary
static java.lang.String addExtension(java.io.File f, java.lang.String extension)
          Adds an extension to a File to create the name for a new file with the given extension.
static java.lang.String addExtension(java.lang.String name, java.lang.String extension)
          Adds an extension to a file or URL name String to create the name for a new file or URL with the given extension.
static java.lang.String addPrefix(java.io.File f, java.lang.String prefix)
          Adds a prefix to a File name to create the name for a new File with the given prefix.
static java.lang.String addPrefix(java.lang.String name, java.lang.String prefix)
          Adds a prefix to a file or URL name to create the name for a new file or URL with the given prefix.
static java.lang.String addSuffix(java.io.File f, java.lang.String suffix)
          Adds a suffix to a File name to create the name for a new File with the given suffix.
static java.lang.String addSuffix(java.lang.String name, java.lang.String suffix)
          Adds a suffix to a file or URL name to create the name for a new file or URL with the given suffix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addExtension

public static java.lang.String addExtension(java.io.File f,
                                            java.lang.String extension)
Adds an extension to a File to create the name for a new file with the given extension. For example, if the supplied File has a path "/path/AnImage.hdr", with the extension "roi", the returned String will be "/path/AnImage.roi". If the File has a path "/path/AnImage", then the returned String will also be "/path/AnImage.roi".

Parameters:
f - the File to be extended.
extension - the extension to be added.

addExtension

public static java.lang.String addExtension(java.lang.String name,
                                            java.lang.String extension)
Adds an extension to a file or URL name String to create the name for a new file or URL with the given extension. For example, if the supplied name is "/path/AnImage.hdr", with the extension "roi", the returned String will be "/path/AnImage.roi". If the name is "/path/AnImage", then the returned String will also be "/path/AnImage.roi".

Parameters:
name - the file or URL name to be extended.
extension - the extension to be added.

addSuffix

public static java.lang.String addSuffix(java.io.File f,
                                         java.lang.String suffix)
Adds a suffix to a File name to create the name for a new File with the given suffix. For example, if the supplied File has a path "/path/AnImage.hdr", with the suffix "Masked", the returned String will be "/path/AnImageMasked.hdr". If the File has a path "/path/AnImage", then the returned String will be "/path/AnImageMasked".

Parameters:
f - the File to be which the suffix is to be added.
suffix - the suffix to be added.

addSuffix

public static java.lang.String addSuffix(java.lang.String name,
                                         java.lang.String suffix)
Adds a suffix to a file or URL name to create the name for a new file or URL with the given suffix. For example, if the supplied name is "/path/AnImage.hdr", with the suffix "Masked", the returned String will be "/path/AnImageMasked.hdr". If the name is "/path/AnImage", then the returned String will also be "/path/AnImageMasked".

Parameters:
name - the name of the file or URL to be which the suffix is to be added.
suffix - the suffix to be added.

addPrefix

public static java.lang.String addPrefix(java.io.File f,
                                         java.lang.String prefix)
Adds a prefix to a File name to create the name for a new File with the given prefix. For example, if the supplied File has a path "/path/AnImage.hdr", with the prefix "Masked", the returned String will be "/path/MaskedAnImage.hdr". If the File has a path "/path/AnImage", then the returned String will be "/path/MaskedAnImage".

Parameters:
f - the File to be which the prefix is to be added.
prefix - the prefix to be added.

addPrefix

public static java.lang.String addPrefix(java.lang.String name,
                                         java.lang.String prefix)
Adds a prefix to a file or URL name to create the name for a new file or URL with the given prefix. For example, if the supplied name is "/path/AnImage.hdr", with the prefix "Masked", the returned String will be "/path/MaskedAnImage.hdr". If the name is "/path/MaskedAnImage", then the returned String will also be "/path/MaskedAnImage".

Parameters:
name - the name of the file or URL to which the prefix is to be added.
prefix - the prefix to be added.


Copyright 2006-2008 Xinapse Systems Limited. All Rights Reserved.