Archiviert
13
0
Dieses Repository wurde am 2021-01-06 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
ProtocolLib/Javadoc/com/comphenix/protocol/reflect/StructureModifier.html
2012-10-17 08:07:20 +02:00

788 Zeilen
44 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Wed Oct 17 08:05:08 CEST 2012 -->
<title>StructureModifier</title>
<meta name="date" content="2012-10-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="StructureModifier";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StructureModifier.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/comphenix/protocol/reflect/PrimitiveUtils.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/comphenix/protocol/reflect/StructureModifierTest.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/comphenix/protocol/reflect/StructureModifier.html" target="_top">Frames</a></li>
<li><a href="StructureModifier.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.comphenix.protocol.reflect</div>
<h2 title="Class StructureModifier" class="title">Class StructureModifier&lt;TField&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.comphenix.protocol.reflect.StructureModifier&lt;TField&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>TField</code> - Type of the fields to retrieve.</dd></dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../com/comphenix/protocol/reflect/compiler/CompiledStructureModifier.html" title="class in com.comphenix.protocol.reflect.compiler">CompiledStructureModifier</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">StructureModifier&lt;TField&gt;</span>
extends java.lang.Object</pre>
<div class="block">Provides list-oriented access to the fields of a Minecraft packet.
<p>
Implemented by using reflection. Use a CompiledStructureModifier, if speed is essential.</div>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Kristian</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#converter">converter</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#customConvertHandling">customConvertHandling</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.util.List&lt;java.lang.reflect.Field&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#data">data</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected java.util.Map&lt;java.lang.reflect.Field,java.lang.Integer&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#defaultFields">defaultFields</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.lang.Class</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#fieldType">fieldType</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected java.util.Map&lt;java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#subtypeCache">subtypeCache</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#target">target</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected java.lang.Class</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#targetType">targetType</a></strong></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#StructureModifier()">StructureModifier</a></strong>()</code>
<div class="block">Consumers of this method should call "initialize".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#StructureModifier(java.lang.Class, java.lang.Class, boolean)">StructureModifier</a></strong>(java.lang.Class&nbsp;targetType,
java.lang.Class&nbsp;superclassExclude,
boolean&nbsp;requireDefault)</code>
<div class="block">Creates a structure modifier.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.List&lt;java.lang.reflect.Field&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getFields()">getFields</a></strong>()</code>
<div class="block">Retrieves a list of the fields matching the constraints of this structure modifier.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Class</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getFieldType()">getFieldType</a></strong>()</code>
<div class="block">Retrieves the common type of each field.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getTarget()">getTarget</a></strong>()</code>
<div class="block">Retrieves the object we're currently modifying.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Class</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getTargetType()">getTargetType</a></strong>()</code>
<div class="block">Retrieves the type of the object we're modifying.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.List&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getValues()">getValues</a></strong>()</code>
<div class="block">Retrieve every value stored in the fields of the current type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#initialize(java.lang.Class, java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter, java.util.Map)">initialize</a></strong>(java.lang.Class&nbsp;targetType,
java.lang.Class&nbsp;fieldType,
java.util.List&lt;java.lang.reflect.Field&gt;&nbsp;data,
java.util.Map&lt;java.lang.reflect.Field,java.lang.Integer&gt;&nbsp;defaultFields,
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;converter,
java.util.Map&lt;java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&gt;&nbsp;subTypeCache)</code>
<div class="block">Initialize every field of this class.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#initialize(com.comphenix.protocol.reflect.StructureModifier)">initialize</a></strong>(<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;other)</code>
<div class="block">Initialize using the same field types.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#modify(int, com.google.common.base.Function)">modify</a></strong>(int&nbsp;fieldIndex,
com.google.common.base.Function&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;select)</code>
<div class="block">Correctly modifies the value of a field.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#read(int)">read</a></strong>(int&nbsp;fieldIndex)</code>
<div class="block">Reads the value of a field given its index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#readSafely(int)">readSafely</a></strong>(int&nbsp;fieldIndex)</code>
<div class="block">Reads the value of a field if and ONLY IF it exists.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#setConverter(com.comphenix.protocol.reflect.EquivalentConverter)">setConverter</a></strong>(<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;converter)</code>
<div class="block">Set the current object converter.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#size()">size</a></strong>()</code>
<div class="block">Retrieve the number of readable types.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected &lt;T&gt;&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withFieldType(java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter)">withFieldType</a></strong>(java.lang.Class&nbsp;fieldType,
java.util.List&lt;java.lang.reflect.Field&gt;&nbsp;filtered,
java.util.Map&lt;java.lang.reflect.Field,java.lang.Integer&gt;&nbsp;defaults,
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;T&gt;&nbsp;converter)</code>
<div class="block">Create a new structure modifier for the new field type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withTarget(java.lang.Object)">withTarget</a></strong>(java.lang.Object&nbsp;target)</code>
<div class="block">Retrieves a structure modifier of the same type for a different object target.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withType(java.lang.Class)">withType</a></strong>(java.lang.Class&nbsp;fieldType)</code>
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withType(java.lang.Class, com.comphenix.protocol.reflect.EquivalentConverter)">withType</a></strong>(java.lang.Class&nbsp;fieldType,
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;T&gt;&nbsp;converter)</code>
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#write(int, TField)">write</a></strong>(int&nbsp;fieldIndex,
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&nbsp;value)</code>
<div class="block">Writes the value of a field given its index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#writeDefaults()">writeDefaults</a></strong>()</code>
<div class="block">Sets all non-primitive fields to a more fitting default value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#writeSafely(int, TField)">writeSafely</a></strong>(int&nbsp;fieldIndex,
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&nbsp;value)</code>
<div class="block">Writes the value of a given field IF and ONLY if it exists.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="targetType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>targetType</h4>
<pre>protected&nbsp;java.lang.Class targetType</pre>
</li>
</ul>
<a name="target">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>target</h4>
<pre>protected&nbsp;java.lang.Object target</pre>
</li>
</ul>
<a name="converter">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>converter</h4>
<pre>protected&nbsp;<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt; converter</pre>
</li>
</ul>
<a name="fieldType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fieldType</h4>
<pre>protected&nbsp;java.lang.Class fieldType</pre>
</li>
</ul>
<a name="data">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>data</h4>
<pre>protected&nbsp;java.util.List&lt;java.lang.reflect.Field&gt; data</pre>
</li>
</ul>
<a name="defaultFields">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defaultFields</h4>
<pre>protected&nbsp;java.util.Map&lt;java.lang.reflect.Field,java.lang.Integer&gt; defaultFields</pre>
</li>
</ul>
<a name="subtypeCache">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>subtypeCache</h4>
<pre>protected&nbsp;java.util.Map&lt;java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&gt; subtypeCache</pre>
</li>
</ul>
<a name="customConvertHandling">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>customConvertHandling</h4>
<pre>protected&nbsp;boolean customConvertHandling</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="StructureModifier(java.lang.Class, java.lang.Class, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>StructureModifier</h4>
<pre>public&nbsp;StructureModifier(java.lang.Class&nbsp;targetType,
java.lang.Class&nbsp;superclassExclude,
boolean&nbsp;requireDefault)</pre>
<div class="block">Creates a structure modifier.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - the structure to modify.</dd><dd><code>superclassExclude</code> - - a superclass to exclude.</dd><dd><code>requireDefault</code> - - whether or not we will be using writeDefaults().</dd></dl>
</li>
</ul>
<a name="StructureModifier()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>StructureModifier</h4>
<pre>protected&nbsp;StructureModifier()</pre>
<div class="block">Consumers of this method should call "initialize".</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="initialize(com.comphenix.protocol.reflect.StructureModifier)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialize</h4>
<pre>protected&nbsp;void&nbsp;initialize(<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;other)</pre>
<div class="block">Initialize using the same field types.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>other</code> - - information to set.</dd></dl>
</li>
</ul>
<a name="initialize(java.lang.Class, java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter, java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialize</h4>
<pre>protected&nbsp;void&nbsp;initialize(java.lang.Class&nbsp;targetType,
java.lang.Class&nbsp;fieldType,
java.util.List&lt;java.lang.reflect.Field&gt;&nbsp;data,
java.util.Map&lt;java.lang.reflect.Field,java.lang.Integer&gt;&nbsp;defaultFields,
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;converter,
java.util.Map&lt;java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&gt;&nbsp;subTypeCache)</pre>
<div class="block">Initialize every field of this class.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - type of the object we're reading and writing from.</dd><dd><code>fieldType</code> - - the common type of the fields we're modifying.</dd><dd><code>data</code> - - list of fields to modify.</dd><dd><code>defaultFields</code> - - list of fields that will be automatically initialized.</dd><dd><code>converter</code> - - converts between the common field type and the actual type the consumer expects.</dd><dd><code>subTypeCache</code> - - a structure modifier cache.</dd></dl>
</li>
</ul>
<a name="read(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&nbsp;read(int&nbsp;fieldIndex)
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Reads the value of a field given its index.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Value of the field.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field doesn't exist, or it cannot be accessed under the current security contraints.</dd></dl>
</li>
</ul>
<a name="readSafely(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readSafely</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&nbsp;readSafely(int&nbsp;fieldIndex)
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Reads the value of a field if and ONLY IF it exists.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Value of the field, or NULL if it doesn't exist.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field cannot be accessed under the current security contraints.</dd></dl>
</li>
</ul>
<a name="write(int,java.lang.Object)">
<!-- -->
</a><a name="write(int, TField)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;write(int&nbsp;fieldIndex,
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&nbsp;value)
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Writes the value of a field given its index.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd><dd><code>value</code> - - new value of the field.</dd>
<dt><span class="strong">Returns:</span></dt><dd>This structure modifier - for chaining.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field doesn't exist, or it cannot be accessed under the current security contraints.</dd></dl>
</li>
</ul>
<a name="writeSafely(int,java.lang.Object)">
<!-- -->
</a><a name="writeSafely(int, TField)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeSafely</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;writeSafely(int&nbsp;fieldIndex,
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&nbsp;value)
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Writes the value of a given field IF and ONLY if it exists.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the potential field.</dd><dd><code>value</code> - - new value of the field.</dd>
<dt><span class="strong">Returns:</span></dt><dd>This structure modifer - for chaining.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field cannot be accessed under the current security contraints.</dd></dl>
</li>
</ul>
<a name="modify(int, com.google.common.base.Function)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>modify</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;modify(int&nbsp;fieldIndex,
com.google.common.base.Function&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;select)
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Correctly modifies the value of a field.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field to modify.</dd><dd><code>select</code> - - the function that modifies the field value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>This structure modifier - for chaining.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field cannot be accessed under the current security contraints.</dd></dl>
</li>
</ul>
<a name="withType(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withType</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;T&gt;&nbsp;withType(java.lang.Class&nbsp;fieldType)</pre>
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldType</code> - - the type, or supertype, of every field to modify.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A structure modifier for fields of this type.</dd></dl>
</li>
</ul>
<a name="writeDefaults()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeDefaults</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;writeDefaults()
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Sets all non-primitive fields to a more fitting default value. See <a href="../../../../com/comphenix/protocol/reflect/instances/DefaultInstances.html#getDefault(java.lang.Class)"><code>DefaultInstances.getDefault(Class)</code></a>.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The current structure modifier - for chaining.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - If we're unable to write to the fields due to a security limitation.</dd></dl>
</li>
</ul>
<a name="withType(java.lang.Class, com.comphenix.protocol.reflect.EquivalentConverter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withType</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;T&gt;&nbsp;withType(java.lang.Class&nbsp;fieldType,
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;T&gt;&nbsp;converter)</pre>
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldType</code> - - the type, or supertype, of every field to modify.</dd><dd><code>converter</code> - - converts objects into the given type.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A structure modifier for fields of this type.</dd></dl>
</li>
</ul>
<a name="getFieldType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFieldType</h4>
<pre>public&nbsp;java.lang.Class&nbsp;getFieldType()</pre>
<div class="block">Retrieves the common type of each field.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Common type of each field.</dd></dl>
</li>
</ul>
<a name="getTargetType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTargetType</h4>
<pre>public&nbsp;java.lang.Class&nbsp;getTargetType()</pre>
<div class="block">Retrieves the type of the object we're modifying.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Type of the object.</dd></dl>
</li>
</ul>
<a name="getTarget()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTarget</h4>
<pre>public&nbsp;java.lang.Object&nbsp;getTarget()</pre>
<div class="block">Retrieves the object we're currently modifying.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Object we're modifying.</dd></dl>
</li>
</ul>
<a name="size()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>size</h4>
<pre>public&nbsp;int&nbsp;size()</pre>
<div class="block">Retrieve the number of readable types.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Readable types.</dd></dl>
</li>
</ul>
<a name="withFieldType(java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withFieldType</h4>
<pre>protected&nbsp;&lt;T&gt;&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;T&gt;&nbsp;withFieldType(java.lang.Class&nbsp;fieldType,
java.util.List&lt;java.lang.reflect.Field&gt;&nbsp;filtered,
java.util.Map&lt;java.lang.reflect.Field,java.lang.Integer&gt;&nbsp;defaults,
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;T&gt;&nbsp;converter)</pre>
<div class="block">Create a new structure modifier for the new field type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldType</code> - - common type of each field.</dd><dd><code>filtered</code> - - list of fields after filtering the original modifier.</dd><dd><code>defaults</code> - - list of default values after filtering the original.</dd><dd><code>converter</code> - - the new converter.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new structure modifier.</dd></dl>
</li>
</ul>
<a name="withTarget(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withTarget</h4>
<pre>public&nbsp;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;withTarget(java.lang.Object&nbsp;target)</pre>
<div class="block">Retrieves a structure modifier of the same type for a different object target.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>target</code> - - different target of the same type.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Structure modifier with the new target.</dd></dl>
</li>
</ul>
<a name="setConverter(com.comphenix.protocol.reflect.EquivalentConverter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setConverter</h4>
<pre>protected&nbsp;void&nbsp;setConverter(<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a>&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;converter)</pre>
<div class="block">Set the current object converter. Should only be called during construction.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>converter</code> - - current object converter.</dd></dl>
</li>
</ul>
<a name="getFields()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFields</h4>
<pre>public&nbsp;java.util.List&lt;java.lang.reflect.Field&gt;&nbsp;getFields()</pre>
<div class="block">Retrieves a list of the fields matching the constraints of this structure modifier.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>List of fields.</dd></dl>
</li>
</ul>
<a name="getValues()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getValues</h4>
<pre>public&nbsp;java.util.List&lt;<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>&gt;&nbsp;getValues()
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
<div class="block">Retrieve every value stored in the fields of the current type.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Every field value.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - Unable to access one or all of the fields</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StructureModifier.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/comphenix/protocol/reflect/PrimitiveUtils.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/comphenix/protocol/reflect/StructureModifierTest.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/comphenix/protocol/reflect/StructureModifier.html" target="_top">Frames</a></li>
<li><a href="StructureModifier.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>