Packageorg.springextensions.actionscript.domain.util
SVN browsingNamedUtil.as
FisheyeNamedUtil.as
Classpublic final class NamedUtil

Provides utilities for working with INamed implementations.



Public Methods
 MethodDefined by
  
createUniqueName(name:String, namedObjects:Array):String
[static] Returns a unique name for a named object based on the given name.
NamedUtil
  
getBaseName(name:String):String
[static] Returns the base name of the given name.
NamedUtil
  
getSuffixIndex(name:String):int
[static] Returns the index of the generated suffix.
NamedUtil
  
isGeneratedName(name:String):Boolean
[static] Returns whether or not the given name is generated.
NamedUtil
  
isUsedName(name:String, namedObjects:Array):Boolean
[static] Returns whether the given name is already used.
NamedUtil
Method detail
createUniqueName()method
public static function createUniqueName(name:String, namedObjects:Array):String

Returns a unique name for a named object based on the given name. If we do have a duplicate name, we add a counter to the new name, eg. "name (x)"

Parameters
name:String
 
namedObjects:Array

Returns
String
getBaseName()method 
public static function getBaseName(name:String):String

Returns the base name of the given name. This is the part of the name without the generated index.

Parameters
name:String

Returns
String — the base name
getSuffixIndex()method 
public static function getSuffixIndex(name:String):int

Returns the index of the generated suffix.

Parameters
name:String

Returns
int — the index of the suffix
isGeneratedName()method 
public static function isGeneratedName(name:String):Boolean

Returns whether or not the given name is generated.

Parameters
name:String

Returns
Boolean — true if the name is generated, false if not
isUsedName()method 
public static function isUsedName(name:String, namedObjects:Array):Boolean

Returns whether the given name is already used.

Parameters
name:String — the name to check
 
namedObjects:Array — the array of INamed objects

Returns
Boolean