本文整理汇总了C#中ArrayStack.contains方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayStack.contains方法的具体用法?C# ArrayStack.contains怎么用?C# ArrayStack.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayStack
的用法示例。
在下文中一共展示了ArrayStack.contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: verbosePrintInternal
/**
* Implementation providing functionality for {@link #debugPrint} and for
* {@link #verbosePrint}. This prints the given map with nice line breaks.
* If the debug flag is true, it additionally prints the type of the object
* value. If the contents of a map include the map itself, then the text
* <em>(this Map)</em> is printed out. If the contents include a
* parent container of the map, the the text <em>(ancestor[i] Map)</em> is
* printed, where i actually indicates the number of levels which must be
* traversed in the sequential list of ancestors (e.g. father, grandfather,
* great-grandfather, etc).
*
* @param out the stream to print to
* @param label the label to be used, may be <code>null</code>.
* If <code>null</code>, the label is not output.
* It typically represents the name of the property in a bean or similar.
* @param map the map to print, may be <code>null</code>.
* If <code>null</code>, the text 'null' is output
* @param lineage a stack consisting of any maps in which the previous
* argument is contained. This is checked to avoid infinite recursion when
* printing the output
* @param debug flag indicating whether type names should be output.
* @throws NullPointerException if the stream is <code>null</code>
*/
private static void verbosePrintInternal(
java.lang.PrintStream outJ,
Object label,
java.util.Map<Object, Object> map,
ArrayStack lineage,
bool debug)
{
printIndent(outJ, lineage.size());
if (map == null)
{
if (label != null)
{
outJ.print(label);
outJ.print(" = ");
}
outJ.println("null");
return;
}
if (label != null)
{
outJ.print(label);
outJ.println(" = ");
}
printIndent(outJ, lineage.size());
outJ.println("{");
lineage.push(map);
for (java.util.Iterator<java.util.MapNS.Entry<Object, Object>> it = map.entrySet().iterator(); it.hasNext(); )
{
java.util.MapNS.Entry<Object, Object> entry = it.next();
Object childKey = entry.getKey();
Object childValue = entry.getValue();
if (childValue is java.util.Map<Object, Object> && !lineage.contains(childValue))
{
verbosePrintInternal(
outJ,
(childKey == null ? "null" : childKey),
(java.util.Map<Object, Object>)childValue,
lineage,
debug);
}
else
{
printIndent(outJ, lineage.size());
outJ.print(childKey);
outJ.print(" = ");
int lineageIndex = lineage.indexOf(childValue);
if (lineageIndex == -1)
{
outJ.print(childValue);
}
else if (lineage.size() - 1 == lineageIndex)
{
outJ.print("(this Map)");
}
else
{
outJ.print(
"(ancestor["
+ (lineage.size() - 1 - lineageIndex - 1)
+ "] Map)");
}
if (debug && childValue != null)
{
outJ.print(' ');
outJ.println(childValue.getClass().getName());
}
else
{
outJ.println();
}
}
//.........这里部分代码省略.........