@Override public View getView(int position, View convertView, ViewGroup parent) { Holder holder; convertView = null; // convert view should be null if (convertView == null) { holder = new Holder(); convertView = inflater1.inflate(R.layout.listview_draftreport_item, null); } }
// Unsafe publication public Holder holder; public void initialize() { holder = new Holder(42); }
if(convertView==null){ inflater=(LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); holder=new Holder(); convertView=inflater.inflate(R.layout.gridinflater, null); holder.imageView=(ImageView) convertView.findViewById(R.id.img); holder.textView=(TextView) convertView.findViewById(R.id.txt); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); }
for(...){ Holder holder = new Holder(); holder.key=...; older.value=..; listSortforLastInTop.add(holder); }
public View getView(int position, View convertView, ViewGroup parent) { Holder holder = new Holder(); View rowView; rowView = inflater.inflate(R.layout.cantos_list, null); holder.tv = (TextView) rowView.findViewById(R.id.textCanto); holder.tv.setText(result[position]); Typeface myTypeface = Typeface.createFromAsset(context.getAssets(), "fonts/AftaSerifThin-Regular.otf"); holder.tv.setTypeface(myTypeface); return rowView; }
private class HolderDeserializer implements JsonDeserializer<Holder> { @Override public Holder deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { Type mapType = new TypeToken<Map<String, String>>() {}.getType(); Map<String, String> data = context.deserialize(json, mapType); return new Holder(data); } }
@Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub final Holder holder=new Holder(); View rowView; rowView = inflater.inflate(R.layout.list_item, null); holder.editText = (EditText)rowView.findViewById(R.id.editText); holder.editText.setText(textMap.get(position)); ....
/** * Create a holder using the entityName option based on the passed in principal. * * @param principal the entityName to be associated with the attribute certificate. */ public AttributeCertificateHolder(X500Name principal) { holder = new Holder(generateGeneralNames(principal)); }
/** * Create a holder using the entityName option based on the passed in principal. * * @param principal the entityName to be associated with the attribute certificate. */ public AttributeCertificateHolder(X500Name principal) { holder = new Holder(generateGeneralNames(principal)); }
public class Test { static Holder holder; static void test() { if (holder == null) { holder = new Holder(1); } holder.assertSanity(); } ...
public static Holder getValues(int first, int second) { first = Integer.parseInt(askQ("First Number")); second = Integer.parseInt(askQ("Second Number")); Holder holder = new Holder(); holder.setFirst(first); holder.setSecond(second); return holder; }
public static Holder getValues() { int first = Integer.parseInt(askQ("First Number")); int second = Integer.parseInt(askQ("Second Number")); Holder holder = new Holder(); holder.setFirst(first); holder.setSecond(second); return holder; }
Holder h = new Holder(5); Field f = h.getClass().getDeclaredField("n"); f.setAccessible(true); f.setInt(h, 10); h.assertSanity();
public static void main(String[] args) throws Exception { ObjectMapper mapper = new ObjectMapper(); Holder holder = new Holder(); holder.setOtherStuff("[OTHER STUFF]"); holder.setBytes(new Bytes(new byte[] { 1, 2, 3, 4, 5 })); String json = mapper.writeValueAsString(holder); System.out.println(json); Holder deserialised = mapper.readValue(json, Holder.class); System.out.println(Arrays.toString(deserialised.getBytes().getBytes())); }
public void testCreateDummyRequest(){ //create my mock holder Holder mockHolder = new Holder(); MyClass mockObj = Mockito.spy(new MyClass()); Mockito.doNothing().when(mockObj).doSomething(); mockObj.createDummyRequest(mockHolder); }
public class main { public volatile static Holder holder; public static void main(String[] args) { // TODO Auto-generated method stub // Unsafe publication initialize(); holder.assertSanity(99); } public static void initialize(){ holder = new Holder(42); } }
/** * Create a holder using the baseCertificateID option based on the passed in associated certificate, * * @param cert the certificate to be associated with this holder. */ public AttributeCertificateHolder(X509CertificateHolder cert) { holder = new Holder(new IssuerSerial(generateGeneralNames(cert.getIssuer()), new ASN1Integer(cert.getSerialNumber()))); }
/** * Create a holder using the baseCertificateID option based on the passed in associated certificate, * * @param cert the certificate to be associated with this holder. */ public AttributeCertificateHolder(X509CertificateHolder cert) { holder = new Holder(new IssuerSerial(generateGeneralNames(cert.getIssuer()), new ASN1Integer(cert.getSerialNumber()))); }
public AttributeCertificateHolder(X509Principal issuerName, BigInteger serialNumber) { holder = new org.spongycastle.asn1.x509.Holder(new IssuerSerial( GeneralNames.getInstance(new DERSequence(new GeneralName(issuerName))), new ASN1Integer(serialNumber))); }
public AttributeCertificateHolder(X509Principal issuerName, BigInteger serialNumber) { holder = new org.spongycastle.asn1.x509.Holder(new IssuerSerial( GeneralNames.getInstance(new DERSequence(new GeneralName(issuerName))), new ASN1Integer(serialNumber))); }