|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbyucc.edif.BasicEdifBusNamingPolicy
public class BasicEdifBusNamingPolicy
Basic implementation of the EdifBusNamingPolicy using regular expressions. This class performs the parsing on given EdifNet names by comparing the names with predefined regular expressions. The regular expressions define the naming policy.
| Field Summary | |
|---|---|
private java.util.regex.Pattern |
_p
|
static java.lang.String |
BASENAME_GROUP
|
static java.lang.String |
BRACKET_BUS
This regular expression will match against a bus name that ends with [n:m] where n and m are decimal numbers. |
static java.lang.String |
LEFT_BRACKET
|
static java.lang.String |
LEFT_PAREN
|
static java.lang.String |
LESS_GREATER_BUS
This regular expression will match against a bus name that ends with |
static java.lang.String |
PARANTHESIS_BUS
This regular expression will match against a bus name that ends with (n:m) where n and m are decimal numbers. |
static java.lang.String |
RIGHT_BRACKET
|
static java.lang.String |
RIGHT_PAREN
|
static java.lang.String |
UNSIGNED_INTEGER_GROUP
|
| Constructor Summary | |
|---|---|
BasicEdifBusNamingPolicy(java.lang.String regex)
Create a new naming policy based on the given regular expression. |
|
| Method Summary | |
|---|---|
static EdifBusNamingPolicy |
EdifBusNamingPolicy(java.lang.String str)
Parses a string and identifies the bus naming scheme that matches the given string. |
java.lang.String |
getBusBaseName(java.lang.String name)
Parse the given bus name to determine its basename according to the policy. |
static java.lang.String |
getBusBaseNameStatic(java.lang.String name)
Get the base name of a bus name by first determining which policy it conforms to and then calling the getBusBaseName(String) method on that policy. |
java.lang.String |
getBusRangeSpecifier(java.lang.String name)
Return the portion of the bus string that specifies the range of the bus. |
int |
getLeftBusLimit(java.lang.String name)
Returns the integer value of the "left" bus limit within the bus string name (i.e. |
private java.util.regex.Matcher |
getMatcher(java.lang.String name)
|
java.lang.String |
getRegexString()
Get the regular expression String from which this policy was created |
int |
getRightBusLimit(java.lang.String name)
Returns the integer value of the "right" bus limit within the bus string name (i.e. |
boolean |
isLittleEndian(java.lang.String name)
Determine the bit ordering of the given EDIF bus name. |
boolean |
isValidBusName(java.lang.String name)
Determine whether the given String is a valid Bus name using the implemented bus naming policy. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LEFT_PAREN
public static final java.lang.String RIGHT_PAREN
public static final java.lang.String LEFT_BRACKET
public static final java.lang.String RIGHT_BRACKET
public static final java.lang.String UNSIGNED_INTEGER_GROUP
public static final java.lang.String BASENAME_GROUP
public static final java.lang.String LESS_GREATER_BUS
public static final java.lang.String PARANTHESIS_BUS
public static final java.lang.String BRACKET_BUS
private java.util.regex.Pattern _p
| Constructor Detail |
|---|
public BasicEdifBusNamingPolicy(java.lang.String regex)
| Method Detail |
|---|
public static EdifBusNamingPolicy EdifBusNamingPolicy(java.lang.String str)
public java.lang.String getBusBaseName(java.lang.String name)
getBusBaseName in interface EdifBusNamingPolicyname - the bus name to parse
public static java.lang.String getBusBaseNameStatic(java.lang.String name)
name - the bus name to parse
public java.lang.String getBusRangeSpecifier(java.lang.String name)
EdifBusNamingPolicy
getBusRangeSpecifier in interface EdifBusNamingPolicypublic int getLeftBusLimit(java.lang.String name)
EdifBusNamingPolicy
getLeftBusLimit in interface EdifBusNamingPolicypublic java.lang.String getRegexString()
getRegexString in interface EdifBusNamingPolicypublic int getRightBusLimit(java.lang.String name)
EdifBusNamingPolicy
getRightBusLimit in interface EdifBusNamingPolicypublic boolean isLittleEndian(java.lang.String name)
isLittleEndian in interface EdifBusNamingPolicypublic boolean isValidBusName(java.lang.String name)
isValidBusName in interface EdifBusNamingPolicypublic static void main(java.lang.String[] args)
private java.util.regex.Matcher getMatcher(java.lang.String name)
name - the bus name to parse
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||