/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
List<Detail> allDetails = new LinkedList<Detail>(); while(rs.next()) { String a = rs.getString("weight"); String b = rs.getString("note_state"); String c = rs.getString("dm_state"); allDetail.add(new Detail (a, b, c)); }
public static Detail newInstance(String time) { Detail fragment = new Detail(); Bundle args = new Bundle(); args.putString("time", time); fragment.setArguments(args); return fragment; }
String jsondata = loadJSONFromAsset();//load data and assign as json string JSONArray primaryArray; try { primaryArray = new JSONArray(jsondata); for (int i = 0; i < primaryArray.length(); i++) { JSONObject jObject = primaryArray.getJSONObject(i); String description = (String) jObject.getString("Description"); Log.d("Description", description); Double latitude = jObject.getDouble("Latitude"); Log.d("Latitude", latitude+""); Double longitude = jObject.getDouble("Longitude"); Log.d("Longitude", longitude+""); detailList.add(new Detail(description, latitude, longitude)); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); }
List<Detail> detailList = new ArrayList<>(); JSONArray journeys = new JSONObject(""); for(int i = 0 ; i < journeys.length() ; i++) { // Traverse journeys JSONObject journey = journeys.getJSONObject(i); // get journeys(i) -> journey if(journey.has("legs")) { // if journey has "legs" key JSONArray legs = journey.getJSONArray("legs"); // get the legs array from journey object for(int j = 0 ; j < legs.length() ; j++) { // Traverse legs JSONObject leg = legs.getJSONObject(j); // get legs(j) -> leg if(leg.has("instruction")) { // if leg has "instruction" key in it JSONObject instruction = leg.getJSONObject("instruction"); // get instruction jsonObject String journeyType = journey.getString("$type"); String legType = leg.getString("$type"); String instructionType = instruction.getString("$type"); String detailed = instruction.getString("detailed"); // get detailed string in instruction object detailList.add(new Detail(journeyType, legType, instructionType, detailed)); } } } } for(Detail detail : detailList) { TextView textView = new TextView([yourContext]); textView.setText(detail.detail); yourContentViewGroup.addView(textView); // or you can use View.inflate(context, layoutRes, yourContentViewGroup) and design a layout to show other detail instance values }
public class MasterDetailResultSetExtractor implements ResultSetExtractor { @Override public Object extractData(ResultSet rs) throws SQLException { Master m = new Master(); m.setFirstName(rs.getString(1)); m.setLastName(rs.getString(2)); //put the master in a map Detail d = new Detail(); d.setSomeProp(rs.getString(3)); //check if the master is in the map //if yes - add the detail to the master //if no - add the master first return m; } }
oldDetails.put(new Detail(text,oldHeaderId)); oldDetails.moveToNext();
public Fragment getItem(int position) { return new Detail("I'm a detail!");
detail = new Detail();
Product p1 = new Product("the container"); Product p2 = new Product("the product"); Detail d = new Detail(); d.setProduct(p2); p1.getDetails().add(d); session.save(p2); session.save(p1);
Master master = new Master(); master.id(masterPk); Detail detail = new Detail(); detail.id(detailPk); detail.setMaster(master); // the owning side of the master-detail relationship master.setDetail(detail); // mandatory if CascadeType.PERSIST is not defined em.persist(detail);