Methods Summary |
---|
public static boolean | checkEqualArrays(com.sun.cli.jmx.support.ParseResult[] lhs, com.sun.cli.jmx.support.ParseResult[] rhs)
if ( lhs == rhs )
return( true );
boolean equal = lhs.length == rhs.length;
if ( equal )
{
for( int i = 0; i < lhs.length; ++i )
{
equal = lhs[ i ].mData.equals( rhs[ i ].mData );
if ( ! equal )
break;
}
}
return( equal );
|
boolean | equalString(java.lang.String s1, java.lang.String s2)
if ( s1 == s2 )
return( true );
// they can't both be null now
if ( s1 != null )
{
return( s1.equals( s2 ) );
}
// s2 != null
return( s2.equals( s1 ) );
|
public boolean | equals(java.lang.Object o)
if ( o == this )
return( true );
if ( ! (o instanceof ParseResult) )
return( false );
final ParseResult rhs = (ParseResult)o;
boolean dataEqual = false;
if ( mData instanceof ParseResult [] )
{
dataEqual = checkEqualArrays( (ParseResult [])mData, (ParseResult [])rhs.mData);
}
else
{
dataEqual = mData.equals( rhs.mData );
}
final boolean equal =
mType == rhs.mType &&
dataEqual &&
equalString( mName, rhs.mName ) &&
equalString( mTypeCast, rhs.mTypeCast );
return( equal );
|
public java.lang.Object | getData()
return( mData );
|
public java.lang.String | getName()
return( mName );
|
public int | getType()
return( mType );
|
public java.lang.String | getTypeCast()
return( mTypeCast );
|
public void | setData(java.lang.Object data)
mData = data;
|
public void | setName(java.lang.String name)
mName = name;
|
public void | setType(int type)
mType = type;
if ( ! (mData instanceof String) )
{
throw new IllegalArgumentException(
"can't set non-String to type LITERAL_STRING: " + mData.getClass().getName());
}
|
public void | setTypeCast(java.lang.String typeCast)
mTypeCast = typeCast;
|
public java.lang.String | toString()
return( this.toString( '," ) );
|
public java.lang.String | toString(char delim)
final int type = getType();
final Object data = getData();
String result = "";
if ( type == ParseResult.LITERAL_STRING )
{
result = (String)data;
}
else if ( type == ParseResult.OTHER )
{
result = (String)data;
}
else if ( type == ParseResult.ARRAY )
{
final ParseResult [] contents = (ParseResult [])data;
result = "{" + ArrayStringifier.stringify( contents, "" + delim ) + "}";
}
else
{
assert( false );
}
final String typeCast = getTypeCast();
if ( typeCast != null )
{
result = "(" + typeCast + ")" + result;
}
final String name = getName();
if ( name != null )
{
result = name + "=" + result;
}
return( result );
|